diff --git a/internal/check/variables.go b/internal/check/variables.go index d9c8a938..3bbb90a9 100755 --- a/internal/check/variables.go +++ b/internal/check/variables.go @@ -34,7 +34,7 @@ func title(s string, except *regexp2.Regexp, tc *titlecase.TitleConverter, thres words := 0.0 ps := `[\p{N}\p{L}*]+[^\s]*` - if except != nil { + if except != nil && except.String() != "" { ps = except.String() + "|" + ps } re := regexp2.MustCompileStd(ps) diff --git a/testdata/fixtures/styles/demo/test.mdx b/testdata/fixtures/styles/demo/test.mdx index 544e4f9e..e0223d74 100644 --- a/testdata/fixtures/styles/demo/test.mdx +++ b/testdata/fixtures/styles/demo/test.mdx @@ -4,7 +4,7 @@ this is not a heading. -## this is *another* heading! +## this is _another_ heading! ## this is another heading!