Nicoseiga: auto-add spoiler tags to commentary

This commit is contained in:
nonamethanks
2021-04-06 14:08:49 +02:00
parent a2f3ba695c
commit cb6196c259
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