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

Wrongly successively encoding entities in code blocks in nested lists #196

Closed
twitwi opened this issue Aug 31, 2015 · 5 comments
Closed
Assignees
Labels

Comments

@twitwi
Copy link
Contributor

twitwi commented Aug 31, 2015

When using an entity (or a character that gets encoded as an entity) in a code block in a list, showdown seems to escape the entity multiple times, depending on the depth in the list.

Here is an example, where all & (using explicitly & does not change the problem) inside code blocks get escaped too much:
http://showdownjs.github.io/demo/#/%23%23%20Test%20pre%20in%20a%20list%0A-%20%26%0A-%20%60%26%60%0A%20%20%20%20-%20%26%0A%20%20%20%20-%20%60%26%60%0A%20%20%20%20%20%20%20%20-%20%26%0A%20%20%20%20%20%20%20%20-%20%60%26%60%0A%20%20%20%20%20%20%20%20%20%20%20%20-%20%26%0A%20%20%20%20%20%20%20%20%20%20%20%20-%20%60%26%60

I discovered the problem outside the demo (i.e., I think the problem does not come from the demo code).

I'll have a quick look but I'm not familiar with the showdown code so I will most probably not manage to solve the problem.

@twitwi
Copy link
Contributor Author

twitwi commented Aug 31, 2015

NB: markdown seems to require escaping "&" and "<", but, as mentioned above, the problem is also visible with characters that lead to non-mandatory entity encoding such as ">" as in this example (which is this time a proper markdown document):
http://showdownjs.github.io/demo/#/%23%23%20Test%20pre%20in%20a%20list%0A-%20%3E%0A-%20%60%3E%60%0A%20%20%20%20-%20%3E%0A%20%20%20%20-%20%60%3E%60%0A%20%20%20%20%20%20%20%20-%20%3E%0A%20%20%20%20%20%20%20%20-%20%60%3E%60%0A%20%20%20%20%20%20%20%20%20%20%20%20-%20%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20-%20%60%3E%60

twitwi added a commit to twitwi/showdown that referenced this issue Aug 31, 2015
@tivie tivie added the bug label Sep 5, 2015
@tivie tivie self-assigned this Sep 5, 2015
@tivie
Copy link
Member

tivie commented Sep 5, 2015

This bug was introduced recently. I'm still trying to figure out which commit introduced this.
I expect to be able to fix this in 3 weeks or so.

tivie added a commit that referenced this issue Oct 18, 2015
@tivie
Copy link
Member

tivie commented Oct 18, 2015

I've tracked the problem to version 1.2.1, commit 5f043ca introduced the problem

@tivie
Copy link
Member

tivie commented Oct 19, 2015

This should be fixed in the latest develop

tivie added a commit that referenced this issue Oct 19, 2015
@tivie tivie closed this as completed in 3097bd4 Oct 19, 2015
@twitwi
Copy link
Contributor Author

twitwi commented Oct 19, 2015

Great, thanks. (not tested yet)

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