Repository navigation
Match HTML and XHTML from opening tags - #158
Merged
Merged
Conversation
jeremy
force-pushed
the
security/html-svg-magic
branch
from
August 18, 2026 09:36
796879a to
0557dd0
Compare
jeremy
force-pushed
the
security/html-svg-magic
branch
from
August 18, 2026 09:40
0557dd0 to
1afd3b1
Compare
Use bounded opening-tag rules, remove the broader generated matches, and register the rules for both top-level and direct Magic loading. Preserve structural formats when markup appears later in their content.
jeremy
force-pushed
the
security/html-svg-magic
branch
from
August 18, 2026 18:28
1afd3b1 to
9db5f70
Compare
This was referenced Aug 19, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #157.
This replaces broad HTML and XHTML signatures with bounded rules anchored to the document opening.
require "marcel"andrequire "marcel/magic"install the same rules.A valid MIDI text event containing markup remains
audio/midi. With content-only detection, bare HTML fragments now returnapplication/octet-stream; filename hints still apply throughMimeType.for. This also covers the partial-read case from #153.Marcel labels content; it does not sanitize HTML.