diff --git a/internal/lint/adoc.go b/internal/lint/adoc.go index 06579e15..971be6cd 100644 --- a/internal/lint/adoc.go +++ b/internal/lint/adoc.go @@ -25,6 +25,8 @@ var adocSanitizer = strings.NewReplacer( // Convert listing blocks of the form `[source,.+]` to `[source]` var reSource = regexp.MustCompile(`\[source,.+\]`) var reComment = regexp.MustCompile(`// .+`) +var reXref = regexp.MustCompile(`xref:([^\[]+)\[\]`) +var reShortXref = regexp.MustCompile(`<<([^>,]+)>>`) var adocArgs = []string{ "-s", @@ -64,6 +66,9 @@ func (l *Linter) lintADoc(f *core.File) error { } s = adocSanitizer.Replace(s) + s = reXref.ReplaceAllString(s, "xref:$1[$1]") + s = reShortXref.ReplaceAllString(s, "<<$1,$1>>") + html, err = callAdoc(s, exe, l.Manager.Config.Asciidoctor) if err != nil { return core.NewE100(f.Path, err)