asciidoctor-reducer 1.0.0.alpha.3 → 1.0.0.alpha.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.adoc +10 -0
- data/README.adoc +1 -1
- data/lib/asciidoctor/reducer/preprocessor_directive_tracker.rb +14 -13
- data/lib/asciidoctor/reducer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28c5a3097f098dfdcbbc424988e182c7acbab7d7c75e3c9e2db5794e029bac71
|
4
|
+
data.tar.gz: 74202ca198cc1503a1b0db4e0a2a874d767eb04928e162f3f2c5922a94e1823f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2610fb6c16abd5a154c91afc7497c268c221891bb184114afecf1d5a514dd03a738677e0faff1041d8214b2cf051bda07735d2fbe07a5b0dc6a9c3ac05275b6
|
7
|
+
data.tar.gz: 996d453168c7701e1f6f84e63fcda510d99ef6c18a7c89196edcae233114e007b525bd3ffb9b10b9c93940391ff2e9395e990562e0181051c27bacb1a7ef03c4
|
data/CHANGELOG.adoc
CHANGED
@@ -4,6 +4,12 @@
|
|
4
4
|
This document provides a high-level view of the changes to the Asciidoctor Reducer by release.
|
5
5
|
For a detailed view of what has changed, refer to the {url-repo}/commits/main[commit history] on GitHub.
|
6
6
|
|
7
|
+
== 1.0.0.alpha.4 (2022-02-03) - @mojavelinux
|
8
|
+
|
9
|
+
=== Fixed
|
10
|
+
|
11
|
+
* Fix replacement of nested empty and unresolved includes
|
12
|
+
|
7
13
|
== 1.0.0.alpha.3 (2022-02-02) - @mojavelinux
|
8
14
|
|
9
15
|
=== Changed
|
@@ -47,3 +53,7 @@ Initial release.
|
|
47
53
|
=== Details
|
48
54
|
|
49
55
|
{url-repo}/releases/tag/v1.0.0.alpha.3[git tag]
|
56
|
+
|
57
|
+
=== Details
|
58
|
+
|
59
|
+
{url-repo}/releases/tag/v1.0.0.alpha.4[git tag]
|
data/README.adoc
CHANGED
@@ -39,8 +39,10 @@ module Asciidoctor::Reducer
|
|
39
39
|
result = super
|
40
40
|
return result if @x_push_include_called
|
41
41
|
parent_depth = (parents = @x_parents).length
|
42
|
-
|
43
|
-
|
42
|
+
# depth change is guaranteed to be >= 0 under normal conditions
|
43
|
+
unless @include_stack.length < parent_depth
|
44
|
+
parents << @x_include_replacements.length.pred
|
45
|
+
parent_depth += 1
|
44
46
|
end
|
45
47
|
inc_lines = ((line = lines[0].to_s).start_with? 'Unresolved directive in ') && (line.end_with? ']') ? [line] : []
|
46
48
|
push_include_replacement inc_lines, parent_depth, inc_lineno
|
@@ -53,24 +55,23 @@ module Asciidoctor::Reducer
|
|
53
55
|
prev_inc_depth = @include_stack.length
|
54
56
|
# Q: can we do this without resetting the lineno?
|
55
57
|
lineno = 1 # rubocop:disable Lint/ShadowedArgument
|
56
|
-
super
|
58
|
+
result = super
|
57
59
|
parent_depth = (parents = @x_parents).length
|
58
60
|
# push_include did not push to the stack
|
59
61
|
if (inc_depth = @include_stack.length) == prev_inc_depth
|
60
|
-
|
61
|
-
parent_depth -= (parents.slice! parent_depth + depth_change, -depth_change).length
|
62
|
-
end
|
62
|
+
depth_change = inc_depth - (parent_depth - 1)
|
63
63
|
else
|
64
|
-
|
65
|
-
parents << @x_include_replacements.length.pred
|
66
|
-
parent_depth += 1
|
67
|
-
elsif depth_change < 0
|
68
|
-
parent_depth -= (parents.slice! parent_depth + depth_change, -depth_change).length
|
69
|
-
end
|
64
|
+
depth_change = inc_depth - parent_depth
|
70
65
|
inc_lines = lines
|
71
66
|
end
|
67
|
+
if depth_change > 0
|
68
|
+
parents << @x_include_replacements.length.pred
|
69
|
+
parent_depth += 1
|
70
|
+
elsif depth_change < 0
|
71
|
+
parent_depth -= (parents.slice! parent_depth + depth_change, -depth_change).length
|
72
|
+
end
|
72
73
|
push_include_replacement inc_lines, parent_depth, inc_lineno
|
73
|
-
|
74
|
+
result
|
74
75
|
end
|
75
76
|
|
76
77
|
def pop_include
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asciidoctor-reducer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.alpha.
|
4
|
+
version: 1.0.0.alpha.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Allen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-02-
|
11
|
+
date: 2022-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|