]> cat aescling's git repositories - mastodon.git/commitdiff
Fix HTML entities being encoded as hashtag links…
authorThibaut Girka <thib@sitedethib.com>
Fri, 19 Jul 2019 18:15:03 +0000 (20:15 +0200)
committerThibaut Girka <thib@sitedethib.com>
Fri, 19 Jul 2019 18:15:03 +0000 (20:15 +0200)
app/lib/formatter.rb

index 113b5c4a0820abce77488c05f55120774545c53b..85bc8eb1f9231ae0d4746bb1ecf0f339f114016b 100644 (file)
@@ -314,7 +314,7 @@ class Formatter
     gaps = []
     total_offset = 0
 
-    escaped = html.gsub(/<[^>]*>/) do |match|
+    escaped = html.gsub(/<[^>]*>|&#[0-9]+;/) do |match|
       total_offset += match.length - 1
       end_offset = Regexp.last_match.end(0)
       gaps << [end_offset - total_offset, total_offset]