-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
Viewer renders escaped markdown syntax, Builder renders the backslash instead #1412
Comments
No, that's a bug. The renderer for the build preview and the document viewer is the same one, but the stripping of escaped characters is a separate step that must be called explicitly in the process. It should be called on some formats, like HTML and OpenDocument, and not on others like Markdown. There is probably an if-statement either missing or misconfigured somewhere in there. |
The issue turned out to be that the stripping of escapes after formatting parsing was done after the generated output was added to the document buffer. The buffer is what is used in the build tool, but the document viewer doesn't use this buffer as it is just a single page, hence it was working in the viewer. In #1418 I'm just changing where this is done so that it is handled on the paragraph level. Edit: I'll make a new release tomorrow if I have the time. There are a bunch of small fixes that needs to be released. |
To be thorough:
The reason for that uncertainty is because I could not find anywhere on the docs something to clear this up. Is there a thread to discuss the nW manual contents? |
Ah, right. I'll add a note about it. You can just open a regular ticket about it if you find anything, but I happen to have a PR in progress with some documentation changes, so I added a Tip to the "Text Emphasis" section of the "Formatting Your Text" page. Not sure when I'll push it out to the live docs, as I want to go through a few things, but it has been added to the source at least. |
It looks great, thanks! |
The problem
When you escape Markdown syntax using backslash
\
, as you would in other editors, the Viewer does indeed render the document as expected by intuition:If you try to render the project, the Builder will both preview it and build it without parsing the escape code, rendering a backslash instead.
The expectation
There may not be a bug here but this behaviour appears inconsistent. I'm not sure if escaping is meant to be a novelWriter feature but I hope it is.
In the event of an unfortunate coincidence in text, the author may need to be able to escape Markdown syntax. I actually met this unfortunate coincidence myself with a double asterisk repeating in the same paragraph.
The text was updated successfully, but these errors were encountered: