coradoc-adoc 2.0.25 → 2.0.26

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: 4ecb988af13f918e49f0249e3691e22fd98f21beffd3f0e2d6c98affc39d64dc
4
- data.tar.gz: 4db6ab5b2227364c2092f00b40167fa054ed1dd43592150baf1c745e39f98a09
3
+ metadata.gz: 6d381a7e511028e9caa79826eccd74e14694968a18825cd179d28cbd785928c7
4
+ data.tar.gz: 0646f6bf33b86848c345fa772e23583def67169f01ae9b9a905ec0f8fa1922c7
5
5
  SHA512:
6
- metadata.gz: 26ea9aeac36925a4ce0df0221ffba1e0c5ba41fc33de0b8c0937229e353f2f758e101a873e0eab76ed46408fe71990c0001088612ecef50c0f3a22fba17646db
7
- data.tar.gz: 2a7a709b48e9c0764c12b5a54be0846ecd08551245e92dd6028deb881c1ebff634514445a72cf28d24a6e31a5bdd90b12c6519e523e440977a7bfe9f767949a5
6
+ metadata.gz: 86b395057b440b17616f1743a4d4e72f8c9cffb21b344019b695233c81445450bfd2e17bfc77cb0e706d1284267c4e399680d1174818ebae709570c485c5d435
7
+ data.tar.gz: 25d8a142605cd3fe9df0dbd191c1004f4d9450ba79614a7b660cd629ef7c8673045143d4b5ed9fd7c0cdf25385d94ec615c2d2591479f41c228abe1fa16c77aa
@@ -71,7 +71,7 @@ module Coradoc
71
71
 
72
72
  def monospace_constrained
73
73
  (str('`') >>
74
- match('[^`\n]').repeat(1).as(:text).repeat(1, 1) >>
74
+ constrained_span_content('`').as(:text).repeat(1, 1) >>
75
75
  str('`') >> str('`').absent?
76
76
  ).as(:monospace_constrained)
77
77
  end
@@ -236,6 +236,27 @@ module Coradoc
236
236
  ).repeat(1)
237
237
  end
238
238
 
239
+ # Content model for a constrained inline span (`` `…` ``, `*…*`,
240
+ # `_…_`, `#…#`). Allows the corresponding unconstrained marker
241
+ # pair (`` `` ``, `**`, `__`, `##`) to appear inside the content
242
+ # rather than terminating the span at the first marker character.
243
+ #
244
+ # Asciidoctor treats the contents of a constrained span as an
245
+ # inline literal — nested constrained markers do not close the
246
+ # span. Without this allowance, `` `<<\`\`x\`\`>>` `` fails to
247
+ # match as a single monospace span: the parser sees the inner
248
+ # `` `` `` as a failed single-backtick close attempt, backtracks
249
+ # out of `monospace_constrained`, and the `<<…>>` payload then
250
+ # fires the `cross_reference` rule with the backticks glued
251
+ # onto the target.
252
+ #
253
+ # Single source of truth for every constrained rule's content
254
+ # model — adding a new constrained marker reuses this helper
255
+ # rather than re-spelling the alternation (DRY).
256
+ def constrained_span_content(marker)
257
+ (match("[^#{marker}\n]") | str(marker * 2)).repeat(1)
258
+ end
259
+
239
260
  def text_formatted
240
261
  (inline_chars? >> inline)
241
262
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Coradoc
4
4
  module AsciiDoc
5
- VERSION = '2.0.25'
5
+ VERSION = '2.0.26'
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.25
4
+ version: 2.0.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.