From 96c33a5410010f4899a32db04b2ace6d064a0f2f Mon Sep 17 00:00:00 2001 From: Sebastian Tschan Date: Wed, 14 Nov 2012 14:57:51 +0100 Subject: [PATCH 001/104] Minor README update. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5f9d6e9..5f5b9bf 100644 --- a/README.md +++ b/README.md @@ -222,7 +222,7 @@ var result = tmpl("

{%=p.title%}

", {title: "JavaScript Templates"}); ### Template parsing The template contents are matched and replaced using the regular expression **tmpl.regexp** and the replacement function **tmpl.func**. The replacement function operates based on the [parenthesized submatch strings](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/replace#Specifying_a_function_as_a_parameter). -To use different tags for the template syntax, override **tmpl.regexp** with a modified regular expression, by exchanging all occurrences of "**\\{%**" and "**%\\}**", e.g. with "**\\[%**" and "**%\\]**": +To use different tags for the template syntax, override **tmpl.regexp** with a modified regular expression, by exchanging all occurrences of "{%" and "%}", e.g. with "[%" and "%]": ```js tmpl.regexp = /([\s'\\])(?![^%]*%\])|(?:\[%(=|#)([\s\S]+?)%\])|(\[%)|(%\])/g; @@ -300,7 +300,7 @@ Use **include(str, obj)** to include content from a different template: ``` -If else condition: +**If else condition**: ```html {% if (o.author.url) { %} @@ -310,7 +310,7 @@ If else condition: {% } %} ``` -For loop: +**For loop**: ```html