-
Notifications
You must be signed in to change notification settings - Fork 25
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 to html #5
Conversation
When there are character entities in your html code, they will now be converted too.
This reverts commit 744d6c6.
If there are character entities in your html, they will now be converted too.
This is great! But looks like you modified the wrong file! Also you’re replacing the entities in the wrong phase, that is before parsing it. This means that <b>hi</b> is interpreted as <b>hi</b> |
I agree that would be better. Could you modify the right file to use entities @patrickknaap? Just add the entities module to the |
The module entities converts entities to html
Added the module to the package.son file
Sorry for the long wait. I was very busy at my job. But I found some time. |
Way better! But I’m scared by the fact that we’re unescaping the entities after the creation of attributes. You have to know they are character position based
but when we put escaping in the mix
|
@yuchi it looks like it is correctly done before the creation of attributers right? https://github.com/patrickknaap/ti-html2as/blob/entities-to-html/index.js#L135-L138 |
Actually not. The attributes are created after the unescaping, but the ranges are created before. |
This line is where it should happen, probably… parameters.text += entities.decodeHTML(node.data); so when later you use |
Yes, you're totally right @yuchi Could you fix that @patrickknaap? Thx |
Don’t take my words for granted, @patrickknaap. Could you try if, after the eventual fix, the html |
You're right @yuchi . The output wasn't the expected output. The ò was parsed correctly, but the ' world' didn't output in bold. I'll push a new version. |
The parsing is done before the attributes are created.
If there are character entities in your html, they will now be
converted too.