Skip to content

HTML tag with attribute value not enclosed in quotes is not processed #522

Closed

Description

@mojavelinux

In the HTML to native function, the parser is not recognizing (or processing) an HTML tag if it contains an attribute value that is not enclosed in quotes (e.g., <img src="image.png" width=100>. However, dropping the quotes around an attribute value is valid HTML.

Is this something you think Kramdown should permit? If so, I'd be happy to update the parser to support quote-less attributes.

Activity

  1. self-assigned this
    on Jun 8, 2018
  2. gettalong commented on Jun 8, 2018

    @gettalong
    Owner

    This is actually intended, see https://kramdown.gettalong.org/syntax.html#html-blocks - kramdown only supports the XHTML variant of HTML (with some easy to implement exceptions) to make things easier to parse.

    I don't think that this is a major obstacle to using kramdown since people immediately see that the didn't follow the correct syntax and correct it.

    I'm not opposed to making the HTML parser more complete but it shouldn't come with a high cost.

  3. mojavelinux commented on Jun 10, 2018

    @mojavelinux
    ContributorAuthor

    Understood, though I think this can be done with very limited overhead by reusing the existing regular expressions. A reasonable trade-off is that we only consider values with only letters and numbers and no spaces. I'll submit a proposal for review.

  4. added a commit that references this issue on Jun 10, 2018
    acf3f48
  5. gettalong commented on Jun 10, 2018

    @gettalong
    Owner

    Thank you for your contribution!

  6. mojavelinux commented on Nov 5, 2018

    @mojavelinux
    ContributorAuthor

    Thank you for reviewing and merging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions