Merge pull request #4782 from nonamethanks/feat-nicoseiga-spoiler

Nicoseiga: auto-add spoiler tags to commentary
This commit is contained in:
evazion
2021-05-05 05:07:13 -05:00
committed by GitHub
2 changed files with 30 additions and 1 deletions

View File

@@ -134,7 +134,11 @@ module Sources
end
def dtext_artist_commentary_desc
DText.from_html(artist_commentary_desc).gsub(/[^\w]im(\d+)/, ' seiga #\1 ')
DText.from_html(artist_commentary_desc) do |element|
if element.name == "font" && element["color"] == "white"
element.content = "[spoiler]#{element.content}[/spoiler]"
end
end.gsub(/[^\w]im(\d+)/, ' seiga #\1 ').chomp
end
def normalize_for_source