Skip to contentSkip to conversation

Revert "docparse: Fix heading levels"

PATCH New Cyril Hrubis 2 participants 2 messages May 12, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "docparse: Fix heading levels"

This reverts commit 04a7608fe4f7fe2c267216d8b90acf019bdea824.

Fixes build with asciidoc that otherwise failed with:

...
asciidoc: ERROR: filters.txt: line 4: only book doctypes can contain level 0 sections
...
asciidoc: ERROR: all-tests.txt: line 4: only book doctypes can contain level 0 sections

---
 docparse/testinfo.pl | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
docparse/testinfo.pl +9 -3
index 8bc4623b6..857278ac8 100755
@@ -87,6 +87,11 @@ sub code
 	return "+$_[0]+";
 }
 
+sub hr
+{
+	return "\n\n'''\n\n";
+}
+
 sub html_a
 {
 	my ($url, $text) = @_;
@@ -99,17 +104,17 @@ sub html_a
 
 sub h1
 {
-	return "= $_[0]\n";
+	return "== $_[0]\n";
 }
 
 sub h2
 {
-	return "== $_[0]\n";
+	return "=== $_[0]\n";
 }
 
 sub h3
 {
-	return "=== $_[0]\n";
+	return "==== $_[0]\n";
 }
 
 sub label
@@ -350,6 +355,7 @@ sub content_all_tests
 			$printed = $letter;
 		}
 
+		$content .= hr() if (defined($tmp));
 		$content .= label($name);
 		$content .= h3($name);
 		$content .= $letters;
Signature · 1 line
2.26.3
#1 lore raw

PATCH 1/1 Revert "docparse: Fix heading levels"

Hi Cyril,

Quoted 11 lines

This reverts commit 04a7608fe4f7fe2c267216d8b90acf019bdea824.

Fixes build with asciidoc that otherwise failed with:

...
asciidoc: ERROR: filters.txt: line 4: only book doctypes can contain level 0 sections
...
asciidoc: ERROR: all-tests.txt: line 4: only book doctypes can contain level 0 sections

I'm sorry for breaking the build, thanks for fixing it!
That was actually the reason why I used shifted level, but I didn't remember. Thus I'll send a patch today for enhanced docparse testing.

Kind regards,
Petr