Skip to content

Commit

Permalink
Merge pull request #3058 from benwbrum/3044-escape-ampersands-on-export
Browse files Browse the repository at this point in the history
Escape ampersands on PDF export for #3044
  • Loading branch information
saracarl committed Mar 24, 2022
2 parents 1f3ef47 + 075d605 commit 19afd62
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/helpers/export_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ def xml_to_pandoc_md(xml_text, preserve_lb=true, flatten_links=false, collection
preprocessed = xml_text || ''
preprocessed.gsub!("[","\\[")
preprocessed.gsub!("]","\\]")
preprocessed.gsub!('&', '&') # escape ampersands
preprocessed.gsub!(/&(amp;)+/, '&') # clean double escapes


doc = REXML::Document.new(preprocessed)
Expand Down

0 comments on commit 19afd62

Please sign in to comment.