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 +4 -4
- data/lib/coradoc/asciidoc/parser/inline.rb +22 -1
- data/lib/coradoc/asciidoc/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6d381a7e511028e9caa79826eccd74e14694968a18825cd179d28cbd785928c7
|
|
4
|
+
data.tar.gz: 0646f6bf33b86848c345fa772e23583def67169f01ae9b9a905ec0f8fa1922c7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
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
|