core :: FlatText :: chars_to_html_escape
self
to HTML, how many more bytes will be needed ?
# By escaping `self` to HTML, how many more bytes will be needed ?
fun chars_to_html_escape: Int do
var its = _items
var max = last_byte
var pos = first_byte
var endlen = 0
while pos <= max do
var c = its[pos]
if c == u'<' then
endlen += 3
else if c == u'>' then
endlen += 3
else if c == u'&' then
endlen += 4
else if c == u'"' then
endlen += 4
else if c == u'\'' then
endlen += 4
else if c == 0x2F then
endlen += 4
end
pos += 1
end
return endlen
end
lib/core/text/flat.nit:108,2--132,4