Markdown Extra Formatter bugs » bluefeather_underscore_em.diff
lib/bluefeather.rb | ||
---|---|---|
1690 | 1690 |
|
1691 | 1691 |
|
1692 | 1692 |
# Pattern to match strong emphasis in Markdown text |
1693 |
BoldRegexp = %r{ (\*\*|__) (\S|\S.*?\S) \1 }x |
|
1693 |
BoldRegexp1 = %r{ \*\* (\S|\S.*?\S) \*\* }x |
|
1694 |
BoldRegexp2 = %r{ (^|\s) __ (\S|\S.*?\S) __ (\s|$) }x |
|
1694 | 1695 |
|
1695 | 1696 |
# Pattern to match normal emphasis in Markdown text |
1696 |
ItalicRegexp = %r{ (\*|_) (\S|\S.*?\S) \1 }x |
|
1697 |
ItalicRegexp1 = %r{ \* (\S|\S.*?\S) \* }x |
|
1698 |
ItalicRegexp2 = %r{ (^|\s) _ (\S|\S.*?\S) _ (\s|$) }x |
|
1697 | 1699 |
|
1698 | 1700 |
### Transform italic- and bold-encoded text in a copy of the specified +str+ |
1699 | 1701 |
### and return it. |
... | ... | |
1701 | 1703 |
@log.debug " Transforming italic and bold" |
1702 | 1704 |
|
1703 | 1705 |
str. |
1704 |
gsub( BoldRegexp, %{<strong>\\2</strong>} ). |
|
1705 |
gsub( ItalicRegexp, %{<em>\\2</em>} ) |
|
1706 |
gsub( BoldRegexp1, %{<strong>\\1</strong>} ). |
|
1707 |
gsub( BoldRegexp2, %{<strong>\\2</strong>} ). |
|
1708 |
gsub( ItalicRegexp1, %{<em>\\1</em>} ). |
|
1709 |
gsub( ItalicRegexp2, %{\\1<em>\\2</em>\\3} ) |
|
1706 | 1710 |
end |
1707 | 1711 |
|
1708 | 1712 |
|
- « Previous
- 1
- 2
- Next »