kramdown-prismic 0.3.8 → 0.3.9
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 +2 -2
- data/lib/kramdown/converter/prismic.rb +3 -1
- data/lib/kramdown-prismic/version.rb +1 -1
- data/test/converter_test.rb +15 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76a75c9530dc6b9336112a445b9fc4cd811e17059e4677c2094c1b22b585fa06
|
4
|
+
data.tar.gz: 77315988401b9fc306026b3d6a1b9d184b2a92a579fddd2871ba27dbc4000292
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 576fc16369c963b6a1215e834dd72e88231177773cd2e62cfba973f4ae59288a508965db55759b214aebab1a0239c0b8d067b9e4a95a861ef7be6c002b3434d3
|
7
|
+
data.tar.gz: c6cd045fa16db194a3f6e3e78fc8cf2c86029e68e8a3b6194140c4f9c08f9db12f92ce0c1abd9b4ef391fc57112a34daac0166b6f5e14378178f7ab852466431
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -249,10 +249,12 @@ module Kramdown
|
|
249
249
|
end
|
250
250
|
|
251
251
|
def extract_span_a(element, memo)
|
252
|
+
target = element.attr['target']
|
252
253
|
insert_span(element, memo, {
|
253
254
|
type: 'hyperlink',
|
254
255
|
data: {
|
255
|
-
url: element.attr['href']
|
256
|
+
url: element.attr['href'],
|
257
|
+
**(target ? { target: target } : {}),
|
256
258
|
}
|
257
259
|
})
|
258
260
|
end
|
data/test/converter_test.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
# coding: utf-8
|
2
1
|
# frozen_string_literal: true
|
3
2
|
|
4
3
|
require 'minitest/autorun'
|
@@ -613,6 +612,21 @@ class KramdownPrismicConverterTest < Minitest::Test
|
|
613
612
|
assert_equal expected, doc.to_prismic
|
614
613
|
end
|
615
614
|
|
615
|
+
def test_convert_link
|
616
|
+
expected = [
|
617
|
+
{
|
618
|
+
type: 'paragraph',
|
619
|
+
content: {
|
620
|
+
text: 'Test',
|
621
|
+
spans: [{type: 'hyperlink', data: {url: 'http://example.net', target: '_blank'}, start: 0, end: 4}]
|
622
|
+
}
|
623
|
+
}
|
624
|
+
]
|
625
|
+
html = '<a href="http://example.net" target="_blank">Test</a>'
|
626
|
+
doc = Kramdown::Document.new(html, input: :markdown)
|
627
|
+
assert_equal expected, doc.to_prismic
|
628
|
+
end
|
629
|
+
|
616
630
|
def test_convert_html
|
617
631
|
expected = []
|
618
632
|
html = '<div></div>'
|
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.9
|
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: 2022-
|
11
|
+
date: 2022-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kramdown
|
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
107
|
- !ruby/object:Gem::Version
|
108
108
|
version: '0'
|
109
109
|
requirements: []
|
110
|
-
rubygems_version: 3.
|
110
|
+
rubygems_version: 3.1.4
|
111
111
|
signing_key:
|
112
112
|
specification_version: 4
|
113
113
|
summary: A Kramdown converter to convert documents into prismic rich text format and
|