Ticket #17 (closed defect: duplicate)
BlueCloth bold/italic problem.
| Reported by: | Lloyd Zusman <ljz@…> | Owned by: | deveiant |
|---|---|---|---|
| Priority: | normal | Milestone: | Markdown 1.0.1 |
| Component: | MarkdownSyntax | Version: | 1.0.0 |
| Severity: | normal | Keywords: | double-character bold/italic |
| Cc: |
Description
[via ruby-talk:120923]:
From: Lloyd Zusman <ljz@…>
Newsgroups: comp.lang.ruby
Subject: BlueCloth bold/italic problem.
Date: Sat, 20 Nov 2004 12:01:56 +0900
Message-ID: <m3is81tedi.fsf@…>
I have discovered that in the latest release of BlueCloth, it's impossible to render 2-character words in either bold or italic.
I looked through the source code, and I found the reason why:
# 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
Notice that the regexps only match strings that are either 1 character long or at least 3 characters long. To fix this, I believe that the code needs to be changed as follows:
# 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
(I replaced ".+?" with ".*?")
Is there any reason for why this change shouldn't be made? If so, is there another way to get BlueCloth to render 2-character words in bold or italics?
Thanks in advance.
--
Lloyd Zusman l...@… God bless you.
