xemlock / php-latex

LaTeX parser and renderer written in PHP
https://packagist.org/packages/xemlock/php-latex
MIT License
41 stars 6 forks source link

Percent and ampersand signs in \href #9

Open larsgw opened 1 year ago

larsgw commented 1 year ago

Description

I think that URLs passed to the \href command do not need to escape % and & in actual LaTeX. However, this parser seems to interpret % as the start of a comment.

Possible Solution

Allow for verbatim command arguments, possibly. Not sure what the API for that would be. Or can comments still be rendered back to LaTeX?

Additional Context

I can add more information later if necessary.

larsgw commented 1 year ago

Nevermind, there's parseArgs. I think that covers it.

xemlock commented 1 year ago

Hi @larsgw, Thanks for bringing that to my attention. At the moment of creating the issue it was not possible to handle % character in \href{} (and \url{}) in a special way (other than it being a part of the comment).

I've already made some adjustments to the lexer and parser to make this possible.

Let's leave this issue open, until I finish working on fixing it.