Skip to content

Backslashes aren’t unescaped within PRE elements #636

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

Closed
mbostock opened this issue Jan 31, 2024 · 1 comment · Fixed by #1416 or #1441
Closed

Backslashes aren’t unescaped within PRE elements #636

mbostock opened this issue Jan 31, 2024 · 1 comment · Fixed by #1416 or #1441
Assignees
Labels
bug Something isn’t working

Comments

@mbostock
Copy link
Member

Consider the following HTML:

<pre>${test}</pre>

The ${test} is interpreted as a live expression, so if test is not defined, you’ll see an error:

RuntimeError: test is not defined

You can prevent the live expression using a backslash:

<pre>$\{test}</pre>

However, the resulting backslash is still rendered in the output, producing:

$\{test}

A workaround is to use &dollar; instead:

<pre>&dollar;{test}</pre>

This is probably something we should fix in #597.

@mbostock mbostock added the bug Something isn’t working label Jan 31, 2024
@mbostock mbostock changed the title Backslashes aren’t unescaped within pre blocks Backslashes aren’t unescaped within PRE elements Jan 31, 2024
@Fil
Copy link
Contributor

Fil commented May 22, 2024

There is also <pre>$&zwj;{test}</pre> (I know, not a very helpful comment!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn’t working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants