Skip to content

Commit

Permalink
fix template addslashes for code
Browse files Browse the repository at this point in the history
  • Loading branch information
chzyer committed Mar 6, 2012
1 parent e44f9a7 commit 11146ea
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion example/cache/index_tpl.j
Expand Up @@ -6,7 +6,7 @@ body = """
"""
for i=1:10
body = strcat(body, """
<a href=\"javascript:;\">$(i)</a>
<a href=\"javascript:;\">$(i)d</a>
""")
end
if 1==2
Expand Down
Binary file added example/favicon.ico
Binary file not shown.
6 changes: 4 additions & 2 deletions example/tpl/index.html
Expand Up @@ -3,7 +3,7 @@

{% block body %}
{% for i=1:10 %}
<a href="javascript:;">{{ i }}</a>
<a href="javascript:;">{{ i }}d</a>
{% end %}
thisisbody
{% if 1==2 %}
Expand All @@ -18,4 +18,6 @@
1 != 2<br>
salflkjsadlfkjasdf
{% end %}
{% end %}
<img src="http://img2.douban.com/pics/fw2douban_s.png" alt="推荐到豆瓣" />
{% end %}

2 changes: 1 addition & 1 deletion julia_webserver_template.j
Expand Up @@ -76,7 +76,7 @@ function create_extend_template(match_extend, content)
method = match_command.captures[1]
if last_block_start > 0
write_data = strcat(write_data, content[last_block_start: current_index - 2], quot, "\n")
write_data = strcat(write_data, addslashes(content[last_block_start: current_index - 2]), quot, "\n")
last_block_start = -1
end
Expand Down

0 comments on commit 11146ea

Please sign in to comment.