A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/jrblevin/markdown-mode/issues/325 below:

Wrong fontification of inline emphasis · Issue #325 · jrblevin/markdown-mode · GitHub

Current fontification of inline emphasis is not consistent with Markdown convention.

Expected Behavior

Markdown treats both asterisks (*) and underscores (_) as indicators of emphasis but the same character must be used to open and close an emphasis span. So this is a proper syntax for bold emphasis

but this is not

Actual Behavior

Following examples will be fontified as bold in Markdown Mode:

Software Versions Suggested Solution

markdown-regex-bold should be modified to match the emphasis indicators correctly:

(defconst markdown-regex-bold
  "\\(^\\|[^\\]\\)\\(\\(\\*\\*\\|__\\)\\([^ \n\t\\]\\|[^ \n\t]\\(?:.\\|\n[^\n]\\)*?[^\\ ]\\)\\(\\3\\)\\)"
  "Regular expression for matching bold text.
Group 1 matches the character before the opening asterisk or
underscore, if any, ensuring that it is not a backslash escape.
Group 2 matches the entire expression, including delimiters.
Groups 3 and 5 matches the opening and closing delimiters.
Group 4 matches the text inside the delimiters.")

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4