preservim / vim-markdown

Markdown Vim Mode
4.69k stars 524 forks source link

Apply **strong** / *emphasis* syntax for right after punctuations #585

Open KSR-Yasuda opened 2 years ago

KSR-Yasuda commented 2 years ago

For strong and emphasis syntax, now it requires line beginning or some space before them.

**strong** aaa **strong**
*emphasis* aaa *emphasis*

Besides these, allow it is placed right after punctuations.

aaa (**strong**)
aaa (*emphasis*)

aaa,**strong**
aaa,*emphasis*

あああ (**最強調**)       # Wide (Japanese) paren
あああ (*強調*)

あああ、**最強調**
あああ、*強調*

あああ **最強調**          # Wide (Japanese) space
あああ *強調*

Especially, in Japanese, space is rarely used between words. It is preferred to apply these syntax right after or (Japanese comma, period), even without any space.

KSR-Yasuda commented 2 years ago

At least, Pandoc (v2.17.1.1) considers as I expected.

Pandoc_20220606_172735

This avoids things like a clause,* more text

As Pandoc behavior, symbols should be considered as word edge, should not? * occurence in non-symbol characters (e.g. foo*bar), it still treated as the character * itself.

If you want to use * character itself in such edge cases, I think you should escape it as \*.