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

underscore (italics) markdown in preview disrupted by cursor logic #167

Open
clem4962 opened this issue Dec 3, 2024 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@clem4962
Copy link

clem4962 commented Dec 3, 2024

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?

@redimp redimp self-assigned this Dec 3, 2024
@redimp redimp added the bug Something isn't working label Dec 3, 2024
@redimp
Copy link
Owner

redimp commented Dec 3, 2024

Hey @clem4962, I can reproduce this bug.

You are right, the CuRsoRm4g1cW0Rd is used for previewing the location of the page where you placed your cursor, so that you dont have to scroll and search for what you've just edited.

If you mark a paragraph, hit Italics as you described and place the cursor below, before you hit Preview it's rendered correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants