Titles are changed to simpler "strong" elements

This commit is contained in:
echarp 2019-03-03 17:17:14 +00:00
parent 24ff28b64a
commit e3936359b9
2 changed files with 6 additions and 0 deletions

View File

@ -68,6 +68,7 @@ module EventsHelper
.gsub(/\\([\"'])/, '\1') # Remove slash before quotes
.remove(/[[:blank:]]+$/) # Remove extraneous spaces
.remove(/{::}/) # Markdown artefact
.gsub(/^#+ (.*)/, '**\1**')
end
private

View File

@ -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('<i>ho</i><b> h</b>,')
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