mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-23 00:29:53 +05:30
Fix index out of bounds error
This commit is contained in:
parent
97e3938f5f
commit
28584f22c5
@ -604,7 +604,7 @@ def text_to_parsed_content(text : String) : JSON::Any
|
|||||||
currentNode = {"text" => urlMatch[0], "navigationEndpoint" => {"urlEndpoint" => {"url" => urlMatch[0]}}}
|
currentNode = {"text" => urlMatch[0], "navigationEndpoint" => {"urlEndpoint" => {"url" => urlMatch[0]}}}
|
||||||
currentNodes << (JSON.parse(currentNode.to_json))
|
currentNodes << (JSON.parse(currentNode.to_json))
|
||||||
# If text remain after match create new simple node with text after match
|
# If text remain after match create new simple node with text after match
|
||||||
afterNode = {"text" => splittedLastNode.size > 0 ? splittedLastNode[1] : ""}
|
afterNode = {"text" => splittedLastNode.size > 1 ? splittedLastNode[1] : ""}
|
||||||
currentNodes << (JSON.parse(afterNode.to_json))
|
currentNodes << (JSON.parse(afterNode.to_json))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user