coradoc-adoc 2.0.34 → 2.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bc2b5c2f53fa18844c9b33a2083b07e6f4a4fab8eac18ca2e3f0cc6211f5f4c7
4
- data.tar.gz: 8b0d84abd2eef737e536e63811279e2520134d9f23860667dfcd2167855521f9
3
+ metadata.gz: 66bedce9cc1cf693cd81c4115ea71c4e6e14c7884edd342eaaa41d4d148910dd
4
+ data.tar.gz: 4c9f6bce16946b3974be7e7f41cec00963ac8c86e92efe6735d44b532d6c17b6
5
5
  SHA512:
6
- metadata.gz: 5e016f7d12d34b9dc307583120f436f4ab6742fbfec161cbb9b006a72efc373a2413fcc12010b2f395cbacb2586bf9096528a0c0a028cf934a5b4a543aa7ad6f
7
- data.tar.gz: ca1cf91e5acca757738b3f39907376777f870b0e4a203fc746b96653b3dec58ab87d7ea2bbb5f7a8a266ed19c7010e6d5e98d8e9fd4623f68802bd34d0993bf3
6
+ metadata.gz: 5eea4b4d5af74432117a5d53af089ca6c6ce2bd8d4f4ca4e57be0e09500d0a30b1b74b52332a0faafa7a18e5751732f89e6098c05cf13763e52e682f4e3fcbdb
7
+ data.tar.gz: 4c0d093e8dc45981b1c8872686597b88b04582e972a66661ad831659b59a06f32948d5a1f0277e53de6f6d4aefb9747428c4a187f8df1ba64b38df77f2118e03
@@ -19,7 +19,12 @@ module Coradoc
19
19
 
20
20
  def document_attribute
21
21
  str(':') >> attribute_name.as(:key) >> str(':') >>
22
- space? >> (attribute_value | str('')).as(:value) >> (line_ending | eof?)
22
+ # attribute_value itself already matches empty (its
23
+ # zero-width branch), so the former `| str('')` fallback was
24
+ # dead — ordered choice commits to attribute_value's empty
25
+ # match first — and the VM's shadowed-alternative lint
26
+ # (parsanol 1.3.55+) correctly rejects it.
27
+ space? >> attribute_value.as(:value) >> (line_ending | eof?)
23
28
  end
24
29
  end
25
30
  end
@@ -138,7 +138,7 @@ module Coradoc
138
138
  end
139
139
 
140
140
  def link
141
- ((str('http').present? | str('https').present? | str('ftp').present?) >>
141
+ ((str('http') | str('https') | str('ftp')).present? >>
142
142
  match('[A-Za-z0-9_.\\-:/&?=+,%#~;]+').repeat(1).as(:path) >>
143
143
  (str('[') >> match('[^\\]]').repeat(1).as(:text) >> str(']')).maybe
144
144
  ).as(:link) |
@@ -201,19 +201,22 @@ module Coradoc
201
201
  end
202
202
 
203
203
  def inline_chars?
204
- match('[\[*#_{<^~`]').present? |
205
- typographic_quote.present? |
206
- str('http').present? |
207
- str('https').present? |
208
- str('link:').present? |
209
- str('image:').present? |
210
- str('+++').present? |
211
- str('pass:').present? |
212
- term_type.present? |
213
- str('footnote').present? |
214
- stem_type.present? |
215
- str('\\<<').present? |
216
- hard_line_break_marker?
204
+ # Single lookahead over the whole dispatch alternation; the former
205
+ # per-branch .present? chain put zero-width branches in every
206
+ # non-last slot (shadowed-alternative lint, parsanol 1.3.55+).
207
+ (match('[\[*#_{<^~`]') |
208
+ typographic_quote |
209
+ str('http') |
210
+ str('https') |
211
+ str('link:') |
212
+ str('image:') |
213
+ str('+++') |
214
+ str('pass:') |
215
+ term_type |
216
+ str('footnote') |
217
+ stem_type |
218
+ str('\\<<') |
219
+ hard_line_break_marker?).present?
217
220
  end
218
221
 
219
222
  # AsciiDoc hard line break: a space followed by `+` at end of line,
@@ -221,8 +224,8 @@ module Coradoc
221
224
  # the enclosing paragraph/verse. Recognised ahead of `text_unformatted`
222
225
  # so the marker isn't swallowed as plain text.
223
226
  def hard_line_break_marker?
224
- (str(' +') >> str("\n")).present? |
225
- (str('\\') >> str("\n")).present?
227
+ ((str(' +') >> str("\n")) |
228
+ (str('\\') >> str("\n"))).present?
226
229
  end
227
230
 
228
231
  def hard_line_break
@@ -7,10 +7,10 @@ module Coradoc
7
7
  module List
8
8
  def list(nesting_level = 1)
9
9
  (
10
- unordered_list(nesting_level) |
11
- ordered_list(nesting_level) |
12
- definition_list
13
- ).as(:list)
10
+ unordered_list(nesting_level) |
11
+ ordered_list(nesting_level) |
12
+ definition_list
13
+ ).as(:list)
14
14
  end
15
15
 
16
16
  def list_continuation
@@ -259,8 +259,8 @@ module Coradoc
259
259
  end
260
260
 
261
261
  def list_body_hard_break_marker?
262
- (str(' +') >> str("\n")).present? |
263
- (str('\\') >> str("\n")).present?
262
+ ((str(' +') >> str("\n")) |
263
+ (str('\\') >> str("\n"))).present?
264
264
  end
265
265
 
266
266
  # Recognizes line endings for a list body source line, including
@@ -49,7 +49,9 @@ module Coradoc
49
49
  (paragraph_text_line(true).repeat(1, 1) >>
50
50
  (newline.repeat(1).as(:line_break) | eof?)).repeat(0, 1))
51
51
  ).as(:lines) >>
52
- (newline.repeat(0) | eof?)
52
+ # the former "| eof?" was dead: newline.repeat(0) already
53
+ # matches empty (shadowed-alternative lint, parsanol 1.3.55+)
54
+ newline.repeat(0)
53
55
  ).as(:paragraph)
54
56
  end
55
57
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Coradoc
4
4
  module AsciiDoc
5
- VERSION = '2.0.34'
5
+ VERSION = '2.0.35'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coradoc-adoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.34
4
+ version: 2.0.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.