|
|
@ -56,24 +56,24 @@ module Bristlecode
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
it 'can render simple links' do
|
|
|
|
it 'can render simple links' do
|
|
|
|
input = '[url]example.com[/url]'
|
|
|
|
input = '[url]http://example.com[/url]'
|
|
|
|
output = '<a href="example.com">example.com</a>'
|
|
|
|
output = '<a href="http://example.com">http://example.com</a>'
|
|
|
|
expect(to_html(input)).to eq(output)
|
|
|
|
expect(to_html(input)).to eq(output)
|
|
|
|
|
|
|
|
|
|
|
|
input = '[url] example.com [/url]'
|
|
|
|
input = '[url] http://example.com [/url]'
|
|
|
|
output = '<a href="example.com">example.com</a>'
|
|
|
|
output = '<a href="http://example.com">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]x[b]y[/b]z[/url]'
|
|
|
|
input = '[url]http://x[b]y[/b]z[/url]'
|
|
|
|
output = '<a href="x[b]y[/b]z">x[b]y[/b]z</a>'
|
|
|
|
output = '<a href="http://x[b]y[/b]z">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=google.com]the google[/url]'
|
|
|
|
input = '[url=http://google.com]the google[/url]'
|
|
|
|
output = '<a href="google.com">the google</a>'
|
|
|
|
output = '<a href="http://google.com">the google</a>'
|
|
|
|
expect(to_html(input)).to eq(output)
|
|
|
|
expect(to_html(input)).to eq(output)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|