[pve-devel] [PATCH docs] do not require 5 chars for headers

Dominik Csapak d.csapak at proxmox.com
Wed Nov 2 12:55:34 CET 2016


this patch changes the parses so that it detects headings with at least
3 characters instead of 5 (this prevented some block ids to not have a
subchapter e.g. pct CPU)

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 scan-adoc-refs | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/scan-adoc-refs b/scan-adoc-refs
index 1ac1f90..732bc34 100755
--- a/scan-adoc-refs
+++ b/scan-adoc-refs
@@ -161,16 +161,16 @@ sub scan_adoc_file {
 
 	# try to detect titles
 	foreach my $e (@{$env_stack->[-1]}) {
-	    if ($line =~ m/^=====+$/) {
+	    if ($line =~ m/^===+$/) {
 		register_title($filename, $e, 0, $env_last_line->{$e},
 			       $env_last_blockid->{$e});
-	    } elsif ($line =~ m/^-----+$/) {
+	    } elsif ($line =~ m/^---+$/) {
 		register_title($filename, $e, 1, $env_last_line->{$e},
 			       $env_last_blockid->{$e});
-	    } elsif ($line =~ m/^~~~~~+$/) {
+	    } elsif ($line =~ m/^~~~+$/) {
 		register_title($filename, $e, 2, $env_last_line->{$e},
 			       $env_last_blockid->{$e});
-	    } elsif ($line =~ m/^\^\^\^\^\^+$/) {
+	    } elsif ($line =~ m/^\^\^\^+$/) {
 		register_title($filename, $e, 3, $env_last_line->{$e},
 			       $env_last_blockid->{$e});
 	    } elsif ($line =~ m/^= +(\S.*?)( +=)?$/) {
-- 
2.1.4





More information about the pve-devel mailing list