Sha256: 24d93733682e0d517d76f0b1e5a39fa098e70bd0106adf6be9d63543bea56acf

Contents?: true

Size: 894 Bytes

Versions: 11

Compression:

Stored size: 894 Bytes

Contents

require 'helper'

class TestSkimHtmlEscaping < TestSkim
  def test_html_will_not_be_escaped
    source = %q{
p <Hello> World, meet "Skim".
}

    with_and_without_asset do
      assert_html '<p><Hello> World, meet "Skim".</p>', source
    end
  end

  def test_html_with_newline_will_not_be_escaped
    source = %q{
p
  |
    <Hello> World,
     meet "Skim".
}

    with_and_without_asset do
      assert_html "<p><Hello> World,\n meet \"Skim\".</p>", source
    end
  end

  def test_html_with_escaped_interpolation
    source = %q{
- x = '"'
- content = '<x>'
p class="#{x}" test #{content}
}

    with_and_without_asset do
      assert_html '<p class="&quot;">test &lt;x&gt;</p>', source
    end
  end

  def test_html_nested_escaping
    source = %q{
= @callback "Test", ->
  | escaped &
}
    with_and_without_asset do
      assert_html 'Test escaped &amp; Test', source
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
skim-0.9.3 test/test_html_escaping.rb
skim-0.9.2 test/test_html_escaping.rb
skim-0.9.1 test/test_html_escaping.rb
skim-0.9.0 test/test_html_escaping.rb
skim-0.8.6 test/test_html_escaping.rb
skim-0.8.5 test/test_html_escaping.rb
skim-0.8.4 test/test_html_escaping.rb
skim-0.8.3 test/test_html_escaping.rb
skim-0.8.2 test/test_html_escaping.rb
skim-0.8.1 test/test_html_escaping.rb
skim-0.8.0 test/test_html_escaping.rb