Skip to content

Commit

Permalink
fix: don't concatenate an empty regex
Browse files Browse the repository at this point in the history
  • Loading branch information
jdkato committed Aug 28, 2023
1 parent ea43b41 commit c87ac4b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/check/variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion testdata/fixtures/styles/demo/test.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

this is not a heading.

## this is *another* heading!
## this is _another_ heading!

## this is another heading!

Expand Down

0 comments on commit c87ac4b

Please sign in to comment.