dmnd / dedent

⬅️ ES6 string tag that strips indentation from multi-line strings.
MIT License
931 stars 36 forks source link

🚀 Feature: Add an option to disable special character escaping #63

Closed JoshuaKGoldberg closed 1 year ago

JoshuaKGoldberg commented 1 year ago

This pulls together #2, #26, #45, #46:

I think the "right" (or: least unexpected) way would be to add an option with a not-very-savory name like escapeSpecialCharacters. The option would default to:

Proposal:

Thoughts @G-Rath @sirian?

G-Rath commented 1 year ago

Personally I would be considered about having different behaviour depending on how its called given you can do:

dedent(`my string`)

which cannot be detected as a template literal

G-Rath commented 1 year ago

Actually having thought about it a bit more, I think that default actually makes sense in reflection of the use-case: