|
|
@ -21,9 +21,6 @@ module Bristlecode
|
|
|
|
expect(to_html('&')).to eq('&')
|
|
|
|
expect(to_html('&')).to eq('&')
|
|
|
|
expect(to_html('>')).to eq('>')
|
|
|
|
expect(to_html('>')).to eq('>')
|
|
|
|
expect(to_html('<')).to eq('<')
|
|
|
|
expect(to_html('<')).to eq('<')
|
|
|
|
expect(to_html("'")).to eq(''')
|
|
|
|
|
|
|
|
expect(to_html('"')).to eq('"')
|
|
|
|
|
|
|
|
expect(to_html('/')).to eq('/')
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
it 'handles plain text just fine' do
|
|
|
|
it 'handles plain text just fine' do
|
|
|
@ -57,23 +54,23 @@ module Bristlecode
|
|
|
|
|
|
|
|
|
|
|
|
it 'can render simple links' do
|
|
|
|
it 'can render simple links' do
|
|
|
|
input = '[url]http://example.com[/url]'
|
|
|
|
input = '[url]http://example.com[/url]'
|
|
|
|
output = '<a href="http://example.com">http://example.com</a>'
|
|
|
|
output = '<a href="http://example.com" rel="nofollow">http://example.com</a>'
|
|
|
|
expect(to_html(input)).to eq(output)
|
|
|
|
expect(to_html(input)).to eq(output)
|
|
|
|
|
|
|
|
|
|
|
|
input = '[url] http://example.com [/url]'
|
|
|
|
input = '[url] http://example.com [/url]'
|
|
|
|
output = '<a href="http://example.com">http://example.com</a>'
|
|
|
|
output = '<a href="http://example.com" rel="nofollow">http://example.com</a>'
|
|
|
|
expect(to_html(input)).to eq(output)
|
|
|
|
expect(to_html(input)).to eq(output)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
it 'passes simple url contents opaquely' do
|
|
|
|
it 'passes simple url contents opaquely' do
|
|
|
|
input = '[url]http://x[b]y[/b]z[/url]'
|
|
|
|
input = '[url]http://x[b]y[/b]z[/url]'
|
|
|
|
output = '<a href="http://x[b]y[/b]z">http://x[b]y[/b]z</a>'
|
|
|
|
output = '<a href="http://x%5Bb%5Dy%5B/b%5Dz" rel="nofollow">http://x[b]y[/b]z</a>'
|
|
|
|
expect(to_html(input)).to eq(output)
|
|
|
|
expect(to_html(input)).to eq(output)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
it 'handles urls with titles' do
|
|
|
|
it 'handles urls with titles' do
|
|
|
|
input = '[url=http://google.com]the google[/url]'
|
|
|
|
input = '[url=http://google.com]the google[/url]'
|
|
|
|
output = '<a href="http://google.com">the google</a>'
|
|
|
|
output = '<a href="http://google.com" rel="nofollow">the google</a>'
|
|
|
|
expect(to_html(input)).to eq(output)
|
|
|
|
expect(to_html(input)).to eq(output)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|