Skip to content
This repository has been archived by the owner on May 19, 2023. It is now read-only.

Commit

Permalink
Merge pull request #58 from rohennes/accept-repeated-number-callouts
Browse files Browse the repository at this point in the history
Allowing repeated numbers in callouts
  • Loading branch information
rohennes authored Apr 27, 2023
2 parents da19850 + 170fc99 commit 1da562f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
13 changes: 13 additions & 0 deletions .vale/fixtures/AsciiDoc/SequentialNumberedCallouts/testvalid.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,16 @@ end
<1> Library import
<2> URL mapping
<3> Response block

//vale-fixture
[source,ruby]
----
require 'sinatra' <1>
get '/hi' do <1>
"Hello World!"
end
key: value <2>
----
<1> Library import
<2> URL mapping
2 changes: 1 addition & 1 deletion .vale/styles/AsciiDoc/SequentialNumberedCallouts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ script: |
//cast string > int
num := text.atoi(trimmed)
//start counting
if num != prev_num+1 {
if num != prev_num && num != prev_num+1 {
start := text.index(scope, line)
matches = append(matches, {begin: start, end: start + len(line)})
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/SequentialNumberedCallouts.tengo
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ for line in text.split(scope, "\n") {
//cast string > int
num := text.atoi(trimmed)
//start counting
if num != prev_num+1 {
if num != prev_num && num != prev_num+1 {
start := text.index(scope, line)
matches = append(matches, {begin: start, end: start + len(line)})
}
Expand Down

0 comments on commit 1da562f

Please sign in to comment.