google-research / arxiv-latex-cleaner

arXiv LaTeX Cleaner: Easily clean the LaTeX code of your paper to submit to arXiv
Apache License 2.0
5.23k stars 327 forks source link

Fixed issue #82: % inside of url link is not treated as comment #87

Closed dylduhamel closed 8 months ago

dylduhamel commented 8 months ago

This change resolves issue #82 by separating text into segments and not treating any % inside of \url{} as a comment.

jponttuset commented 8 months ago

Thanks @dylduhamel !

jponttuset commented 8 months ago

Hi @dylduhamel I had to revert your changes because they were breaking the test. Could you please revise so that the tests keep passing? Thanks!

dylduhamel commented 8 months ago

Hi @jponttuset One of the tests failing expects a % symbol to remain when removing %Comment from a line of LaTeX code

{
          'testcase_name': 'comment_inline',
          'line_in': 'Foo %Comment\n',
          'true_output': 'Foo %\n',
 },

Is there a reason to keep the %? My fix for issue #82 would strip that line of the inline comment. Thank you!

jponttuset commented 8 months ago

Yes, removing the comment symbol might change the compiled result in some cases IIRC. That's why we leave it there. Even if it's not 100% needed, I don't want to change the behavior at this stage, since it's been like this for long and no one has complained.

dylduhamel commented 8 months ago

That makes sense. I will keep it as it is.