MCPcopy Create free account
hub / github.com/SLiCAP/SLiCAP_python / description_to_html

Function description_to_html

SLiCAP/schematic/symbol_library.py:160–165  ·  view source on GitHub ↗

Render a symbol's data-description as safe HTML for the place/properties dialogs: a literal ``\\n`` (and any real newline) becomes a line break, all other text is HTML-escaped.

(desc: str)

Source from the content-addressed store, hash-verified

158# ── one parsed symbol ─────────────────────────────────────────────────────────
159
160def description_to_html(desc: str) -> str:
161 """Render a symbol's data-description as safe HTML for the place/properties
162 dialogs: a literal ``\\n`` (and any real newline) becomes a line break, all
163 other text is HTML-escaped."""
164 import html as _html
165 return _html.escape(desc or "").replace("\\n", "<br>").replace("\n", "<br>")
166
167
168def _parse_model_field(raw: str, source: str, sym: str) -> tuple[str, bool]:

Callers 2

_on_selection_changedMethod · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected