Skip to content

fix(author): refuse a quote a tag leaves open, which a > inside an attribute makes (#222) - #223

Merged
alekswebnet merged 2 commits into
mainfrom
fix/author-markup-open-quote
Nov 17, 2026
Merged

alekswebnet merged 2 commits into
mainfrom
fix/author-markup-open-quote

Conversation

@alekswebnet

@alekswebnet alekswebnet commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Closes #222.

A rich-text field whose markup held a > inside a quoted attribute built without a word, and the learner lost what follows it. The build's markup check ends a tag at its first >, as H5P's content check splits markup, and escaped the real closing >; a browser reads the quoted value whole and the tag on to a later >. In Chromium, <a title="a>b" href="…">link</a> after showed no "link", and everything after it became the link.

markupText now refuses a tag that leaves a quote open, by name, as it refuses the other markup a platform would change:

has with a quote it does not close: a > inside an attribute ends the tag there, so write > for it

It reads a tag's attributes as a browser does: a quote opens a value only where one begins, after an attribute's =, so one inside a bare value (title=x='y) opens nothing. A value written with &gt;, quoted whole, or unquoted with an apostrophe in it is no matter. The same check runs on saved content (checkContent). The rule is in design/author.md, Text is stored as the platforms store it.

Tests

A new test in tests/text.test.ts, the bare-value cases among them. Author 184/184; apps/skills author-verify and author-playback 73/73, so every type file's example still builds and plays; typecheck clean.

cubic: the first check refused <a title=x='y>, whose quote sits in a bare value; it now reads attributes in a browser's order.

Separate from #221, which changes text.mjs elsewhere: the two branches merge without a conflict (git merge-tree).

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 3 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread packages/author/lib/text.mjs Resolved
@alekswebnet
alekswebnet merged commit 1fe1ed5 into main Nov 17, 2026
9 checks passed
@alekswebnet
alekswebnet deleted the fix/author-markup-open-quote branch November 18, 2026 11:47
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.

h5p-author: a ">" inside a quoted attribute builds into markup that hides what follows

1 participant