Skip to content

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

Closed

Description

@alekswebnet

A rich-text field whose markup has a > inside a quoted attribute builds without a word, and the learner loses what follows it.

Written <p><a title="a>b" href="https://example.org/">link</a> after</p><p>next paragraph</p>
Stored <p><a title="a>b" href="https://example.org/"&gt;link</a> after</p><p>next paragraph</p>
Shown (Chromium) after / next paragraph, both inside the link; the word "link" is gone

The build's markup check (markupText) reads tags as H5P's content check splits them, ending a tag at its first >. So it takes <a title="a> for the tag and escapes the real closing > as a lone one. A browser reads the quoted value whole and keeps reading the tag until the next >, the one in </a>. The link's text is lost, the <a> is never closed, and what follows becomes the link. Written title="a&gt;b", the same markup shows as written.

Fix: refuse it by name, as the build refuses the other markup a platform would change: "write &gt; for a > inside an attribute". A quote left open in a tag (<a title="x>) is the same case.

Found in the self-review of #221. It has been on main since the markup check was written.

Activity

  1. added 2 commits that reference this issue on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions