Repository navigation
fix(author): refuse a quote a tag leaves open, which a > inside an attribute makes (#222) - #223
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
…side a bare value opens nothing (#222)
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.
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> aftershowed no "link", and everything after it became the link.markupTextnow refuses a tag that leaves a quote open, by name, as it refuses the other markup a platform would change: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>, quoted whole, or unquoted with an apostrophe in it is no matter. The same check runs on saved content (checkContent). The rule is indesign/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.mjselsewhere: the two branches merge without a conflict (git merge-tree).