-
-
Notifications
You must be signed in to change notification settings - Fork 121
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
Incorrect rendering of double hyphen within backqotes #146
Comments
Yeah that's a bug, the inline code should get escaped. I'll take a look. |
Just pushed out |
No, sorry. It doesn't seem to have fixed the problem. Here's the input line from my file:
And here's the generated html:
|
Here's what I'm seeing with the latest version:
You might need to clear the local maven cache in |
I'm running 1.0.6. I've tried clearing the cache and confirmed with I do notice that triple-backquoted multiline code sections do retain the |
I'm really not sure what's happening unfortunately as I'm not able to reproduce the issue locally. The reason this doesn't affect code blocks is because the parser is able to set the state to code and omit other formatting. However, for inline blocks there's no state as the whole line is processed in one shot. The fix here uses a regex to unparse the dashes, and it's passing in the unit test I added. I tried running your example locally and I'm seeing the |
Ok. I will try to debug this further, but probably won't be able to give it much time for at least the next couple of days. |
Sounds good, I made a test project to test the issue. It's parsing markdown from both a string and a file, and appears to be working correctly with your sample input. |
I'm also running into this now... |
Might need to make an even smarter regex for this? :) |
I did it like this:
|
Ah, this trick's already being used with freeze-string, so we could just use that here as well. |
Just run across a bug in user=> (md-to-html-string "Does this -- change to an endash?")
"<p>Does this – change to an endash?</p>"
user=> (md-to-html-string "Does <code>this</code> -- change to an endash?")
"<p>Does <code>this</code> – change to an endash?</p>"
user=> (md-to-html-string "Does <code>this</code> -- change to an <code>endash</code>?")
"<p>Does <code>this</code> -- change to an <code>endash</code>?</p>"
user=>
``` This is with markdown-clj 1.11.4 and I think it's because the regex you use to undo the -- to ndash inside `<code>` is greedy: so if there are multiple `<code>` blocks, any `--` that had been converted to `ndash` outside them gets converted back. |
Everything within backquotes should be rendered literally, but it seems that markdown-clj is converting
--
to a single en-dash.Here's a line that fails:
The text was updated successfully, but these errors were encountered: