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

Escaping quotes does not work #14

Closed
4 tasks done
2manyvcos opened this issue Sep 25, 2023 · 5 comments
Closed
4 tasks done

Escaping quotes does not work #14

2manyvcos opened this issue Sep 25, 2023 · 5 comments
Labels
🙅 no/wontfix This is not (enough of) an issue for this project 👎 phase/no Post cannot or will not be acted on

Comments

@2manyvcos
Copy link

Initial checklist

Affected packages and versions

remark-directive

Link to runnable example

No response

Steps to reproduce

It is not possible to escape quotes in attribute, e.g. the following two examples do not work:

:test[content]{a="content with escaped \" quote"}
:test[content]{a='content with escaped \' quote'}

The only way to do this currently is to use ASCII codes:

:test[content]{a="content with escaped " quote"}
:test[content]{a='content with escaped ' quote'}

Expected behavior

Escape sequences should work for quotes.

Actual behavior

The directive is not parsed.

Runtime

No response

Package manager

No response

OS

No response

Build and bundle tools

No response

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Sep 25, 2023
@2manyvcos
Copy link
Author

@wooorm
Copy link
Member

wooorm commented Sep 25, 2023

This is intentional. Markdown supports character references in lots of places. It never supports C-style escapes. Therefore, it is logical to support character references and not C-style escapes here, too.

ASCII codes

That’s not what those are. Those are character references, as defined by the CM and HTML specs.

@wooorm wooorm closed this as completed Sep 25, 2023
@wooorm wooorm added the 🙅 no/wontfix This is not (enough of) an issue for this project label Sep 25, 2023
@github-actions github-actions bot added 👎 phase/no Post cannot or will not be acted on and removed 🤞 phase/open Post is being triaged manually labels Sep 25, 2023
@2manyvcos
Copy link
Author

2manyvcos commented Sep 25, 2023

Thank you for the clarification.

Even though I am a bit confused, because there is a section mentioning backslash escapes in the CommonMark spec and it is possible to escape the whole directive by adding a backslash before the colon, like described in #5 (comment).

Also, the following is valid Markdown:

[url with \] escape](test)

url with ] escape

It even is supported in the content of directives:

:test[content with \] escape]{a=test}

@wooorm
Copy link
Member

wooorm commented Sep 25, 2023

Oh that, sorry, I missed what this was about.
I modelled the attributes after how attributes work in HTML.
So also unquoted ones work.
And more character references work than solely in markdown.
This means you can copy/paste things.

@2manyvcos
Copy link
Author

Oh, I see now!
Thank you, that clarified it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙅 no/wontfix This is not (enough of) an issue for this project 👎 phase/no Post cannot or will not be acted on
Development

No branches or pull requests

2 participants