URL autolinking bypasses inlined HTML (or any other URL preceded by double or single quote)

This commit is contained in:
Alexey Verkhovsky 2005-02-20 09:28:41 +00:00
parent 3e7610c0cd
commit b1b04e1af4
4 changed files with 44 additions and 28 deletions

View file

@ -139,6 +139,15 @@ class RevisionTest < Test::Unit::TestCase
'This !http://hobix.com/sample.jpg! is a Textile image link.')
end
def test_content_with_inlined_img_tag
assert_markup_parsed_as(
'<p>This <img src="http://hobix.com/sample.jpg" alt="" /> is an inline image link.</p>',
'This <img src="http://hobix.com/sample.jpg" alt="" /> is an inline image link.')
assert_markup_parsed_as(
'<p>This <IMG SRC="http://hobix.com/sample.jpg" alt=""> is an inline image link.</p>',
'This <IMG SRC="http://hobix.com/sample.jpg" alt=""> is an inline image link.')
end
def test_content_with_nowiki_text
assert_markup_parsed_as(
'<p>Do not mark up [[this text]] or http://www.thislink.com.</p>',

View file

@ -131,6 +131,11 @@ class URITest < Test::Unit::TestCase
match(URIChunk, 'This http://hobix.com/sample.jpg should match',
:link_text => 'http://hobix.com/sample.jpg')
end
def test_inline_html
assert_conversion_does_not_apply(URIChunk, '<IMG SRC="http://hobix.com/sample.jpg">')
assert_conversion_does_not_apply(URIChunk, "<img src='http://hobix.com/sample.jpg'/>")
end
def test_non_uri
# "so" is a valid country code; "libproxy.so" is a valid url