Skip to content

Fix html source positions - #20

Merged
xavierlacot merged 3 commits into
mainfrom
fix/html-source-positions
Nov 23, 2026
Merged

xavierlacot merged 3 commits into
mainfrom
fix/html-source-positions

Conversation

@xavierlacot

@xavierlacot xavierlacot commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

What does this PR do?

Clicking a property or an error of a microdata or RDFa document now highlights the right place in the HTML (the property name in its itemprop or property attribute, and the value in its attribute or text), instead of a position computed in the generated JSON that spilled onto unrelated lines.

A tolerant source locator pairs each DOM element with its tag in the source, and the extractors attach a source map to the documents they generate. Properties are now read in document order, so repeated values such as images or recipe steps are no longer reversed, and all columns count UTF-16 code units, as the editor does.

Checklist

  • Tests pass (castor qa:phpunit:run)
  • Coding standards applied (castor qa:cs)
  • Static analysis passes (castor qa:phpstan)
  • Tests added or updated for the change
  • Documentation updated if needed

@xavierlacot xavierlacot changed the title Fix/html source positions Fix html source positions Nov 23, 2026
@xavierlacot
xavierlacot merged commit 5cceb1b into main Nov 23, 2026
6 checks passed
@xavierlacot
xavierlacot deleted the fix/html-source-positions branch November 23, 2026 20:02
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