You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is correct behaviour. The markdown syntax is requiring a tight inclusion around a word or set of words.
The regex strings used for detecting these in novelWriter are taken from a syntax highlighter that is supposed to follow markdown standard. So I'm not surprised that GitHub behaves the same way.
A naive code that just turns the format on and off each time it sees a ~~ token is of course possible, but is also a lot slower than the current implementation, so not really an option.
Perhaps a note about this behavior in the documentation will close this issue.
I've been using Markdown for years and was surprised by this behavior enough to make note of it here. But you are absolutely right about it. I tried it in Typora and it behaves as you describe it should.
I'm pretty sure I copied the highlighting rules from the Markdown extension for either VSCode or Atom. I am not skilled enough with RegEx to write that on my own, although I have modified them a bit!
The documentation actually does show examples with no spaces, but I'll make an extra note about it.
Strike through fails if it includes a space. For example the following does not strike out the word Dublin and the space after it:
~~Dublin ~~
: The rain in ~~Dublin ~~Spain falls mainly on the plain.Therefore we have to do this:
~~Dublin~~
: The rain inDublinSpain falls mainly on the plain.Or
~~Dublin~~
: The rain inDublinSpain falls mainly on the plain.Of course as I previewed this post I realize that GitHub Flavored Markdown does the exact same thing. So this is more an issue than a problem ;-)
The text was updated successfully, but these errors were encountered: