Sha256: f083c8943d482d364a4936bb67b2d49e3ab85845a4f0062692c4732f3696ec93

Contents?: true

Size: 639 Bytes

Versions: 38

Compression:

Stored size: 639 Bytes

Contents

# coding: utf-8
require 'test_helper'

class TestEncoding < Minitest::Test
  # see http://git.io/vq4FR
  def test_encoding
    contents = File.read(File.join(FIXTURES_DIR, 'curly.md'), encoding: 'utf-8')
    doc = CommonMarker.render_doc(contents, :SMART)
    render = doc.to_html
    assert_equal render.rstrip, '<p>This curly quote “makes commonmarker throw an exception”.</p>'
  end

  def test_string_content_is_utf8
    doc = CommonMarker.render_doc('Hi *there*')
    text = doc.first_child.last_child.first_child
    assert_equal text.string_content, 'there'
    assert_equal text.string_content.encoding.name, 'UTF-8'
  end
end

Version data entries

38 entries across 38 versions & 2 rubygems

Version Path
commonmarker-0.18.2 test/test_encoding.rb
commonmarker-0.18.1 test/test_encoding.rb
commonmarker-0.18.0 test/test_encoding.rb
commonmarker-0.17.13 test/test_encoding.rb
commonmarker-0.17.12 test/test_encoding.rb
commonmarker-0.17.11 test/test_encoding.rb
commonmarker-0.17.10 test/test_encoding.rb
tdiary-5.0.8 vendor/bundle/gems/commonmarker-0.17.9/test/test_encoding.rb
commonmarker-0.17.9 test/test_encoding.rb
commonmarker-0.17.8 test/test_encoding.rb
commonmarker-0.17.7.1 test/test_encoding.rb
commonmarker-0.17.7 test/test_encoding.rb
commonmarker-0.17.6 test/test_encoding.rb
commonmarker-0.17.5 test/test_encoding.rb
commonmarker-0.17.4 test/test_encoding.rb
commonmarker-0.17.2 test/test_encoding.rb
commonmarker-0.17.1 test/test_encoding.rb
commonmarker-0.17.0 test/test_encoding.rb
commonmarker-0.16.8 test/test_encoding.rb
commonmarker-0.16.7 test/test_encoding.rb