Skip to content

Restore <video> in the block-level HTML tag list - #2

Merged
eszlamczyk merged 1 commit into
masterfrom
fix/restore-video-tag-extension
Oct 4, 2026
Merged

eszlamczyk merged 1 commit into
masterfrom
fix/restore-video-tag-extension

Conversation

@eszlamczyk

Copy link
Copy Markdown
Collaborator

Upstream reverted the video tag extension in mity/md4c#428, and this fork inherited the revert. enriched-markdown promotes <video> HTML blocks into video nodes, so without the block form a <video> tag parses as inline raw HTML inside a paragraph and stops rendering as a video.

Found while re-vendoring the fork into software-mansion/enriched-markdown#922: that repo's previous snapshot predates the upstream revert, so the migration silently dropped video rendering.

<video src="https://example.com/clip.mp4" controls></video>
parser AST
the snapshot enriched-markdown vendored before {"type":"Video","attributes":{"url":"…"}}
this fork's master (upstream revert included) {"type":"Paragraph","children":[{"type":"Text","content":"<video src=…"}]}
this branch back to {"type":"Video",…}

Restores v6 plus its map6 slot, and the test/spec-addendum.txt coverage the revert deleted (6 cases, named for the prefix). Marked as a deliberate fork deviation at the tag table and in the README, so a merge from upstream does not silently drop it again — this is a hold until the renderer no longer depends on the block form, not a disagreement with upstream's reasoning.

Verification

  • scripts/run-tests.py: 1024 passed, 0 failed, 0 errored (1018 before, +6 from the restored spec file); clean Release build.
  • scripts/check-exported-symbols.sh: still only enrmrkd_parse, enrmrkd_html, enrmrkd_entity_lookup.
  • Differential against this branch's base over 1034 inputs (spec suites, fuzz seed corpus, repo markdown, 1000 generated adversarial documents) x 3 flag sets: 3 differing cases, all three being the input that contains a <video> tag, none without.
  • End to end through enriched-markdown's own MD4CParser: the video document's serialized AST is identical to the previously vendored parser's, and the 41-file markdown corpus is unchanged.

🤖 Generated with Claude Code

Upstream reverted the video tag extension in mity#428, which this fork
inherited. enriched-markdown promotes <video> HTML blocks into video nodes,
so without the block form a <video> tag parses as inline raw HTML inside a
paragraph and stops rendering as a video.

Keep the extension, with the spec coverage the revert deleted, until that
renderer no longer depends on the block form. The deviation is marked at the
tag table and in the README so a merge from upstream does not silently drop
it again.

Output is unchanged except for documents containing <video>: of 1034 corpus
files (spec suites, fuzz seed corpus, markdown docs, 1000 generated
documents) across three flag sets, the only differing cases are the three
that contain a <video> tag.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@eszlamczyk
eszlamczyk merged commit 76c5fb3 into master Oct 4, 2026
16 checks passed
eszlamczyk added a commit to software-mansion/enriched-markdown that referenced this pull request Oct 4, 2026
The parser is synced from software-mansion-labs/md4c, so a sync can change
how documents parse without any native build noticing. That is not
hypothetical: the migration in the previous commit silently dropped video
rendering, because the fork had inherited upstream's revert of <video> as a
block-level HTML tag (mity/md4c#428) and MD4CParser only promotes <video>
into a video node when the parser reports an HTML block.

Add scripts/test-core-parser.sh, run by a core-parser CI job gated on
packages/core/cpp changes. It compiles the vendored parser and MD4CParser
with the host toolchain, then checks that the parser exports nothing but
enrmrkd_* symbols, that the serialized AST of five fixture documents under
five flag variants matches a golden dump, and that the parser still links
and runs beside upstream mity/md4c (pinned tag) in one binary. The golden
dump is re-recorded with --update, so an intended parser change arrives as a
reviewable diff.

Vendor the fork's restored <video> block tag
(software-mansion-labs/md4c#2), which the golden fixtures cover; running the
check against the previously vendored parser fails on html-blocks.md in all
five variants.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
eszlamczyk added a commit to software-mansion/enriched-markdown that referenced this pull request Oct 16, 2026
* fix: isolate the embedded parser behind an ENRMRKD_ prefix

Enriched embedded MD4C under its original global names, so an application
that also links another MD4C copy failed with a duplicate definition of
md_parse, and the CocoaPods header map could resolve the bare md4c.h
include in the Objective-C++ input parser to another pod's copy (#846).

Vendor the parser from software-mansion-labs/md4c rather than mity/md4c:
the fork renames both the filenames and everything they expose to an
ENRMRKD_/enrmrkd_ prefix, so two copies can coexist. Rename the consumers
to match, and follow the vendored directory rename through the podspecs,
the SwiftPM manifest, the Android CMake files and the example app project.

Includes stay plain and keep resolving through each target's header search
paths; what removes the header map ambiguity is the filename being specific
to the fork, since no other pod ships an enrmrkd.h.

The public API is unchanged: md4cFlags, Md4cFlags, MD4CParser and md4cType
keep their names.

Re-vendoring also moves the parser forward to the fork's master, which
carries upstream work postdating the Sep 17 snapshot (HTML block start
condition 4, the pipe handling rework, the video tag revert). Serialized
ASTs are identical for every markdown file in the repo across five flag
variants, and differ on 49 of 1000 generated adversarial documents - for
instance an empty "||||" spoiler now staying literal text.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* test(core): guard the vendored parser with golden ASTs in CI

The parser is synced from software-mansion-labs/md4c, so a sync can change
how documents parse without any native build noticing. That is not
hypothetical: the migration in the previous commit silently dropped video
rendering, because the fork had inherited upstream's revert of <video> as a
block-level HTML tag (mity/md4c#428) and MD4CParser only promotes <video>
into a video node when the parser reports an HTML block.

Add scripts/test-core-parser.sh, run by a core-parser CI job gated on
packages/core/cpp changes. It compiles the vendored parser and MD4CParser
with the host toolchain, then checks that the parser exports nothing but
enrmrkd_* symbols, that the serialized AST of five fixture documents under
five flag variants matches a golden dump, and that the parser still links
and runs beside upstream mity/md4c (pinned tag) in one binary. The golden
dump is re-recorded with --update, so an intended parser change arrives as a
reviewable diff.

Vendor the fork's restored <video> block tag
(software-mansion-labs/md4c#2), which the golden fixtures cover; running the
check against the previously vendored parser fails on html-blocks.md in all
five variants.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: address cr, update ci and rebuild wasm

* fix: replace all path-only includes with search-path ones

* feat: resolve final issues

* docs: web renders videos now that the WASM bundle is rebuilt

The rebuilt md4c.js emits the `Video` node that #765 added, and the web
renderer has had a `VideoRenderer`, `videoStyle` and the 'Video' node type
all along, so the tag now renders as the browser's own `<video>` player.
Six doc spots said the opposite, all of them written against the old
artifact.

Also drops the `unavailable` banner from the video LivePreview, so the
style-properties example is live like its neighbours, and rewrites the
build.sh note the stale artifact had earned - scripts/test-web-bundle.mjs
now guards the bundle itself, so the note only has to warn about prose.

Created with usage of AI tools

* style(core): clang-format TextLinkRecognizer for the core-parser lint

#855 added it under packages/core/cpp/parser unformatted; the core-parser
CI job runs yarn lint-clang:core-parser over that directory.

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant