Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

In the post below, Jeff Atwood claimed the MarkdownSharp has changed Markdown rules to disable intra-word emphasis like "the_file_name" or "file_one and file_two".

As a result, the two components at both ends of the regular expressions, only match non-word character. That just what \W means:

Of course, Pagedown also do the same.

However, in East Asian Scripts, any emphasises are always "intra-word"! For example, this line with Markdown notations meant to emphasis two words, "北京" and "上海", that only are separated by the "和":


It's very common uses in Chinese. But now, if we want get the "intra-word emphasis" effect,


we would have writing like this:


So, we have revised the searched regular expressions in MarkdownSharp and Pagedown to (C#):

([\W_]|\u4e00-\u9fff|^) (\*\*|__) (?=\S) ([^\r]*?\S[\*_]*) \2 (?=[\W_]|\u4e00-\u9fff|$)

and (JavaScript)


the replaced patterns to (both server-side and client-side):









如上所示,Stack Overflow网页展示的“站点”不是粗体(客户端预览也不是)——这倒没关系——关键是,据温谦老师说:

(图灵社区)现在禁止(词内强调)时,使用的正则表达式(是):"([^A-Za-z0-9]||^) (*|) (?=\S) ([^\r*_]*?\S) \2 ([^A-Za-z0-9]|_|$)"



顺便说一下“yacc”这个名字的由来是*Y*et *A*nother *C*ompiler *C*ompiler的缩写。

Stack Overflow禁用这种“词内强调”,图灵社区好像从一开始都在遵照这个“惯例”吧?如果是,怎么会出现“结果正确”这种违反惯例的情况呢?这是第二个疑惑。

2013-05-27 pm16:34 李松峰

share|improve this question
’Tisn’t really a bug if you’re not expecting Chinese text — like on Stack Overflow. Or is this just a bug report for the library? – Ryan O'Hara May 2 '13 at 2:07
Yes, it isn't a bug. – Li Songfeng May 3 '13 at 2:05
instead of <strong></strong> you could just use <b></b> which saves 10 letters. – Doorknob May 7 '13 at 1:36
@rynah It is an issue on some of the other SE sites, like the Japanese and Chinese sites. (Unsure if it also applies to Russian or other non-latin alphabet language sites.) – Troyen May 16 '13 at 6:14

Yes, we (finally) have considered this. For more info see Markdown change: Intra-word emphasis now works.

I've also updated the public repositories today: PageDown change, MarkdownSharp change.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .