kramdown-rfc2629 1.7.9 → 1.7.11

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: 19205d36d58adcb319445d107550e706df01dec57b2b11ae8d83bcf98ba0f692
4
- data.tar.gz: afb2233b556ee2e8906a39726f9e974784bd3cf48f294b1c492dcc257e545fc9
3
+ metadata.gz: 65eafab5401726cc8bc76b674b42e783436d603b4c3b5080ba0d374f953905f8
4
+ data.tar.gz: 64dd363a024b30944017274f1e2765e145e6596af7e337627189019e22f4c9ed
5
5
  SHA512:
6
- metadata.gz: ab0627eb9f1484f16fa7a3ef6653f2289c6b7e569ba13a2e4b9de00e961e981558ebd2ef06e6dda4f504c04fbab65f4427575ac5f1c5afbebcee27af17366ebd
7
- data.tar.gz: ff634b58a990bad533c3e47a72fc428c1a61e8976aa87e2cdab977bc896ac7400aadbd17ef2c005c3bf0665f93c92a044e54ae6c25b6049949b4b314b7fb9adf
6
+ metadata.gz: 0dd35229efeddba497fdc091b262f2f90e200b798f873b42394dd65dd037ea1c4d2620aaa6740c59f32e8e5ba65eb3f352f58a56e4e89121fb1d6159aec76386
7
+ data.tar.gz: 1789e1772da25692d7f9e7706d537927e4e09ec03cba97037f12bdd6b9fbf8caebc848cb0ddac292da42b02aa1321d54ee7b94176b17272ff08aa23163aeef41
@@ -1,6 +1,6 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
  s.name = 'kramdown-rfc2629'
3
- s.version = '1.7.9'
3
+ s.version = '1.7.11'
4
4
  s.summary = "Kramdown extension for generating RFCXML (RFC 799x)."
5
5
  s.description = %{An RFCXML (RFC 799x) generating backend for Thomas Leitner's
6
6
  "kramdown" markdown parser. Mostly useful for RFC writers.}
@@ -33,6 +33,15 @@ end
33
33
 
34
34
  module Kramdown
35
35
 
36
+ Kramdown::Options.define(:ol_start_at_first_marker, Kramdown::Options::Boolean, false, <<~EOF)
37
+ If this option is `true`, an ordered list (<ol) will use the
38
+ number in its first marker (1 for 1. etc.) as the default value
39
+ of the start= attribute.
40
+
41
+ Default: false (for backward compatibility)
42
+ Used by: RFCXML converter
43
+ EOF
44
+
36
45
  Kramdown::Options.define(:nested_ol_types, Object, %w[1], <<~EOF) do |val|
37
46
  Values for type= attribute for nested ordered lists (ol).
38
47
  The value needs to be an array of <ol type= values, expressed as one of:
@@ -388,6 +397,10 @@ module Kramdown
388
397
  def convert(el)
389
398
  opts = el.options[:options]
390
399
  # warn "** tree opts #{opts.inspect}"
400
+ if nested_ol_types = @options[:nested_ol_types]
401
+ opts[:nested_ol_types] ||= nested_ol_types
402
+ # warn "** tree opts out #{opts.inspect}"
403
+ end
391
404
  indent = -INDENTATION
392
405
  if el.children[-1].type == :raw
393
406
  raw = convert1(el.children.pop, indent, opts)
@@ -915,6 +928,10 @@ COLORS
915
928
  end
916
929
 
917
930
  def convert_ol(el, indent, opts)
931
+ if @options[:ol_start_at_first_marker] and (first_list_marker =
932
+ el.options[:first_list_marker])
933
+ el.attr['start'] ||= first_list_marker[/\d+/]
934
+ end
918
935
  nested_types = opts[:nested_ol_types] || ["1"]
919
936
  # warn "** ol opts #{opts.inspect} types #{nested_types.inspect}"
920
937
  if nested_attr = el.attr.delete('nestedOlTypes')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kramdown-rfc2629
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.9
4
+ version: 1.7.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carsten Bormann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-20 00:00:00.000000000 Z
11
+ date: 2024-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kramdown