Skip to content

Commit 0798a1a

Browse files
authored
Merge pull request #287 from alphagov/acronym_error_fix
Prevent user error when incorrectly formatted footnotes are added to HTML attachments
2 parents ee3ffea + b9199e8 commit 0798a1a

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## Unreleased
2+
3+
* Prevent user error when incorrectly formatted footnotes are added to HTML attachments ([#287](https://github.com/alphagov/govspeak/pull/287))
4+
15
## 8.2.0
26

37
* Reintroduce support for acronyms in Call To Action blocks and in Legislative Lists ([#285](https://github.com/alphagov/govspeak/pull/285))

lib/govspeak.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,8 @@ def encode(text)
451451
end
452452

453453
def add_acronym_alt_text(html)
454+
return unless html
455+
454456
@acronyms.each do |acronym|
455457
html.gsub!(acronym[0], "<abbr title=\"#{acronym[1].strip}\">#{acronym[0]}</abbr>")
456458
end

0 commit comments

Comments
 (0)