Titles are changed to simpler "strong" elements
This commit is contained in:
parent
24ff28b64a
commit
e3936359b9
@ -68,6 +68,7 @@ module EventsHelper
|
|||||||
.gsub(/\\([\"'])/, '\1') # Remove slash before quotes
|
.gsub(/\\([\"'])/, '\1') # Remove slash before quotes
|
||||||
.remove(/[[:blank:]]+$/) # Remove extraneous spaces
|
.remove(/[[:blank:]]+$/) # Remove extraneous spaces
|
||||||
.remove(/{::}/) # Markdown artefact
|
.remove(/{::}/) # Markdown artefact
|
||||||
|
.gsub(/^#+ (.*)/, '**\1**')
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -18,4 +18,9 @@ class EventsHelperTest < ActionView::TestCase
|
|||||||
assert_equal '*ho* **h**,', to_markdown('<em>ho</em><strong> h</strong>,')
|
assert_equal '*ho* **h**,', to_markdown('<em>ho</em><strong> h</strong>,')
|
||||||
assert_equal '*ho* **h**,', to_markdown('<i>ho</i><b> h</b>,')
|
assert_equal '*ho* **h**,', to_markdown('<i>ho</i><b> h</b>,')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test 'HTML titles to strong' do
|
||||||
|
assert_equal '**Big**', to_markdown('<h1>Big</h1>,')
|
||||||
|
assert_equal '**Big again**', to_markdown('<h2>Big again</h2>,')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user