-
Notifications
You must be signed in to change notification settings - Fork 38
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
underscore (italics) markdown in preview disrupted by cursor logic #167
Comments
Hey @clem4962, I can reproduce this bug. You are right, the If you mark a paragraph, hit Italics as you described and place the cursor below, before you hit Preview it's rendered correctly. |
Released in v2.9.0. |
Hi @redimp, you might want to have another look into this. I noticed This also happens if the cursor is on a directly adjacent line (line directly before or after the code block), even if that line is not blank. No matter whether the code block uses single ticks, triple ticks or four-space indention. Exceptions I found so far:
|
Thx @rhartmann for the detailed analysis ... I didn't think through that adding the html comment tags would of course make other parsers interact with it. |
Fix released in v2.9.2. |
Add a fresh paragraph to a page, highlight it, then hit the Italics button, then Preview. The italics will not render (it will display plain text with underscores):
_my new text_
There are other variations, such as leaving the cursor on a subsequent blank line etc, but all occur because the cursor logic in renderer.py has modified the line to this:
_my new text_CuRsoRm4g1cW0Rd
which the markdown rendering no longer recognises.
(Using asterisks instead of underscores works fine.)
Possibly this might be fixed by changing the magic cursor word to an html comment, eg
<!--CuRsoRm4g1cW0Rd-->
? This worked in my somewhat limited testing.OTOH, I'm not too sure what purpose the cursor processing actually serves. Is it required in some other use case other than preview?
The text was updated successfully, but these errors were encountered: