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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b7a99099eccb44fd82519a9894193733e143af6fbe445a88db2f805cb44fd58d
4
- data.tar.gz: 68f3628a12418f3b49db676257266100c54a8a5962e88c5a5dd38bae7ac33ec5
3
+ metadata.gz: 76a75c9530dc6b9336112a445b9fc4cd811e17059e4677c2094c1b22b585fa06
4
+ data.tar.gz: 77315988401b9fc306026b3d6a1b9d184b2a92a579fddd2871ba27dbc4000292
5
5
  SHA512:
6
- metadata.gz: 6c98ec156b50ac771e18415a770068c2a84911d34fe2b2fe083c7eab4a3f0e311d0aad0a71ed625e4a4d85da49fb6f9cb612f317a2a87814dbca93505cb2a977
7
- data.tar.gz: 65f6a3250e46ec0e6d256fa42cebd6feb5036ca4564ee5d3ff172bf911a7b520119451fec8bde608108f57d79850b3a7a7619adc29a4119b61553ba91d59d08a
6
+ metadata.gz: 576fc16369c963b6a1215e834dd72e88231177773cd2e62cfba973f4ae59288a508965db55759b214aebab1a0239c0b8d067b9e4a95a861ef7be6c002b3434d3
7
+ data.tar.gz: c6cd045fa16db194a3f6e3e78fc8cf2c86029e68e8a3b6194140c4f9c08f9db12f92ce0c1abd9b4ef391fc57112a34daac0166b6f5e14378178f7ab852466431
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## Version 0.3.9
4
+
5
+ - Convert the target attribute on links
6
+
3
7
  ## Version 0.3.8
4
8
 
5
9
  - Convert nested html_elements when converting from HTML.
data/Gemfile.lock CHANGED
@@ -1,13 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kramdown-prismic (0.3.8)
4
+ kramdown-prismic (0.3.9)
5
5
  kramdown (>= 1, < 3)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- kramdown (2.3.2)
10
+ kramdown (2.4.0)
11
11
  rexml
12
12
  minitest (5.10.3)
13
13
  rake (13.0.6)
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module KramdownPrismic
4
- VERSION = '0.3.8'
4
+ VERSION = '0.3.9'
5
5
  end
@@ -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.8
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-04-20 00:00:00.000000000 Z
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.0.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