Skip to content

Commit

Permalink
More HTML escape specs
Browse files Browse the repository at this point in the history
  • Loading branch information
veelenga committed Aug 3, 2017
1 parent 4b33783 commit 0e38b74
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spec/autolink_spec.cr
@@ -1,4 +1,5 @@
require "./spec_helper"
require "html"

describe Autolink do
it "auto link URLs" do
Expand Down Expand Up @@ -94,5 +95,8 @@ describe Autolink do
it "can autolink url having escaped html" do
link = %q(<a href="example">http://example.com</a>).gsub("<", "&lt;")
auto_link(link).should eq %q(&lt;a href="example"><a href="http://example.com">http://example.com</a>&lt;/a>)

link = HTML.escape(%q(<a href="example">http://example.com</a>))
auto_link(link).should eq %q(&lt;a href&#61;&quot;example&quot;&gt;<a href="http://example.com">http://example.com</a>&lt;/a&gt;)
end
end

0 comments on commit 0e38b74

Please sign in to comment.