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

--remove-macros not working on macros with multiline parameter. #253

Open
Britaliope opened this issue Dec 12, 2023 · 0 comments
Open

--remove-macros not working on macros with multiline parameter. #253

Britaliope opened this issue Dec 12, 2023 · 0 comments

Comments

@Britaliope
Copy link

Britaliope commented Dec 12, 2023

Hello and thank you for this great tool !

I found an issue on the macro ignore rules:

\foo{some ramdom stuff i don't want language check on} % correctly ignored by --remove-macros foo

\foo{some way way way longer random stuff that happen to
become multiline but i still don't wan language check on it} % not ignored by --remove-macros foo

textidote version: 0.8.3

I tried some workarounds by defining replace files with stuff looking like this: 

#replacements.txt

\\foo\{[\s\S]*?\} ->  # \s\S should include every line breaks, but this don't work

\\foo\{(.|\R)*?\} -> # \R should match with every unicode newline but this didn't work either

I also tried various regexes that should include every line return but nothing worked. Note that everything i tried still worked on single-line macros, only multiline macros were not matched. Maybe somewere in the code the strings are matched line by line ? I looked at the source code quickly but nothing suggesting this stood out to me, but i'm not a java expert.

I wonder if this is a limitation of ca.uqac.lif.petitpoucet.function.strings.Replace. I tried to read the source code but again nothing in particular stood out.

I'll comment on the issue if i have time to investigate more and find some nice clues.

@Britaliope Britaliope changed the title --remove-macros not working on macros with multiline parameter. --remove-macros not working on macros with multiline parameter. Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant