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

Entities are not parsed when directly under root node #749

Closed
numinit opened this issue Mar 18, 2022 · 2 comments
Closed

Entities are not parsed when directly under root node #749

numinit opened this issue Mar 18, 2022 · 2 comments
Assignees
Labels

Comments

@numinit
Copy link

numinit commented Mar 18, 2022

Kramdown::Parser::Html.parse('&')
# => [<kd:root options={:encoding=>#<Encoding:UTF-8>, :location=>1, :options=>{}, :abbrev_defs=>{}, :abbrev_attr=>{}} children=[<kd:text value="&amp;\n" options={:location=>1}>]>, []]

Kramdown::Parser::Html.parse('<p>&amp;</p>')
# => [<kd:root options={:encoding=>#<Encoding:UTF-8>, :location=>1, :options=>{}, :abbrev_defs=>{}, :abbrev_attr=>{}} children=[<kd:p children=[<kd:text value="">, <kd:entity value=#<struct Kramdown::Utils::Entities::Entity code_point=38, name="amp"> options={:original=>"&amp;"}>]>]>, []]
@gettalong gettalong self-assigned this Mar 18, 2022
@gettalong gettalong added the bug label Mar 18, 2022
@gettalong
Copy link
Owner

Thanks - this is fixed for the upcoming release!

@numinit
Copy link
Author

numinit commented Mar 21, 2022

Awesome! I can get rid of my terrible hack of manually enclosing everything in a <p>!

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

No branches or pull requests

2 participants