minad-creole 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/creole.rb +3 -3
- data/test/testcases.rb +2 -0
- metadata +1 -1
data/lib/creole.rb
CHANGED
@@ -29,7 +29,7 @@ require 'uri'
|
|
29
29
|
|
30
30
|
module Creole
|
31
31
|
|
32
|
-
VERSION = '0.3.
|
32
|
+
VERSION = '0.3.2'
|
33
33
|
|
34
34
|
# CreoleParseError is raised when the Creole parser encounters
|
35
35
|
# something unexpected. This is generally now thrown unless there is
|
@@ -278,7 +278,7 @@ module Creole
|
|
278
278
|
|
279
279
|
def parse_table_row(str)
|
280
280
|
@out << '<tr>'
|
281
|
-
str.scan(/\s*\|(=)?\s*(([^|~]|~.)*)(?=\||$)/)
|
281
|
+
str.scan(/\s*\|(=)?\s*((\[\[.*?\]\]|\{\{.*?\}\}|[^|~]|~.)*)(?=\||$)/) do
|
282
282
|
unless $2.empty? and $'.empty?
|
283
283
|
@out << ($1 ? '<th>' : '<td>')
|
284
284
|
parse_inline($2) if $2
|
@@ -287,7 +287,7 @@ module Creole
|
|
287
287
|
end
|
288
288
|
@out << ($1 ? '</th>' : '</td>')
|
289
289
|
end
|
290
|
-
|
290
|
+
end
|
291
291
|
@out << '</tr>'
|
292
292
|
end
|
293
293
|
|
data/test/testcases.rb
CHANGED
@@ -446,6 +446,8 @@ module TestCases
|
|
446
446
|
tc "<table><tr><td>c1</td><td>c2|</td><td></td></tr></table>", "|c1|c2~|||"
|
447
447
|
# Equal sign after pipe make a header
|
448
448
|
tc "<table><tr><th>Header</th></tr></table>", "|=Header|"
|
449
|
+
|
450
|
+
tc "<table><tr><td>c1</td><td><a href=\"Link\">Link text</a></td><td><img src=\"Image\" alt=\"Image text\"/></td></tr></table>", "|c1|[[Link|Link text]]|{{Image|Image text}}|"
|
449
451
|
end
|
450
452
|
|
451
453
|
def test_following_table
|