Unnecessary escape for the period (.) character #101
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pasting the following Markdown to the example, switch to WYSIWYG and switch back to Markdown,
it becomes
As far as I know, the periods in
0.com,2.2,4.4, and5.5don't need to be escaped, and escaping them makes the generated Markdown less readable.I looked into the issue and found it's related to this commit and the fix for #75
I also attached a patch and it consists of two parts.
The first part is to set
this.atBlockStart = trueonly when the serializer is really writing to block start inrenderInline(). (In current code, every text node in a block is rendered withthis.atBlockStart = true.) This fixes periods in link text (0.com,2.2).The second part is to replace text that would actually be parsed as a list item in
esc(). For example,4.4would not be parsed as a list item, while4. 4would. So I add a space character (\s) in the regex.Please take a look at
8f0a84fdcband let me know if that also looks like a solution to theatBlockStartproblem.Thank you for the suggestion. The code of
8f0a84fmakes sense to me. I tried and it also worked well.Though I'd like to suggest adding spaces after the periods in this test:
e.g.
Because after we changed the regex in
esc(), without spaces the periods would not be escaped, regardless of whetheratBlockStartis correct.