Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using capitalization style on heading with commas #235

Closed
wilhelmer opened this issue Sep 22, 2020 · 1 comment
Closed

Error when using capitalization style on heading with commas #235

wilhelmer opened this issue Sep 22, 2020 · 1 comment

Comments

@wilhelmer
Copy link

Vale version: 2.4.0

Using the following style ...

extends: capitalization
message: "'%s' should be in title case."
level: error
scope: heading
match: $title
style: Chicago
exceptions:
  - foo
  - bar
  - lorem
  - ipsum

... on this Markdown file ...

# foo, bar, and lorem Are Best Friends

Dummy text.

... results in the following error:

panic: runtime error: index out of range [7] with length 7

goroutine 80 [running]:
github.com/errata-ai/vale/check.title(0xc0011fe150, 0x22, 0xc000050840, 0x6, 0x6, 0xc000408700, 0xc00006a0f0, 0xc0011a3810)
	/home/travis/gopath/src/github.com/errata-ai/vale/check/variables.go:39 +0x31c
github.com/errata-ai/vale/check.(*Manager).addCapitalizationCheck.func1(0xc0011fe150, 0x22, 0xc000050840, 0x6, 0x6, 0xc000408700, 0xffffffffffffffff)
	/home/travis/gopath/src/github.com/errata-ai/vale/check/check.go:524 +0x6d
github.com/errata-ai/vale/check.checkCapitalization(0xc0011fe150, 0x22, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/home/travis/gopath/src/github.com/errata-ai/vale/check/check.go:393 +0x93
github.com/errata-ai/vale/check.(*Manager).addCapitalizationCheck.func4(0xc0011fe150, 0x22, 0xc0011ec000, 0x1208b60, 0x0, 0x0)
	/home/travis/gopath/src/github.com/errata-ai/vale/check/check.go:542 +0xc2
github.com/errata-ai/vale/lint.(*Linter).lintText.func1(0xc000026780, 0xc000c0cc80, 0xc0011fe150, 0x22, 0xc0003e68a0, 0x10, 0xc0011ec000, 0x0, 0xc0003e69c0, 0xe, ...)
	/home/travis/gopath/src/github.com/errata-ai/vale/lint/lint.go:303 +0x6c
created by github.com/errata-ai/vale/lint.(*Linter).lintText
	/home/travis/gopath/src/github.com/errata-ai/vale/lint/lint.go:302 +0x385

It's probably caused by the comma after "foo" and "bar". Without the comma, it works fine:

# foo and bar and lorem Are Best Friends

Dummy text.
@jdkato
Copy link
Member

jdkato commented Sep 28, 2020

Thanks for the report.

This is a bug in an upstream library, but it will be fixed in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants