mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2026-01-30 18:51:17 +00:00
Parse links in the comments
Co-Authored-By: Samantaz Fox <coding@samantaz.fr>
This commit is contained in:
@@ -7,7 +7,19 @@ private def copy_string(str : String::Builder, iter : Iterator, count : Int) : I
|
||||
cp = iter.next
|
||||
break if cp.is_a?(Iterator::Stop)
|
||||
|
||||
str << cp.chr
|
||||
if cp == 0x26 # Ampersand (&)
|
||||
str << "&"
|
||||
elsif cp == 0x27 # Single quote (')
|
||||
str << "'"
|
||||
elsif cp == 0x22 # Double quote (")
|
||||
str << """
|
||||
elsif cp == 0x3C # Less-than (<)
|
||||
str << "<"
|
||||
elsif cp == 0x3E # Greater than (>)
|
||||
str << ">"
|
||||
else
|
||||
str << cp.chr
|
||||
end
|
||||
|
||||
# A codepoint from the SMP counts twice
|
||||
copied += 1 if cp > 0xFFFF
|
||||
|
||||
Reference in New Issue
Block a user