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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/kramdown-prismic/version.rb +1 -1
- data/lib/kramdown/converter/prismic.rb +8 -0
- data/test/kramdown-prismic_test.rb +13 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae42e32a63e34a7692e2f6dd7af5ec86638bb253
|
4
|
+
data.tar.gz: 0eecb39a28de782cb45e5dba7dbceed5d07b356a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c231aed1d32708a75cc1812595970aa470b3d5d185916a414484a624c6ec7d1051299690201629b551ca47e53e6449f94ede6b4c0f31e0315fc88553635c692b
|
7
|
+
data.tar.gz: 2564bfd26fb1a5aa616610f6f4dfd6ecd2523c7ec191f5c179afbf5cdaf1f9f8f92b15ad7abfaabe141239875478f03a21687ece16bdc3a681751123323c4cc3
|
data/Gemfile.lock
CHANGED
@@ -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 = " "
|
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.
|
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-
|
11
|
+
date: 2017-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kramdown
|