docs: round-2 accuracy audit (xml pitfall markup fix)#258
Merged
Conversation
Round-2 audit found that two Footgun callouts in xml.md had unbalanced <strong> tags — an artifact of an earlier "bold the lead sentence" reformat that didn't account for the existing `<strong>#1:</strong>` prefix. Each pitfall opened with `<strong>#N:</strong>` and then re-emitted a closing `</strong>` at the end of the lead, so the rendered HTML had one open and two closes: <p>Footgun: <strong>#1:</strong> namespace-aware methods… …not the prefix written in the tag.</strong> ↑ stray close Visible symptom: the bold span ran from `#1:` colon to the end of the sentence, but the entire rest of the paragraph also rendered bold in some browsers (the second `</strong>` close-without-open is forgiven by the parser, so its effect depended on UA). Either way the lead wasn't crisply bolded the way the other pitfall callouts on the page are. Fixed by dropping the `#N:` numbering (it added nothing — the extractor already renders each pitfall as its own <aside>) and moving the bold span to wrap a single lead sentence, matching the style every other pitfall in the catalog uses now. Verified by running the audit checks I did this round against every component: - Class/interface lookups for every `use` statement → all resolve. - Method-existence checks for every `->method()` call in snippets → all exist. - Behavioural spot-checks on bytestream pull/peek/consume, polyfill hook ordering and apply_filters arg passing, encoding wp_is_valid_utf8 / wp_scrub_utf8, filesystem chroot, deflate/inflate round-trip, BlockParser key shape, MarkdownConsumer metadata, WXRWriter constructor, GitRepository::commit signature → all match the prose. 87/87 snippets still match captured stdout.
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.
Summary
Second-round accuracy pass on
bin/_docs_components/<slug>.md. After the first pass (#257) fixed six load-bearing inaccuracies inhtml.mdandmarkdown.md, this round drilled deeper by exercising more of the underlying APIs to make sure the prose still matches reality. One small markup bug inxml.mdfalls out; everything else holds.What got fixed
bin/_docs_components/xml.md— two pitfall callouts had unbalanced<strong>tags, an artifact of an earlier "bold the lead sentence" reformat that didn't notice the existing<strong>#1:</strong>prefix. The rendered HTML had one open and two closes per pitfall, so the bold span effectively ran from the#N:colon through the rest of the paragraph (browsers forgive the orphan close, but it doesn't render the way every other pitfall in the catalog does).Dropped the
#N:numbering (it added nothing — each Footgun renders as its own<aside>) and rewrote the bold span to wrap a single lead sentence, matching the style every other pitfall on the site uses.What got checked and found accurate
For each component I:
use WordPress\…import viaclass_exists/interface_exists. Every one resolves.->method()call in every snippet via reflection. Every one exists on the class returned by the preceding factory/constructor.pull → peek (non-advancing) → consume (advancing)abcdefghijthroughpull(5),peek(3)twice,consume(3),peek(2)— semantics match.do_action('x', 'a', 'b')→ 2-arg callback gets both.esc_html,esc_attr,esc_url,__()outputswp_is_valid_utf8accepts'hello', rejects"\xC3\x28";wp_scrub_utf8produces a U+FFFD replacementLocalFilesystem::create($root)chroot —../escape.txtcannot escape../resolves to root-relative; no file appears outside$root.SQLiteFilesystem::create(':memory:')round-trips file contentsput_contents('a.txt','data')thenget_contents('a.txt')returns'data'.DeflateReadStream/InflateReadStreamround-tripblockName, attrs, innerBlocks, innerHTML, innerContentarray_keys().blockName === nullfor loose HTML between blocksMarkdownConsumer::consume()returnsBlocksWithMetadataget_class()confirms the canonical namespace.MarkdownConsumer+MarkdownProducerworks for headings/listsRequest($url, ['method' => 'POST', 'headers' => […]])constructor accepts options arrayResponse::from_http_headers($raw, $request)→Responsewithstatus_codeImportEntity('post', […])constructor signature;WXRWriter::append_entityexistsGitRepository::commit(options)existsXMLProcessor::create_from_string()parses, walksnext_tag();get_tag_namespace()returns the URI not the prefixZipDecoder::COMPRESSION_NONE = 0,COMPRESSION_DEFLATE = 8ReflectionClass::getConstant().CLI::parse_command_args_and_options()exists, returns[positionals, options]HumanFriendlySchemaValidatorconstructor takes$schema(required),$options(optional)ResponseWriteStreamis an interface (not a class) —usestatements still validinterface_exists.Test plan
Verify docs snippetsworkflow passes (87/87).xml.mdrender with a single bold lead, matching the rest of the catalog.🤖 Generated with Claude Code