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

custom delimiters #41

Closed
wants to merge 1 commit into from
Closed

custom delimiters #41

wants to merge 1 commit into from

Conversation

ulanivan
Copy link

petite-vue is convenient to embed in projects with template engines, for example, smarty. But it would be more convenient to use your custom delimiters, which the template engine can parse.

@stancl
Copy link

stancl commented Jul 17, 2021

Most templating engines let you use the delimiters as raw strings. E.g. Laravel Blade uses {{ }} but @{{ foo }} is turned into raw {{ foo }}.

@niutech
Copy link

niutech commented Jul 19, 2021

E.g. Smarty has {literal} tags to escape parsing its delimiters.

@ulanivan
Copy link
Author

Thanks for the advice! I already found out about smarty and laravel :). But I thought that my addition would be useful not only in these cases.

@engram-design
Copy link

I'll add my plus one here, using Twig, its a bit of a pain, and for Vue, we often include:

delimiters: ['${', '}'],

Just because its easier to configure in Vue, than in Twig.

@Feiox
Copy link

Feiox commented Aug 16, 2021

This is very valuable for user who use template language of python or php.

@ksamuel
Copy link

ksamuel commented Sep 9, 2021

Same here, you currently can't use petite-vue with django because it would make one use verbatime everywhere in the template, which would defeat the purpose of something simple. So right now we have to stay on vue.

@yyx990803
Copy link
Member

Thanks for the PR. It's a bit inefficient to construct a new regex on every text node visit, so I moved the logic to app context creation so it's done only once per app. See eda903c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants