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

Issue with < and > when attached to a word #236

Closed
rubenmamo opened this issue Feb 1, 2016 · 8 comments
Closed

Issue with < and > when attached to a word #236

rubenmamo opened this issue Feb 1, 2016 · 8 comments
Assignees
Labels

Comments

@rubenmamo
Copy link

Using the below text in markdown

There is a missing word <Test> here!

shows

There is a missing word here!

Shouldn't the < and > be converted to < and > ?

This only happens when the < is attached to the word, so

There is not a missing word < Test > here!
There is not a missing word < Test> here!
There is not a missing word <Test here!
This does not even appear

shows as

There is not a missing word < Test > here! There is not a missing word < Test> here! There is not a missing word
@tivie tivie added the bug label Feb 1, 2016
@tivie tivie self-assigned this Feb 1, 2016
@tivie
Copy link
Member

tivie commented Feb 1, 2016

The following cases behave as expected:

Case 1

There is not a missing word < Test > here!

converts to:

<p>There is not a missing word &lt; Test &gt; here!</p>

Case 2

There is not a missing word <test> here!

converts to:

<p>There is not a missing word <test></test> here!</p>

The bug lies in in case 3:

Case 3

There is not a missing word <test here!

should be converted to:

<p>There is not a missing word &lt;test here!</p>

instead it's being converted into:

<p>There is not a missing word <test here!<p></test></p>

@rubenmamo
Copy link
Author

Shouldn't it however only change <test> to an HTML element only if it is a valid HTML element?

@tivie
Copy link
Member

tivie commented Feb 2, 2016

Html, namely xhtml, allows custom html tags.

@tivie
Copy link
Member

tivie commented Mar 7, 2016

Update: I'm still working on this bug as it's proving a little more difficult to tackle as first expected.

For now, a workaround is to add a space after <

There is not a missing word < test here!

@rubenmamo
Copy link
Author

thanks for the update

@rubenmamo
Copy link
Author

Do you have an update on this?

@tivie
Copy link
Member

tivie commented Aug 19, 2016

Currently, I couldn't find a simple way of fixing this without rewriting the parsing engine. The problem is that the fix slows down the parsing engine too much, since it requires a bunch of lookaheads.

I can't give you a ETA on this, but for now the issue is in "pending" status.

@tivie tivie added the Pending label Jan 6, 2017
@tivie
Copy link
Member

tivie commented Feb 6, 2017

This issue should be fixed now. Took me a lot of time because I had to rewrite a bit of the parser logic.

Here's how it works now:

Case 1

There is not a missing word < Test > here!

converts to:

<p>There is not a missing word &lt; Test &gt; here!</p>

Case 2

There is not a missing word <test> here!

converts to:

<p>There is not a missing word <test> here!</p>

Case 3

There is not a missing word test> here!

converts to:

<p>There is not a missing word test&gt; here!</p>

Case 4

There is not a missing word <test here!

converts to:

<p>There is not a missing word &lt;test here!</p>

@tivie tivie closed this as completed in 7f43b79 Feb 6, 2017
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