Skip to content

Commit dc4c479

Browse files
committed
fix: adjust comment offset
Signed-off-by: Joseph Kato <joseph@jdkato.io> #992
1 parent a219fa2 commit dc4c479

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

internal/lint/adoc.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@ func (l *Linter) lintADoc(f *core.File) error {
8484
// TODO: Multiple line comments are not handled correctly.
8585
//
8686
// https://docs.asciidoctor.org/asciidoc/latest/comments/
87-
parts := strings.Split(m, "//")
88-
span := strings.Repeat("*", nlp.StrLen(parts[1])-1)
87+
span := strings.Repeat("*", nlp.StrLen(strings.TrimPrefix(m, "// ")))
8988
return "// " + span
9089
})
9190

testdata/features/misc.feature

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ Feature: Misc
4444
test.adoc:7:1:Markup.ID:Use 'leader' rather than 'Master'.
4545
test.adoc:12:1:Markup.ID:Use 'leader' rather than 'master'.
4646
test.adoc:14:55:Markup.ID:Use 'leader' rather than 'master'.
47+
test2.adoc:5:26:Markup.ID:Use 'leader' rather than 'master'.
48+
test2.adoc:5:146:Markup.ID:Use 'leader' rather than 'master'.
4749
"""
4850

4951
Scenario: Unicode
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// //
2+
= Test topic
3+
4+
A little endian system stores data in memory ordered least-significant byte first and most-significant byte last, opposite to the behavior of a big-endian system.
5+
The advantage to running master processors in little endian mode is that it makes it simpler for programmers to port applications from x86_64 to master.

0 commit comments

Comments
 (0)