/source.json: strip html tags from artist commentary.

This commit is contained in:
evazion
2017-05-01 21:24:02 -05:00
parent b2f62482a1
commit 8015d62b46
2 changed files with 18 additions and 0 deletions

View File

@@ -86,10 +86,25 @@ module Sources
nil
end
def dtext_artist_commentary_title
self.class.to_dtext(artist_commentary_title)
end
def dtext_artist_commentary_desc
self.class.to_dtext(artist_commentary_desc)
end
protected
def agent
raise NotImplementedError
end
# Convert commentary to dtext by stripping html tags. Sites can override
# this to customize how their markup is translated to dtext.
def self.to_dtext(text)
text = Rails::Html::FullSanitizer.new.sanitize(text, encode_special_chars: false)
text
end
end
end
end