mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-23 00:29:53 +05:30
escape html, add todo comment
This commit is contained in:
parent
a9f55aa310
commit
039212ed91
@ -141,7 +141,8 @@ module Invidious::Comments
|
|||||||
comment_mutation = mutations.find { |i| i.dig?("payload", "commentEntityPayload", "key") == comment_key }
|
comment_mutation = mutations.find { |i| i.dig?("payload", "commentEntityPayload", "key") == comment_key }
|
||||||
toolbar_mutation = mutations.find { |i| i.dig?("entityKey") == toolbar_key }
|
toolbar_mutation = mutations.find { |i| i.dig?("entityKey") == toolbar_key }
|
||||||
if !comment_mutation.nil? && !toolbar_mutation.nil?
|
if !comment_mutation.nil? && !toolbar_mutation.nil?
|
||||||
html_content = comment_mutation.dig("payload", "commentEntityPayload", "properties", "content", "content").as_s
|
# todo parse styleRuns, commandRuns and attachmentRuns for comments
|
||||||
|
html_content = HTML.escape(comment_mutation.dig("payload", "commentEntityPayload", "properties", "content", "content").as_s)
|
||||||
if comment_author = comment_mutation.dig?("payload", "commentEntityPayload", "author")
|
if comment_author = comment_mutation.dig?("payload", "commentEntityPayload", "author")
|
||||||
json.field "authorId", comment_author["channelId"].as_s
|
json.field "authorId", comment_author["channelId"].as_s
|
||||||
json.field "authorUrl", "/channel/#{comment_author["channelId"].as_s}"
|
json.field "authorUrl", "/channel/#{comment_author["channelId"].as_s}"
|
||||||
|
Loading…
Reference in New Issue
Block a user