You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Comment text from {% comment %} and {% # .. %} tags is currently not included in a template's abstract syntax tree.
The translation message extractor under development in the Liquid Babel project needs access to comment text when building message catalogues. Therefore, we need the option to store comments in CommentNode objects for later static analysis.
Non-standard shorthand comment syntax gets stripped out by the lexer. For now, we'll say shorthand comments are not supported by the translation message extractor.
The text was updated successfully, but these errors were encountered:
I've decided to call this a bug, which has been fixed in version 1.4.4.
The default behaviour is now to keep comment text in a template's AST. If anyone needs to save a bit of memory by excluding comment text, you can register liquid.builting.tags.comment_tag.CommentTag with a liquid.Environment, then load and render templates from that environment.
fromliquidimportEnvironmentfromliquid.builting.tags.comment_tagimportCommentTag# This will override the default `CommentTextTag` with one that discards comment text.env=Environment()
env.add_tag(CommentTag)
template=env.from_string("{% comment %}hello{% endcomment %}")
Comment text from
{% comment %}
and{% # .. %}
tags is currently not included in a template's abstract syntax tree.The translation message extractor under development in the Liquid Babel project needs access to comment text when building message catalogues. Therefore, we need the option to store comments in
CommentNode
objects for later static analysis.Non-standard shorthand comment syntax gets stripped out by the lexer. For now, we'll say shorthand comments are not supported by the translation message extractor.
The text was updated successfully, but these errors were encountered: