kramdown-prismic 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/kramdown-prismic/version.rb +1 -1
- data/lib/kramdown/converter/prismic.rb +9 -0
- data/test/converter_test.rb +25 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba6d3ad52704c02e2ec102cc69ca216f02c464ba6cde85c2f28024c66448a985
|
4
|
+
data.tar.gz: 64fdd7184a0184c10b72acb00d2109f1b3512fc53392327a5f537d091d5796ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea6f89410664900030c17478ed4cce6fb6a499974ef775f421fd1b720e7f28e123526eb1893889f42d8964928a1c2139387f2dae408a3ea19dffc50805430918
|
7
|
+
data.tar.gz: 95c6df198bfdacb61f24606575d4fd5d517b1285750a4dd463f15cc0416513759aec67183eb3820c64c221d5154acbb826e0a74b7e9f797ddfff7cbb2bbae165
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -187,6 +187,11 @@ module Kramdown
|
|
187
187
|
nil
|
188
188
|
end
|
189
189
|
|
190
|
+
def convert_xml_comment(_element)
|
191
|
+
warning('translating xml comment is not supported')
|
192
|
+
nil
|
193
|
+
end
|
194
|
+
|
190
195
|
def convert_raw(_element)
|
191
196
|
warning('translating raw is not supported')
|
192
197
|
nil
|
@@ -268,6 +273,10 @@ module Kramdown
|
|
268
273
|
memo[:text] += element.value
|
269
274
|
end
|
270
275
|
|
276
|
+
def extract_span_xml_comment(element, memo)
|
277
|
+
warning('translating xml comment is not supported')
|
278
|
+
end
|
279
|
+
|
271
280
|
TYPOGRAPHIC_SYMS = {
|
272
281
|
mdash: [Utils::Entities.entity('mdash')],
|
273
282
|
ndash: [Utils::Entities.entity('ndash')],
|
data/test/converter_test.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# coding: utf-8
|
1
2
|
# frozen_string_literal: true
|
2
3
|
|
3
4
|
require 'minitest/autorun'
|
@@ -587,6 +588,30 @@ class KramdownPrismicConverterTest < Minitest::Test
|
|
587
588
|
assert_equal 1, doc.warnings.size
|
588
589
|
end
|
589
590
|
|
591
|
+
def test_convert_xml_comment
|
592
|
+
expected = []
|
593
|
+
markdown = "<!-- Main -->"
|
594
|
+
doc = Kramdown::Document.new(markdown, input: :kramdown)
|
595
|
+
assert_equal expected, doc.to_prismic
|
596
|
+
assert_equal 1, doc.warnings.size
|
597
|
+
end
|
598
|
+
|
599
|
+
def test_convert_span_xml_comment
|
600
|
+
expected = [
|
601
|
+
{
|
602
|
+
type: 'paragraph',
|
603
|
+
content: {
|
604
|
+
text: 'test test',
|
605
|
+
spans: []
|
606
|
+
}
|
607
|
+
}
|
608
|
+
]
|
609
|
+
markdown = "test <!-- Main --> test"
|
610
|
+
doc = Kramdown::Document.new(markdown, input: :kramdown)
|
611
|
+
assert_equal expected, doc.to_prismic
|
612
|
+
assert_equal 1, doc.warnings.size
|
613
|
+
end
|
614
|
+
|
590
615
|
def test_convert_comment
|
591
616
|
expected = []
|
592
617
|
markdown = "{::comment}\nComment\n{:/comment}"
|
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.3.
|
4
|
+
version: 0.3.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: 2021-08-
|
11
|
+
date: 2021-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kramdown
|