Browse Source

Titles are changed to simpler "strong" elements

remotes/origin/master
echarp 3 years ago
parent
commit
e3936359b9
  1. 1
      app/helpers/events_helper.rb
  2. 5
      test/helpers/events_helper_test.rb

1
app/helpers/events_helper.rb

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

5
test/helpers/events_helper_test.rb

@ -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

Loading…
Cancel
Save