-
Notifications
You must be signed in to change notification settings - Fork 6
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
implement raw #35
Comments
Nope, have to implement it. |
if you guide me a little bit because I don't feel quite comfortable with Coco I could implement it :) |
@ceymard from what I saw, the I was thinking for something like that: /**
* Raw Node
*/
class NodeRaw extends NodeTagContainer
@tag = \raw
@until = \endraw
(specs) ->
super ...
compile : function (opts, ctx)
return @child_code opts, ctx Where the |
I really struggled a lot by trying to make raw node work, from what I understood the template engine compiles the template and breaks it into nodes, once this step happens then nodes take place but in case you want to have a raw node you have to change the compilation process, am I right? Is there any other easier way to have Thanks |
After lots of hours I gave up on this... I ended up altering advance: function (to_position)
res = @input.slice @position, to_position
@position = to_position
_res = res.trim()
if NodeRaw.tag is _res
@_raw_enable++
if NodeRaw.until is _res
@_raw_str = @_raw_str.substr(0, @_raw_str.length - 2)
@_raw_enable = -5
if 3 < @_raw_enable
@_raw_str += res
else if 1 <= @_raw_enable or @_raw_enable < 0
@_raw_enable++
if 4 > @_raw_enable and @_raw_enable >= -4
if 0 < @_raw_str.length
res = @_raw_str
@_raw_str = ''
switch @_raw_enable
case -3
res = '{%'
case -2
res = " #{NodeRaw.until} "
case -1
res = "%}"
return res
else
return '' So this tpl =====================
{% raw %}
{% for name in ['foo', 'bar'] -%}
Hello {{name}}!
{% endfor %}
{% endraw %}
{% if true %}Yeah!!!{% endif %} result into this:
but this: =====================
{% raw %}{% for name in ['foo', 'bar'] -%}Hello {{name}}!{% endfor %}{% endraw %}
{% if true %}Yeah!!!{% endif %} result into this:
:( |
Well, no, this is exactly it. *Christophe Eymard Aviso Legal: El contenido de este mensaje de correo electrónico, incluidos Legal Notice: The information transmitted is intended only for the person Mentions Légales: Ce message et toutes les pièces jointes sont On Mon, Jul 16, 2012 at 4:09 PM, Panagiotis Kosmidis <
|
Hi, as I see
{% raw %}
is not implemented, I tried to use angular js which uses{{ }}
as well so I realized that raw is not there :/Any workaround for that?
The text was updated successfully, but these errors were encountered: