You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
🐛 Bug: \\n -> \n should only happen with template strings #90
dedent("\\nu") should return the string unchanged.
Actual
dedent("\\nu") turns the \\n into a newline, i.e. returns a newline character + u.
Additional Info
This happens because result.replace(/\\n/g, "\n") is called regardless of the value of escapeSpecialCharacters, i.e. regardless of whether dedent is called as a tag on a template or as a function on a string.
An easy fix would be to make the replacement conditional, solving this particular problem. (However, it would still not work for dedent`\\nu` because here, still the \\n would be replaced 🤷♂️)
Activity
fix: \\n should be changed to \n only when escapeSpecialCharacters is…
github-actions commentedon Apr 11, 2024
🎉 This is included in version v1.5.2 🎉
The release is available on:
Cheers! 📦🚀