asciidoctor-html 0.1.1 → 0.1.2
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/CHANGELOG.md +4 -0
- data/lib/asciidoctor/html/ref_tree_processor.rb +9 -8
- data/lib/asciidoctor/html/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: e6e85297e79175b7368e9ae82e293c18725f6e0ad1e72ce6fe8682727ff0e886
|
4
|
+
data.tar.gz: 70cdb4172188ac661d1cc5cd321283885c9179758944f6fda1fb3cb7832b9f85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00bd98079da7bbc66b33d27d4250d03d6170c96c9ea2ba5a7ec7dbf3521478e9d52bfd0ff5eaeba7d59a0da55f12f40b3574f7bf400741616835e8281cb7fc0c
|
7
|
+
data.tar.gz: d2a60517c01ecf107a2b0bc16bafe5ee80744284a7b3a64fe040f485b7bda6f25b7c78f2e4e7a11c2ae5924670ba3a681a9b03dd7e9c561f8a8ba313836560a2
|
data/CHANGELOG.md
CHANGED
@@ -72,14 +72,17 @@ module Asciidoctor
|
|
72
72
|
list.attr?("start") ? (list.attr("start").to_i - 1) : 0
|
73
73
|
end
|
74
74
|
|
75
|
-
|
76
|
-
|
77
|
-
|
75
|
+
# Finds an anchor at the start of item.text and updates
|
76
|
+
# its reftext to that of item's if necessary.
|
77
|
+
def register_reftext!(item, reftext)
|
78
|
+
item.set_attr "reftext", reftext
|
79
|
+
/^<a id="(?<anchor_id>.+?)"/ =~ item.text
|
80
|
+
node = item.document.catalog[:refs][anchor_id]
|
81
|
+
node&.text ||= reftext
|
78
82
|
end
|
79
83
|
|
80
84
|
def process_olist!(block, depth, flat_style: false)
|
81
85
|
parent_reftext = ""
|
82
|
-
document = block.document
|
83
86
|
if depth.positive?
|
84
87
|
parent = block.parent
|
85
88
|
parent = parent.parent until parent.context == :list_item
|
@@ -95,9 +98,7 @@ module Asciidoctor
|
|
95
98
|
mark = li_mark(d, idx + offset)
|
96
99
|
item.set_attr "mark", mark
|
97
100
|
item_reftext = "#{parent_reftext}#{ref_li_mark mark, d}"
|
98
|
-
item
|
99
|
-
/^<a id="(?<id>.+?)"/ =~ item.text
|
100
|
-
register_reftext! document, id, item_reftext if id
|
101
|
+
register_reftext! item, item_reftext
|
101
102
|
end
|
102
103
|
end
|
103
104
|
end
|
@@ -105,7 +106,7 @@ module Asciidoctor
|
|
105
106
|
def process_flat_item!(item, idx)
|
106
107
|
mark = li_mark(0, idx)
|
107
108
|
item.set_attr "mark", mark
|
108
|
-
item
|
109
|
+
register_reftext! item, ref_li_mark(mark, 0)
|
109
110
|
end
|
110
111
|
|
111
112
|
def reset_counters!(document)
|