You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(rich-md-editor): fix raw-HTML-block fragmentation and styling
- RawHtmlBlock previously delegated to marked's built-in block-HTML tokenizer, which (per CommonMark's HTML-block-type-6 rule) stops at the first blank line. A real <details> with a paragraph inside — the common case — fragmented into a raw chip, an ordinary rendered paragraph, and a second raw chip, stranding real content in between.
- Fixed with a custom block-level tokenizer that scans to the tag's matching close (reusing the balanced open/close depth-tracking already built for nested inline HTML), spanning blank lines, restricted to CommonMark's own block-tag whitelist (details, div, table, section, etc.) so tags that can legitimately start a paragraph (em, a, span, code, kbd) are left untouched.
- Dropped the warning-colored tint on raw HTML/footnote blocks (color-mix with --warning read as an error state) in favor of the same neutral surface as existing code blocks — the hover badge alone now signals "this is raw, unrendered text".
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/raw-markdown-snippet.test.ts
+60-1Lines changed: 60 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -6,12 +6,17 @@
6
6
* and reach a fixpoint on a second pass (see `serializeMarkdownDocument` in `./markdown-parse.ts`).
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/raw-markdown-snippet.tsx
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/rich-markdown-editor.css
+8-2Lines changed: 8 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -279,17 +279,23 @@
279
279
280
280
/* Raw, unrendered markdown constructs the schema has no real node/mark for (raw HTML blocks,
281
281
comments, footnotes) — held verbatim and re-emitted byte-for-byte on save (./raw-markdown-snippet.ts).
282
-
Styled distinctly (monospace, tinted) so it's clear this text isn't interpreted, unlike a code block. */
282
+
Same neutral surface as `code`/`pre` below (no color tint — a tint reads as a warning/error state,
283
+
which isn't the signal here); the hover "Raw HTML"/"Footnote" badge is what conveys "not interpreted". */
0 commit comments