Ticket #52 (new defect)
Opened 2 months ago
Two letter bold and emphasis
| Reported by: | grignaak | Owned by: | deveiant |
|---|---|---|---|
| Priority: | normal | Milestone: | Bugfixes |
| Component: | MarkdownSyntax | Version: | 1.0.0fc2 |
| Severity: | normal | Keywords: | bold emphasis |
| Cc: |
Description
words with two letters are not bolded properly.
Example
*ok* => *ok*
**ok** => <em>*ok</em>*
Fix
It's a simple change in the regular expressions:
# Pattern to match strong emphasis in Markdown text
BoldRegexp = %r{ (\*\*|__) (\S|\S.+?\S) \1 }x
# Pattern to match normal emphasis in Markdown text
ItalicRegexp = %r{ (\*|_) (\S|\S.+?\S) \1 }x
becomes:
# Pattern to match strong emphasis in Markdown text
BoldRegexp = %r{ (\*\*|__) (\S|\S.*?\S) \1 }x
# Pattern to match normal emphasis in Markdown text
ItalicRegexp = %r{ (\*|_) (\S|\S.*?\S) \1 }x
(ie. the +s become *s)
Note: See
TracTickets for help on using
tickets.
