Efficiency: Entity handling

Previously, used a regexp to find and convert named entities in the content.
Now use a more efficient algorithm.
Similar tweak for converting NCRs before checking whether text is valid utf-8.
This commit is contained in:
Jacques Distler 2008-05-17 01:43:11 -05:00
parent 5ca0760f7c
commit 41346bf8bd
7 changed files with 50 additions and 29 deletions

View file

@ -12,10 +12,4 @@ class NoWikiTest < Test::Unit::TestCase
)
end
def test_sanitized_nowiki
match(NoWiki, 'This sentence contains <nowiki><span>a & b</span> <script>alert("XSS!");</script></nowiki>. Do not touch!',
:plain_text => '<span>a &amp; b</span> &lt;script&gt;alert("XSS!");&lt;/script&gt;'
)
end
end