Skip to content

Commit

Permalink
Merge pull request #287 from alphagov/acronym_error_fix
Browse files Browse the repository at this point in the history
Prevent user error when incorrectly formatted footnotes are added to HTML attachments
  • Loading branch information
AshGDS authored Aug 30, 2023
2 parents ee3ffea + b9199e8 commit 0798a1a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Unreleased

* Prevent user error when incorrectly formatted footnotes are added to HTML attachments ([#287](https://github.com/alphagov/govspeak/pull/287))

## 8.2.0

* Reintroduce support for acronyms in Call To Action blocks and in Legislative Lists ([#285](https://github.com/alphagov/govspeak/pull/285))
Expand Down
2 changes: 2 additions & 0 deletions lib/govspeak.rb
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,8 @@ def encode(text)
end

def add_acronym_alt_text(html)
return unless html

@acronyms.each do |acronym|
html.gsub!(acronym[0], "<abbr title=\"#{acronym[1].strip}\">#{acronym[0]}</abbr>")
end
Expand Down

0 comments on commit 0798a1a

Please sign in to comment.