MCPcopy Index your code
hub / github.com/pywebio/PyWebIO / put_html

Function put_html

pywebio/output.py:462–479  ·  view source on GitHub ↗

Output HTML content :param html: html string :param bool sanitize: Whether to use `DOMPurify `_ to filter the content to prevent XSS attacks. :param int scope, position: Those arguments have the same meaning as for `put_text()`

(html: Any, sanitize: bool = False, scope: str = None, position: int = OutputPosition.BOTTOM)

Source from the content-addressed store, hash-verified

460# declare argument `html` to type `str` will cause type check error
461# so leave this argument's type `Any`
462def put_html(html: Any, sanitize: bool = False, scope: str = None, position: int = OutputPosition.BOTTOM) -> Output:
463 """
464 Output HTML content
465
466 :param html: html string
467 :param bool sanitize: Whether to use `DOMPurify <https://github.com/cure53/DOMPurify>`_ to filter the content to prevent XSS attacks.
468 :param int scope, position: Those arguments have the same meaning as for `put_text()`
469 """
470
471 # Compatible with ipython rich output
472 # See: https://ipython.readthedocs.io/en/stable/config/integrating.html?highlight=Rich%20display#rich-display
473 if hasattr(html, '__html__'):
474 html = html.__html__()
475 elif hasattr(html, '_repr_html_'):
476 html = html._repr_html_()
477
478 spec = _get_output_spec('html', content=html, sanitize=sanitize, scope=scope, position=position)
479 return Output(spec)
480
481
482def put_code(content: str, language: str = '', rows: int = None, scope: str = None,

Callers 15

mainFunction · 0.90
indexFunction · 0.90
pyechartsFunction · 0.85
radar_baseFunction · 0.85
pie_baseFunction · 0.85
line_baseFunction · 0.85
bar_baseFunction · 0.85
plotlyFunction · 0.85
show_popupFunction · 0.85
targetFunction · 0.85
basic_outputFunction · 0.85
show_popupFunction · 0.85

Calls 2

_get_output_specFunction · 0.85
OutputClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…