Skip to content

Commit ad3967a

Browse files
peffgitster
authored andcommitted
doc: fix unmatched code fences in git-stripspace
The asciidoctor renderer is more picky than classic asciidoc, and insists that the start and end of a code fence be the same size. Found with this hacky perl script: foreach my $fn (@ARGV) { open(my $fh, '<', $fn); my ($fence, $fence_lineno, $prev); while (<$fh>) { chomp; if (/^----+$/) { if ($fence_lineno) { if ($_ ne $fence) { print "$fn:$fence_lineno:mismatched fence: ", length($fence), " != ", length($_), "\n"; } $fence_lineno = undef; } # hacky check to avoid title-underlining elsif ($prev eq '' || $prev eq '+') { $fence = $_; $fence_lineno = $.; } } $prev = $_; } } Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 282616c commit ad3967a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Documentation/git-stripspace.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ EXAMPLES
4848

4949
Given the following noisy input with '$' indicating the end of a line:
5050

51-
--------
51+
---------
5252
|A brief introduction $
5353
| $
5454
|$
@@ -64,7 +64,7 @@ Given the following noisy input with '$' indicating the end of a line:
6464

6565
Use 'git stripspace' with no arguments to obtain:
6666

67-
--------
67+
---------
6868
|A brief introduction$
6969
|$
7070
|A new paragraph$
@@ -78,7 +78,7 @@ Use 'git stripspace' with no arguments to obtain:
7878

7979
Use 'git stripspace --strip-comments' to obtain:
8080

81-
--------
81+
---------
8282
|A brief introduction$
8383
|$
8484
|A new paragraph$

0 commit comments

Comments
 (0)