Skip to content
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

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

KSR-Yasuda
Copy link
Contributor

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.

Copy link
Member

@alerque alerque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution. I can totally see the logic for Japanese and even some of the Latin punctuation here, but I'm a bit worried this goes too far and will start catching false positives. In particular depending on the Markdown rendering in use it might be part of the requirement for these markups to have some space or other separator first. This avoids things like a clause,* more text where the asterisk might be a footnote marker or otherwise be literally rendered to not be mixed up with emphasis markup.

We need to look into how Pandoc, CM, GFM, and others handle this first and make sure we at least move closer to that handling and not farther away from it.

@KSR-Yasuda
Copy link
Contributor Author

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 \*.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants