Intra-word Markdown italic and bold not supported?

markdown
markdown-it-review

(Erick Guan) #1

Continuing the discussion from Why can’t I put many spaces?:

As the common usages, test**测试**test should render the normal English letters and bold Chinese characters instead of unparsed one.

I can add space around Chinese characters to work around but it’s not the case for Chinese at all.

And I can’t add bold style between the letters in English word(testboldtest). Is that intended?


(Jeff Atwood) #2

This is not a bug, as designed since forever… see

Particularly the part on intra_word_emphasis


(cpradio) #3

Is the following a bug then?
$_GET['test'] versus $_POST['test']
Test_another test again_this is crazy

Produces (note the intra-word emphasis added):
$_GET[‘test’] versus $_POST[‘test’]
Test_another test again_this is crazy

Granted, reading that post shows that it doesn’t work for *, but _ still permits intra-word… which seems like odd behavior to me.

More tests:
$**GET['test'] versus $**POST['test']
Test**another test again**this is crazy

Produces:
$GET[‘test’] versus $POST[‘test’]
Test
another test again
this is crazy

Hmm… weird. So it does react differently depending on whether it is butted up to a letter or a symbol.

FYI: We get the $_GET and $_POST a lot in our forum, so we see the underscore get converted to italics frequently (which is why i bring this up)


(Erick Guan) #4

1) Markdown’s single biggest flaw is its intra-word emphasis.

I don’t think anybody writes:

unfrickingbelievable

No one writes like this in English, that’s absolutely right. However, I considered it as a broken behaviour in other languages, especially CJK.

In these language, words are not separated by space. A sentence is a bunch of “intra-words” as designed. Then I found it’s awkward to insert space around words since we never do that.

It also kept the translation not shown bold. Can we change this other than English letters?


(Sam Saffron) #5

Open to a patch that disables magic in CJK if selected also be sure to post examples CommonMark

In fact it feels like we need Lang specific defaults for some site settings (min length should be way shorter in Chinese etc)


(Erick Guan) #6

OK.

Is there a chance to know the language when bootstrapping? Or at least a env for that.


(Erick Guan) #7

Update:

Now the CommonMark is tended to accept this behavior. Though Better Markdown is not updated.

BTW: Reading a language spec is funny :wink:


(Jens Maier) #8

Well, obviously the only solution here is to convert your PHP lusers to proper Rubyists. :wink:


(cpradio) #9

Ha! So it seems :smile:


(Wabuo) #10

From the LEDE forum:

Try putting two backticks before the first ** as workaround:

sub``**sub**string = sub``substring

**Edit:**I only posted in this old thread because I found it with google and it reminded me that I read the solution for this problem somewhere before. After some digging I found the above mentioned thread and decided If I found this tread someone else will to …


(Jeff Atwood) #11

Why do that? Just use HTML

sub<b>sub</b>string

subsubstring


(Sam Saffron) #12

This now appears to be working per: test测试test


(Sam Saffron) #13