kramdown-prismic 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f359eb669c8df2396663e3178ea8b6f50be0df3e
4
- data.tar.gz: 9b554b3ee7712f1f031dfef0e4ff50d3e28a40e9
3
+ metadata.gz: ae42e32a63e34a7692e2f6dd7af5ec86638bb253
4
+ data.tar.gz: 0eecb39a28de782cb45e5dba7dbceed5d07b356a
5
5
  SHA512:
6
- metadata.gz: 7824f29f541ece46868bdfaf577e152072de425619e92a721c974c9bfc01da7bb8f254362c0a05ed3a4ac826e0a29ecaf6979fffef56df68cc35b9485e05b3f4
7
- data.tar.gz: 4136cd39ff0b11f6c5bfe7357d9a63a3b7d173f12006317d83d70fd42b8ac2ed90e82f11677f5e423936faf3e14de5d0aaaaed35f04b90fe7a870e2f076b9970
6
+ metadata.gz: c231aed1d32708a75cc1812595970aa470b3d5d185916a414484a624c6ec7d1051299690201629b551ca47e53e6449f94ede6b4c0f31e0315fc88553635c692b
7
+ data.tar.gz: 2564bfd26fb1a5aa616610f6f4dfd6ecd2523c7ec191f5c179afbf5cdaf1f9f8f92b15ad7abfaabe141239875478f03a21687ece16bdc3a681751123323c4cc3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kramdown-prismic (0.0.1)
4
+ kramdown-prismic (0.0.2)
5
5
  kramdown (~> 1.0)
6
6
 
7
7
  GEM
@@ -1,3 +1,3 @@
1
1
  module KramdownPrismic
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -148,6 +148,14 @@ module Kramdown
148
148
  def extract_span_p(element, memo)
149
149
  extract_content(element, memo)
150
150
  end
151
+
152
+ def extract_span_entity(element, memo)
153
+ memo[:text] += unicode_char(element.value.code_point)
154
+ end
155
+
156
+ def unicode_char(codepoint)
157
+ Utils::Entities::Entity.new(codepoint, '').char
158
+ end
151
159
  end
152
160
  end
153
161
  end
@@ -264,4 +264,17 @@ class KramdownPrismicTest < Minitest::Test
264
264
  markdown = "![](/img.png)"
265
265
  assert_equal expected, Kramdown::Document.new(markdown).to_prismic
266
266
  end
267
+
268
+ def test_convert_entity
269
+ expected = [
270
+ {type: "paragraph",
271
+ content: {
272
+ text: "\u00a0",
273
+ spans: []
274
+ }
275
+ }
276
+ ]
277
+ markdown = "&nbsp;"
278
+ assert_equal expected, Kramdown::Document.new(markdown, input: :markdown).to_prismic
279
+ end
267
280
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kramdown-prismic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - François de Metz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-28 00:00:00.000000000 Z
11
+ date: 2017-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kramdown