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

Future Request: Format the escape character #192

Open
Yarakashi-Kikohshi opened this issue Dec 8, 2021 · 1 comment
Open

Future Request: Format the escape character #192

Yarakashi-Kikohshi opened this issue Dec 8, 2021 · 1 comment

Comments

@Yarakashi-Kikohshi
Copy link

Format the escape character

Markdown has some escape characters.

It's not a complete list, but it looks like this:

* _ \ ` # + - | { } [ ] ( )

I need to escape these when writing the page title in Markdown.
Escaping these manually is very cumbersome and should be formatted when copying.

Some considerations

It may be necessary to note that [ ~ ] becomes \[ ~ \] when escaped, and MathJax may recognize it as a formula in some cases.
It may be useful to leave the escape character to the user.

Additional request

This is a rare case so I'm not sure if the extension should support it, but some titles contain HTML tags.

e.g. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/article

Copy result:

[<article>: The Article Contents element - HTML: HyperText Markup Language | MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/article)

In this case, the HTML tag needs to be escaped with ` as inline-code.
I'm very happy if this is also formatted.

It's very useful extension, thank you.

@crosstyan
Copy link

crosstyan commented Dec 13, 2021

I'll consider this as edge case, although this can be solved like how we prevent XSS attack -- just sanitize/purify the title (convert these special character to HTML character codes)

I'll try to implement this feature in my fork if I have time.

See also:

crosstyan added a commit to crosstyan/copy-title-and-url-as-markdown that referenced this issue Dec 13, 2021
crosstyan added a commit to crosstyan/copy-title-and-url-as-markdown that referenced this issue Dec 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants