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

Feature/#37 delimiters configuration #50

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

Feature/#37 delimiters configuration #50

wants to merge 10 commits into from

Conversation

b3b00
Copy link

@b3b00 b3b00 commented Apr 19, 2019

This pull request allows to configure starting an ending tag delimiters (default "{%" and "%}" accordingly)
2 arguments have been added to the qtc compiler :

  • "sTag" for the starting tag delimiter : -sTag '{%'
  • "eTag" for the starting tag delimiter : -sTag '%}'

Delimiters mus respect following rules :

  • each delimiter must be exactly 2 characters long
  • starting delimiter's last char and ending delimiter's first char must be identical, eg
    • '[-' and '-]' are OK
    • '[-' and '%]' are not allowed
  • each delimiter cannot consist of the same char repitition, eg
    • '{%' is OK
    • '{{' is KO

These rules are for compatibility reasons with original templates parsing.

tag delimiters must be :
 - 2 characters
 - 2nd of start delimiter and 1st of end delimiter must be identical eg [% %] but not [{ }] where { <> }
@b3b00
Copy link
Author

b3b00 commented Apr 19, 2019

tested successfully with the basic server example :

  • '[%' and '%]'
  • '[-' and '-]'

@b3b00
Copy link
Author

b3b00 commented May 3, 2019

Hello @valyala , did you consider my pull-request ? I am aware that the implementation is not perfect.

@valyala
Copy link
Owner

valyala commented May 5, 2019

@b3b00 , what is the use case for custom delimiters?

Custom delimiters may fragment and complicate the experience with quicktemplate templates, since these delimiters must be supported by external tools such as IDEs and syntax highlighters.

@b3b00
Copy link
Author

b3b00 commented May 6, 2019

This PR answers issue #37 .
It 's up to you to decide whether or not it's a good idea.

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.

None yet

2 participants