diff mbox series

[COMMITTED] Revert "docparse: Fix heading levels"

Message ID 20210512135458.12444-1-chrubis@suse.cz
State Accepted
Headers show
Series [COMMITTED] Revert "docparse: Fix heading levels" | expand

Commit Message

Cyril Hrubis May 12, 2021, 1:54 p.m. UTC
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

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
Acked-by: Petr Vorel <pvorel@suse.cz>
---
 docparse/testinfo.pl | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

Comments

Petr Vorel May 12, 2021, 3:16 p.m. UTC | #1
Hi Cyril,

> 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

> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
> Acked-by: Petr Vorel <pvorel@suse.cz>

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
diff mbox series

Patch

diff --git a/docparse/testinfo.pl b/docparse/testinfo.pl
index 8bc4623b6..857278ac8 100755
--- a/docparse/testinfo.pl
+++ b/docparse/testinfo.pl
@@ -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;