Skip to content

Conversation

kt3k
Copy link
Contributor

@kt3k kt3k commented May 20, 2025

closes #713

This PR updates the handling of template literals with embedded langauges.

This change unescape \\ sequence before applying external formatters, and escape it back after it.

Some css classes needs to use \ to escape it in css level, and that becomes \\ in template literals. The use of \\ causes syntax error in css formatter (malva, See g-plane/malva#35 ). This change avoids that error.

Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. LGTM

@dsherret dsherret merged commit 903d7f1 into dprint:main May 21, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Need to unescape escape sequences before passing text to embedded formatter
2 participants