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

[Unexpected Behavior] Comments Not Removed on Lines with "auto-ignore" #93

Closed
merajhashemi opened this issue Mar 9, 2024 · 3 comments · Fixed by #96
Closed

[Unexpected Behavior] Comments Not Removed on Lines with "auto-ignore" #93

merajhashemi opened this issue Mar 9, 2024 · 3 comments · Fixed by #96

Comments

@merajhashemi
Copy link
Contributor

While fixing issue #91, I discovered that comments in lines containing the word auto-ignore are not being removed as expected. This behavior is not documented in either the README or the help message, which may lead to unexpected outcomes for users.
I suppose there is a specific reason for this behavior as it is also being tested 🤔

Example

Input:

Foo auto-ignore Bar ... % Top Secret Comment

Output:

Foo auto-ignore Bar ... % Top Secret Comment

Expected Output:

Foo auto-ignore Bar ... %
@jponttuset
Copy link
Collaborator

Hi @merajhashemi!
The rationale for this behavior is that arXiv uses this %auto-ignore comment to mark a file as not being the main tex file to be compiled. You can see more info here. We could definitely make the content matching more strict (e.g. there cannot be more text apart from "auto-ignore"), feel free to send a PR if you're up for it :)

merajhashemi added a commit to merajhashemi/arxiv-latex-cleaner that referenced this issue Mar 25, 2024
@merajhashemi
Copy link
Contributor Author

Hi @jponttuset!
Thanks for letting me know about this! I didn't realize arXiv uses the %auto-ignore comment in that way. I've opened a pull request (#96) to tighten the content matching.

@jponttuset
Copy link
Collaborator

I made a small suggestion in the PR not to over-tighten the matching :)

jponttuset pushed a commit that referenced this issue Mar 26, 2024
* Fix issue #93

* Add tests

* Allow for white space and remove comments after `auto-ignore`

* Update test
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

Successfully merging a pull request may close this issue.

2 participants