Lines that start with a colon are escaped upon save
Describe the bug Related to #325 in that escapes are wrongly saved into the file under specific circumstances. In this case, it appears to happen only when the line begins with a colon (I use markdown with vimwiki and tags start with a colon)
To Reproduce Steps to reproduce the behavior:
- Create new .md file from the web interface
- Input the following text:
test:
:test:
:test:test:
:test:
- Close the document
- Download the document and open in a text edit
- Observe that lines 2 and 3 now begin with a slash:
test:
\:test:
\:test:test:
:test:
Expected behavior Preserved documents
Client details:
- OS: Arch Linux
- Browser: Firefox
- Version: Latest
- Device: Laptop
Server details
Text app version: 3.0.1
Operating system: Debian 10 Web server: Nginx
Database: PostgreSQL 11
PHP version: 7.3
Nextcloud version: 19.0.1
I just noticed that it appears to occur with any special character: My lists are all mangled whether they're asterisks or hyphens.
This is an upstream issue: https://github.com/ProseMirror/prosemirror-markdown/issues/76
Fixed upstream, will be fixed with next prosemirror-markdown release (>= 1.9.4)
Thanks for this, @susnux!
Looking at the fix, it seems it would only solve colons whereas asterisks (possibly even more) are currently experiencing the same issue.
- A single
*should be interpreted as an empty list element if the line, above it is empty, as of commonmark specs. e.g.:
text
*
should be interpreted as an empty list, this works as expected.
- An asterisk on a new line following a line with text is not defined within common mark, so it has no meaning but could either be the start of formatting or simply one typed an asterisks, for prosemirror this is hard to distinguish so it is interpreted as a normal character and therefor escaped.
Of cause this could be interpreted the other way, but I doubt upstream will change the behavior :/
Given that this was fixed in prosemirror-markdown 1.9.4 and we already use 1.10.0, I'll close this ticket. Feel free to reopen if it's still an issue.