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)
| 158 | # ── one parsed symbol ───────────────────────────────────────────────────────── |
| 159 | |
| 160 | def 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 | |
| 168 | def _parse_model_field(raw: str, source: str, sym: str) -> tuple[str, bool]: |
no outgoing calls
no test coverage detected