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

A stringifier option to control escaping #1168

Closed
4 tasks done
djmcgreal-cc opened this issue May 26, 2023 · 8 comments
Closed
4 tasks done

A stringifier option to control escaping #1168

djmcgreal-cc opened this issue May 26, 2023 · 8 comments
Labels
👀 no/external This makes more sense somewhere else 👎 phase/no Post cannot or will not be acted on

Comments

@djmcgreal-cc
Copy link

djmcgreal-cc commented May 26, 2023

Initial checklist

Problem

The stringifier is escaping in a way I find overzealous.

Is it for portability? I don't need portability for my case and find _SOME\_ITALICS\_WITH\_SPACES_ less readable and natural.

Solution

An option to control when things are escaped. I'd be happy with turning it off entirely but others might want more control for escaping in different scenarios.

Alternatives

Not sure?

@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 May 26, 2023
@wooorm
Copy link
Member

wooorm commented May 26, 2023

Hi!

What you want (breaking all markdown) is not possible.

There is already control in options: the Unsafe patterns.

If you want to improve how things are escaped and want to put in the work to do so, feel free to open a discussion and share your throughs on how to achieve that: https://github.com/syntax-tree/.github/blob/main/support.md

A similar discussion: syntax-tree/mdast-util-to-markdown#31

@wooorm wooorm closed this as not planned Won't fix, can't repro, duplicate, stale May 26, 2023
@wooorm wooorm added the 👀 no/external This makes more sense somewhere else label May 26, 2023
@github-actions

This comment has been minimized.

@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 May 26, 2023
@Murderlon
Copy link
Member

Murderlon commented May 26, 2023

The easiest way to get rid of them if you must is to run Prettier after remark on the files. They have custom remark logic to undo the escapes.

@djmcgreal-cc
Copy link
Author

Is it possible to use Join, Unsafe etc with a .remarkrc.yaml? Or is this only configurable from JS?

@wooorm
Copy link
Member

wooorm commented May 26, 2023

JS, and it’s all complex. See the thread I linked.

@djmcgreal-cc
Copy link
Author

Thanks for the help :)
PS I hope my small use case doesn't break all markdown, that would definitely be an unintended side-effect!

@wooorm
Copy link
Member

wooorm commented May 26, 2023

PS I hope my small use case doesn't break all markdown, that would definitely be an unintended side-effect!

It’s like asking a JavaScript formatter to emit the string " unescaped. You’d get const x = """ for example. That breaks JavaScript. Same with markdown.

@HananoshikaYomaru
Copy link

The easiest way to get rid of them if you must is to run Prettier after remark on the files. They have custom remark logic to undo the escapes.

I don't see how, can you explain?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👀 no/external This makes more sense somewhere else 👎 phase/no Post cannot or will not be acted on
Development

No branches or pull requests

4 participants