Skip to content

Commit

Permalink
Restore behaviour of headings being able to be rendered inside exampl…
Browse files Browse the repository at this point in the history
…e boxes
  • Loading branch information
callumknights committed Dec 23, 2024
1 parent 33a1e11 commit fa35a4a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/govspeak.rb
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def render_image(image)
extension("example", surrounded_by("$E")) do |body|
<<~BODY
<div class="example" markdown="1">
#{body.strip.gsub(/\A^\|/, "\n|").gsub(/\|$\Z/, "|\n")}
#{body.strip.gsub(/\A^\|/, "\n|").gsub(/\|$\Z/, "|\n")}
</div>
BODY
end
Expand Down
16 changes: 16 additions & 0 deletions test/govspeak_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1334,6 +1334,22 @@ class GovspeakTest < Minitest::Test
</div>)
end

test_given_govspeak "
$E
### A heading within an example
Some example content
$E" do
assert_html_output %(
<div class="example">
<h3 id="a-heading-within-an-example">A heading within an example</h3>
<p>Some example content</p>
</div>)
end

test_given_govspeak "
$LegislativeList
* 1. Item 1[^1] with an ACRONYM
Expand Down

0 comments on commit fa35a4a

Please sign in to comment.