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

Fix attributes encoding #295

Closed
xcoulon opened this issue Feb 17, 2019 · 0 comments · Fixed by #296
Closed

Fix attributes encoding #295

xcoulon opened this issue Feb 17, 2019 · 0 comments · Fixed by #296
Assignees
Milestone

Comments

@xcoulon
Copy link
Member

xcoulon commented Feb 17, 2019

There's a double encoding of document attributes, resulting in invalid output. Eg: {plus} gives &43; instead of +`

@xcoulon xcoulon self-assigned this Feb 17, 2019
@xcoulon xcoulon added this to the v0.2 milestone Feb 17, 2019
xcoulon added a commit to xcoulon/libasciidoc that referenced this issue Feb 17, 2019
unescape the document attributes substitution before it
is escaped again

fixes bytesparadise#295

Signed-off-by: Xavier Coulon <[email protected]>
xcoulon added a commit to xcoulon/libasciidoc that referenced this issue Feb 19, 2019
render all elements and apply substitutions, then if applicable
(ie, there were some substitutions), then parse the inline elements
again and render the elements, but with plain string output for
the StringElements to avoid double HTML escaping

also:
- do not treat `++` as an empty single plus passthrough (but
keep `++++++` as an empty triple plus passthrough for now)
- render `++` as `&bytesparadise#43;&bytesparadise#43;`
- accept that `InlineElementsWithoutSubtitution` can be empty
(which happens if the only content was `{blank}` which is trimmed
after rendering)

fixes bytesparadise#295

Signed-off-by: Xavier Coulon <[email protected]>
xcoulon added a commit to xcoulon/libasciidoc that referenced this issue Feb 19, 2019
render all elements and apply substitutions, then if applicable
(ie, there were some substitutions), then parse the inline elements
again and render the elements, but with plain string output for
the StringElements to avoid double HTML escaping

also:
- do not treat `++` as an empty single plus passthrough (but
keep `++++++` as an empty triple plus passthrough for now)
- render `++` as `&bytesparadise#43;&bytesparadise#43;`
- accept that `InlineElementsWithoutSubtitution` can be empty
(which happens if the only content was `{blank}` which is trimmed
after rendering)

fixes bytesparadise#295

Signed-off-by: Xavier Coulon <[email protected]>
xcoulon added a commit that referenced this issue Feb 20, 2019
render all elements and apply substitutions, then if applicable
(ie, there were some substitutions), then parse the inline elements
again and render the elements, but with plain string output for
the StringElements to avoid double HTML escaping

also:
- do not treat `++` as an empty single plus passthrough (but
keep `++++++` as an empty triple plus passthrough for now)
- render `++` as `&#43;&#43;`
- accept that `InlineElementsWithoutSubtitution` can be empty
(which happens if the only content was `{blank}` which is trimmed
after rendering)

fixes #295

Signed-off-by: Xavier Coulon <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant