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

Support template delimiters #47

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

parnic
Copy link

@parnic parnic commented Jul 17, 2022

This adds support for custom delimiters in multitemplate. It only works currently for AddFromStrings and AddFromFiles, primarily because it's easy for anyone to simply use .Delims() themselves on the returned template if it's not a template made up of other templates. But if there is desire to make this broader-reaching, I could update it.

Note that my preferred way of doing this would have been to add the options to, for example, NewRenderer(), but since Renderer and DynamicRenderer are just type aliases for maps, that would have broken existing code since anyone relying on those types to still be maps would be out of luck (especially since this project doesn't use go module versioning).

I also have not yet updated the examples, readme, tests, etc. with this new feature. If this PR is desired, I can do all that work, but for now this gave me what I needed for my project to use custom delimiters with multitemplate.

Fixes #24

@switch-coders
Copy link

@parnic I need this feature for support custom delimiters and avoid trouble with other js libraries :)

@parnic
Copy link
Author

parnic commented Nov 23, 2022

@parnic I need this feature for support custom delimiters and avoid trouble with other js libraries :)

Have at it.

@fanshengshuai
Copy link

Hope to merge into the master branch earlier. ^_^

@parnic parnic changed the title Draft: Support template delimiters Support template delimiters May 5, 2024
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.

Doesn't respect Delims
3 participants