We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Imagine I have this template:
const doc = ` Item | Qty | Amount ${item} | ${qty} | ${amount} `
Now what if item has | or any other special symbol inside? The whole document is broken.
item
|
I imagined there would be a helper function like receiptline.escape(mytext) but there isn't one.
receiptline.escape(mytext)
The text was updated successfully, but these errors were encountered:
Something like:
export function escape(text: string) { return text.replaceAll(/[\\|{}\-=~_"`^]/g, "\\$&") }
Sorry, something went wrong.
Thanks. It worked correctly. Only one line, good!
I think some users might want to escape only some of the special characters.
It might be better to handle it in the user's program. Then your code will be helpful for everyone.
No branches or pull requests
Imagine I have this template:
Now what if
item
has|
or any other special symbol inside? The whole document is broken.I imagined there would be a helper function like
receiptline.escape(mytext)
but there isn't one.The text was updated successfully, but these errors were encountered: