Code inside of comments is evaluated if within opening and closing tags
paulyoung opened this issue · comments
Paul Young commented
I'm attempting to document some functions using Codo and my example code within comments is being evaluated.
The following is the beginning of a file called _partials/helpers.html
which is a partial that I include elsewhere.
{{
# Create an alias.
#
# @example Create a selector alias for a single element.
#
# <!-- template.html -->
# {{ sectionId = @createAlias 'section' }}
# <section id="{{-sectionId}}"></section>
This causes the following: Fatal error: sectionId is not defined in helpers on line 8
This is just one example that could be generalized in a test as:
{{
# {{- foo }}
}}
Paul Young commented
Obviously, I'm using {{
and }}
for opening and closing tags.
Paul Young commented
My current workaround is this:
{{
# Create an alias.
#
# @example Create a selector alias for a single element.
#
# <!-- template.html -->
# <% sectionId = @createAlias 'section' %>
# <section id="<%- sectionId %>"></section>