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

Optional macro arguments may cause false positive #141

Closed
bratekarate opened this issue Sep 19, 2020 · 2 comments
Closed

Optional macro arguments may cause false positive #141

bratekarate opened this issue Sep 19, 2020 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@bratekarate
Copy link
Contributor

Bug Description

For some macros (only observed with \parencite so far), optional arguments in brackets cause false positives in the LanguageTool checks. Example:

\parencite{source} yields no errors.
\parencite[p. 12-24]{source} yields:

--(L8C704-L8C713): Possible spelling mistake found. Suggestions: [parents, parent, precise, parasite, parentage, parenting, recite, Prentice, Principe, parented, parricide, partite, perennate, martensite, pargasite, potentite, variscite] (729)

... I like the parasite suggestion though. They should add that macro to latex :)

Temporary workaround

Use command line argument (or config file) --remove-macros parencite (thanks for adding this flag, great for such cases!)

@sylvainhalle
Copy link
Owner

The culprit is

as_out = as_out.replaceAll("\\\\\\w+\\*{0,1}\\{", "");
, which should be changed to handle the case where square brackets are present before the curly brackets.

@sylvainhalle sylvainhalle added the bug Something isn't working label Sep 21, 2020
@sylvainhalle sylvainhalle added this to the v0.8.2 milestone Sep 21, 2020
@sylvainhalle
Copy link
Owner

As a matter of fact, parencite should be handled like other cite commands, so the fix is not where I said it should be

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants