Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mojavelinux opened this issue Jun 8, 2018 · 4 comments
Closed
Assignees

Comments

@mojavelinux
Copy link
Contributor

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.

@gettalong gettalong self-assigned this Jun 8, 2018
@gettalong
Copy link
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.

@mojavelinux
Copy link
Contributor Author

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.

mojavelinux added a commit to mojavelinux/kramdown that referenced this issue Jun 10, 2018
@gettalong
Copy link
Owner

Thank you for your contribution!

@mojavelinux
Copy link
Contributor Author

Thank you for reviewing and merging!

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

No branches or pull requests

2 participants