feat(html): extract HTML meta, Dublin Core and Office tags - #402
Closed
swackhamer wants to merge 1 commit into
Closed
feat(html): extract HTML meta, Dublin Core and Office tags#402swackhamer wants to merge 1 commit into
swackhamer wants to merge 1 commit into
Conversation
oxidex named the HTML file type but had no FileFormat variant, so detection landed .html on the plain-text parser. The file produced none of ExifTool's 57 tags and five TEXT:* tags ExifTool never reports for an HTML file. This adds the variant, routes detection through ExifTool's own gate from ProcessHTML, and adds a reader transcribed from Image::ExifTool::HTML (HTML.pm 1.16). Meta-tag namespaces map to the four Group1 names ExifTool uses: HTML-dc, HTML-ncc, HTML-office, plain HTML for the <title> element, and HTTP-equiv for http-equiv attributes. Measured on the ExifTool corpus sample (per file, keyed Group1:Name, File/System excluded): HTML.html matched 0 -> 57 missing 57 -> 0 extra 5 -> 0 Zero regressions. Detection was re-checked across the whole corpus: the FileType of all 4104 readable files is byte-identical before and after, and a per-tag dump of the 33 text-adjacent samples (SVG, XMP, XML, TXT, VCF, ICS, EPS, TTF/OTF/dfont/PFA/PFB/AFM, JSON, KML, GPX, RTF) differs on HTML.html alone. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
swackhamer
enabled auto-merge (squash)
August 2, 2026 03:35
Collaborator
Author
|
Closing in favour of #406, which supersedes this PR. Both are the same work — I built this branch from a mid-flight snapshot of the HTML parser while its author was still iterating, so #406 is the later state of the same lineage rather than a competing implementation. Verified before closing:
#406 additionally carries two divergences this sample file cannot exercise ( No measured coverage is lost by closing this. |
auto-merge was automatically disabled
August 2, 2026 03:50
Pull request was closed
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.
What
oxidex already named the HTML file type (
filetype::tablescarries the magic, thehtm/htmlextensions and thetext/htmlMIME type) but had noFileFormatvariant, so detection landed.htmlon the plain-text parser. The result was none of ExifTool's 57 tags, plus fiveTEXT:*tags ExifTool never reports for an HTML file.This adds the variant, routes detection through ExifTool's own gate from
ProcessHTML, and adds a reader transcribed fromImage::ExifTool::HTML(HTML.pm 1.16).Measured
Per file, keyed
Group1:Name,File/System/ExifToolgroups excluded, ExifTool 13.55 (HTML.pmis byte-identical to the 13.59 source used as the oracle). ExifTool JSON parsed withparse_float=str.HTML.htmlbeforeHTML.htmlafterThe five wrong
TEXT:Encoding/TEXT:FileSize/TEXT:LineCount/TEXT:LineEnding/TEXT:WordCounttags are gone, because HTML is no longer treated as plain text.Four Group1 names
The meta-tag namespace decides the group, exactly as HTML.pm does:
HTML-dc<meta name="dc.*">HTML-nccHTML-officeHTML<title>elementHTTP-equiv<meta http-equiv=...>Conversions that had to be exact or the tag omitted:
HTML-dc:Creatoris a list (two<meta>tags collapse into one value); the document is iso-8859-1 soHTML-dc:Subject(Greek: α β γ) andHTML-office:Category(a catégory) need charset transcoding driven by the declared encoding;HTML-office:CreateDateconverts to ExifTool's colon-date form whileHTML-dc:Datestays raw;HTML-office:TotalEditTimeis a PrintConv (1 minute).Zero regressions
This changes how
.html/.htmfiles are dispatched, so the blast radius was measured rather than assumed:File:FileTypefor all 4104 readable corpus files is byte-identical before and after (0 differences).HTML.htmlalone; every other file is unchanged.CanonVRD.vrd,LNK.lnkandLytro.lfpare unchanged (set comparison, not totals).cargo test --workspace— 0 failed.cargo fmt --all,cargo clippy --all-targets— clean.🤖 Generated with Claude Code