Skip to content

Commit

Permalink
Merge pull request #590 from indirect/footnotes-again
Browse files Browse the repository at this point in the history
fix yet another broken money stuff footnotes situation
  • Loading branch information
indirect authored Dec 5, 2024
2 parents d0c3fa8 + 2bbad04 commit 0a351e1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/lib/body_formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ def format(from_name)
.gsub("</style>", "[class^=\"liveintent\"] { display: none !important; }</style>")
.gsub("</head>", ApplicationController.render(partial: "posts/injected_header"))
.gsub(/<table class="footer".*/m, "</body></html>")
return body if body =~ /class="footnote-content"/
return body if body.match?(/class="footnote-content"/)

body.gsub!(/href="#footnote-(\d+)"/) { "href=\"#footnote-#{$1}\" class=\"footnote-index\"" }
body.gsub!(/id="footnote-(\d+)"/) { "id=\"footnote-#{$1}\" class=\"footnote-content\"" }
return body if body.match?(/class="footnote-content"/)

body.gsub(/(.{4})(\[\d+\])/) do
if $1 == "<em>"
Expand Down

0 comments on commit 0a351e1

Please sign in to comment.