Permalink
Browse files

doc typos

  • Loading branch information...
1 parent 5576da3 commit 391c4b85c4c10d303df7175911d7f60af697513f @aaronblohowiak aaronblohowiak committed Jun 18, 2011
Showing with 25 additions and 6 deletions.
  1. +1 −1 CHANGELOG.markdown
  2. +2 −2 README.markdown
  3. 0 lib/cli.js
  4. +20 −3 lib/haml.js
  5. +2 −0 test.haml
View
@@ -1,6 +1,6 @@
# HAML-JS Changelog
-- **v0.4.9**
+- **v0.4.0**
Breaking Changes:
Made interpolation #{} escaped by default. Use !{} for unsafe interpolation.
View
@@ -294,9 +294,9 @@ This compiles to the following HTML:
By default, Haml(src) returns a completely self-sufficient function, including a nested `html_escape` function. However, repeating the html_escape function definition in each of your templates is going to use more size than necessary. So, you may pass the name of a custom escaper in an optional config variable.
- Haml(src, {customEscaper: "MyApp.esc"})
+ Haml(src, {customEscape: "MyApp.esc"})
-Then, the output template function definition will call `MyApp.esc(string)` and will omit the `html_escape` function definition. Haml.html_escape exposes the default escape function. If you are going to render your templates in the same context where you compile them (for instance, if you are only rendering them on the server side,) it might make sense to use `Haml(src, {customEscaper: "Haml.html_escape"})`
+Then, the output template function definition will call `MyApp.esc(string)` and will omit the `html_escape` function definition. Haml.html_escape exposes the default escape function. If you are going to render your templates in the same context where you compile them (for instance, if you are only rendering them on the server side,) it might make sense to use `Haml(src, {customEscape: "Haml.html_escape"})`
## Get Involved
View
0 lib/cli.js 100644 → 100755
No changes.
View
@@ -1,4 +1,5 @@
-var Haml;
+var Haml,
+ sys = require("sys");
(function () {
@@ -340,14 +341,24 @@ var Haml;
// raw js
{
- name: "raw",
+ name: "rawjs",
regexp: /^(\s*)-\s*(.*)\s*$/i,
process: function () {
this.contents.unshift(this.matches[2]);
return '"";' + this.contents.join("\n")+"; _$output = _$output ";
}
},
+ // raw js
+ {
+ name: "pre",
+ regexp: /^(\s*):pre(\s+(.*)|$)/i,
+ process: function () {
+ this.contents.unshift(this.matches[2]);
+ return '"<pre>"+\n' + JSON.stringify(this.contents.join("\n"))+'+\n"</pre>"';
+ }
+ },
+
// declarations
{
name: "doctype",
@@ -619,7 +630,13 @@ var Haml;
" }\n" +
"}"
- return new Function("locals", escaper + str );
+ try{
+ var f = new Function("locals", escaper + str );
+ return f;
+ }catch(e){
+ sys.error(str);
+ throw e;
+ }
}
Haml.compile = compile;
View
@@ -0,0 +1,2 @@
+.class1
+.class2#testid

0 comments on commit 391c4b8

Please sign in to comment.