mirror of
https://github.com/outline/outline.git
synced 2026-06-13 03:14:59 +03:00
5ea63aa1a2
* fix: Block math not closed by trailing $$ on a content line The closing delimiter check compared a 3-character slice against the 2-character "$$" delimiter, so block math closed on the same line as content (e.g. "c = d$$") was never detected and the block swallowed the rest of the document. Use the delimiter length rather than a hardcoded slice. Also fix the indexOf sentinel comparison (!== 1 instead of !== -1) in inline math parsing, which terminated correctly only by coincidence. Adds tests for the math markdown rules and moves the findNodes test helper into shared/test/editor for reuse. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix: NaN width and height parsed for video and image nodes Video parseDOM and parseMarkdown used parseInt on a missing attribute, storing NaN instead of null and persisting it to markdown as NaNxNaN. Image size syntax with a missing dimension (e.g. "=x100") hit the same issue through optional regex groups. Parse dimensions only when present, matching the existing guard in Image parseDOM, and correct the video getAttrs element type. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix: Normalize non-numeric video dimensions, avoid serializing nullxnull Review feedback: parseInt could still produce NaN when the attribute exists but is not numeric (e.g. width="auto"), and toMarkdown wrote null dimensions as "nullxnull". Parse dimensions through a helper that normalizes non-finite values to null, and serialize nullish dimensions as empty strings, which still round-trips as a video node. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * test --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>