Commit ffb15e0 1 parent b98d458 commit ffb15e0 Copy full SHA for ffb15e0
File tree 1 file changed +15
-3
lines changed
1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change 27
27
my $otlpSpecVers = $versions {' otlp:' };
28
28
my $semconvVers = $versions {' semconv:' };
29
29
my %patchMsgCount ;
30
+ my $lineNum ;
30
31
31
32
sub printTitleAndFrontMatter () {
32
33
print " ---\n " ;
114
115
getVersFromRepo();
115
116
116
117
while (<>) {
117
- # printf STDOUT "$ARGV Got: $_" if $gD;
118
+ $lineNum ++;
119
+ # printf STDOUT "$ARGV Got:$lineNum: $_" if $gD;
118
120
119
121
if ($file ne $ARGV ) {
120
122
$file = $ARGV ;
121
123
$frontMatterFromFile = ' ' ;
122
124
$title = ' ' ;
125
+ $lineNum = 1;
123
126
if (/ ^<!---? Hugo/ ) {
124
127
while (<>) {
128
+ $lineNum ++;
125
129
last if / ^-?-->/ ;
126
130
patchAttrNaming(); # TEMPORARY patch
127
131
$frontMatterFromFile .= $_ ;
137
141
}
138
142
139
143
if (/ <details>/ ) {
140
- while (<>) { last if / <\/ details>/ ; }
144
+ while (<>) { $lineNum ++; last if / <\/ details>/ ; }
141
145
next ;
142
146
}
143
147
if (/ <!-- toc -->/ ) {
144
- while (<>) { last if / <!-- tocstop -->/ ; }
148
+ my $tocstop = ' <!-- tocstop -->' ;
149
+ while (<>) {
150
+ $lineNum ++;
151
+ last if / $tocstop / ;
152
+ next if / ^\s *([-\+\* ]\s |$) / ;
153
+ warn " WARN $ARGV :$lineNum : missing '$tocstop ' directive? Aborting toc scan at line:\n $lineNum : $_ " ;
154
+ print ;
155
+ last ;
156
+ }
145
157
next ;
146
158
}
147
159
You can’t perform that action at this time.
0 commit comments