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

url + href verbatim arguments #70

Closed
wants to merge 2 commits into from
Closed

url + href verbatim arguments #70

wants to merge 2 commits into from

Conversation

retorquere
Copy link
Contributor

No description provided.

Copy link
Owner

@siefkenj siefkenj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add some tests for these macros?

return [
createNode("macro", { content: m }),
url,
label,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need label in here since the normal parsing should handle it just fine.

@retorquere
Copy link
Contributor Author

Could you add some tests for these macros?

Where? The unified-latex-util-pegjs package doesn't seem to have any tests.

@siefkenj
Copy link
Owner

I think this is the wrong approach, actually. It appears \url does not take a verbatim argument. Go ahead and run:

\documentclass{article}
\usepackage{hyperref}

\newcommand{\foo}{FOO}

\begin{document}

\foo

\url{hi~there\foo}

\end{document}

and observe that \foo gets expanded.

@retorquere
Copy link
Contributor Author

You're right... but then I don't know what kind of environment they are, because \url{#} compiles without an error to show an #.

@siefkenj
Copy link
Owner

\url redefines the control codes of several characters so they parse as regular strings. But, I don't understand the issue. You shouldn't be getting any errors when parsing with unified-latex.

@retorquere
Copy link
Contributor Author

I'm still working my way through understanding how unified-latex hangs together, sorry -- I opened this issue based on my reading of the code, and I didn't test properly.

@retorquere retorquere closed this Jan 28, 2024
@retorquere
Copy link
Contributor Author

\url redefines the control codes of several characters so they parse as regular strings

But this should then still be accomodated. How do I go about this?

@siefkenj
Copy link
Owner

If you want the URL as a string, you can call toString(...) on the argument.

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 this pull request may close these issues.

2 participants