Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
rebuild parser and add escape pragma example
  • Loading branch information
akdubya committed Jan 26, 2011
1 parent bb309c2 commit 42840ae
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 12 deletions.
48 changes: 36 additions & 12 deletions lib/parser.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions test/examples.js
Expand Up @@ -86,6 +86,12 @@ exports.dustExamples = [
context: { safe: "<script>alert('Hello!')</script>", unsafe: "<script>alert('Goodbye!')</script>" },
expected: "<script>alert('Hello!')</script>\n&lt;script&gt;alert('Goodbye!')&lt;/script&gt;"
},
{
name: "escape_pragma",
source: "{%esc:s}\n {unsafe}{~n}\n {%esc:h}\n {unsafe}\n {/esc}\n{/esc}",
context: { unsafe: "<script>alert('Goodbye!')</script>" },
expected: "<script>alert('Goodbye!')</script>\n&lt;script&gt;alert('Goodbye!')&lt;/script&gt;"
},
{
name: "else_block",
source: "{#foo}\n" +
Expand Down

0 comments on commit 42840ae

Please sign in to comment.