metanorma-plugin-lutaml 0.7.68 → 0.7.69
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 66af39979d425315f2ec0df8901ccf17f691a53cc44d9fce6b2c47c9427f7cc9
|
|
4
|
+
data.tar.gz: ff163a8fbaa6cd3ab5362ff6173e6e5715108ed7a56f682318a8ac71d4099bb5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fd8695ec9568498511ad984a9ae1ba0972f4bc8ba7f4cbe50b44edf7378b5e85d8f6cd25f00553c2a08de146a5a3ab70074500013ea848c5988ca45ba22391e0
|
|
7
|
+
data.tar.gz: fb753e85f753de969e1b8568c3a792a1c4f541a6df11900680a431e35d9dcdb964be7a779a1f92eeae86bc097249a97f4362bba89a7dc2671300f09c34bae125
|
|
@@ -24,6 +24,11 @@ module Metanorma
|
|
|
24
24
|
# only when the preceding line is a list item.
|
|
25
25
|
LONE_CONTINUATION_REGEXP = /^\+[[:space:]]*$/
|
|
26
26
|
|
|
27
|
+
# A `+` glued to a macro line's trailing `[]` (no whitespace): the
|
|
28
|
+
# form asciidoctor renders as literal text in every context.
|
|
29
|
+
GLUED_CONTINUATION_REGEXP = %r{
|
|
30
|
+
^(?:link|image|video|audio|include):: .+ \[\][+][[:space:]]*$
|
|
31
|
+
}x
|
|
27
32
|
LIST_ITEM_REGEXP = %r{
|
|
28
33
|
^(?:[-*]|\d+[.)]|[A-Za-z][.)])\s # bullets and enumerations
|
|
29
34
|
| \w[[:alnum:] _-]*::\s # definition lists
|
|
@@ -48,6 +53,7 @@ module Metanorma
|
|
|
48
53
|
|
|
49
54
|
def call
|
|
50
55
|
result = normalise_dangling_continuations(remark)
|
|
56
|
+
result = normalise_glued_continuations(result)
|
|
51
57
|
if options["relative_path_prefix"]
|
|
52
58
|
result = update_relative_paths(result,
|
|
53
59
|
options["relative_path_prefix"])
|
|
@@ -57,6 +63,21 @@ module Metanorma
|
|
|
57
63
|
|
|
58
64
|
private
|
|
59
65
|
|
|
66
|
+
# A `+` GLUED to a macro's closing bracket (`image::x.gif[]+`) is
|
|
67
|
+
# parsed by asciidoctor as literal text in EVERY context — list
|
|
68
|
+
# item or paragraph (TRThurman's trial, iso-10303#862: the
|
|
69
|
+
# kinematic_structure_schema `direction_vectors` continuation) —
|
|
70
|
+
# so it never performs the attachment the author wrote it for.
|
|
71
|
+
# Strip it: the macro renders as its block, and any intended
|
|
72
|
+
# continuation of the following text stays with the following
|
|
73
|
+
# text.
|
|
74
|
+
def normalise_glued_continuations(string)
|
|
75
|
+
strip = lambda do |line|
|
|
76
|
+
line.match?(GLUED_CONTINUATION_REGEXP) ? line[..-2] : line
|
|
77
|
+
end
|
|
78
|
+
string.split("\n").map(&strip).join("\n")
|
|
79
|
+
end
|
|
80
|
+
|
|
60
81
|
# A lone `+` is asciidoctor's list-item continuation: it attaches
|
|
61
82
|
# the next block only when the preceding line is a list item.
|
|
62
83
|
# Authored after plain paragraphs (the corpus's `term - definition`
|