From 8296aaa6a988fad74948fb2c468983ea36220064 Mon Sep 17 00:00:00 2001 From: Michoel Samuels Date: Thu, 15 Jun 2017 02:36:52 +0300 Subject: [PATCH 1/2] Clarify unsupported multiline tag error message HAML-js does not support multi-line attribute blocks. The error message now correctly notes this. --- lib/haml.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/haml.js b/lib/haml.js index b726905..d7f4c5b 100755 --- a/lib/haml.js +++ b/lib/haml.js @@ -89,9 +89,10 @@ var Haml; for (i = 1; count > 0; i += 1) { - // If we reach the end of the line, then there is a problem + // If we reach the end of the line, then there is a problem, or the attribute block is multi-line. + // This behavior is unsupported in HAML-js if (i > l) { - throw "Malformed attribute block"; + throw "Multi-line attribute blocks are unsupported in HAML-js"; } c = line.charAt(i); From cc7ee1056f9d0635ae1aef07585971ba13c34a10 Mon Sep 17 00:00:00 2001 From: Michoel Samuels Date: Thu, 15 Jun 2017 02:41:09 +0300 Subject: [PATCH 2/2] Clarify that multi-line attribute blocks are not supported. --- README.markdown | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.markdown b/README.markdown index f16c951..4cead91 100644 --- a/README.markdown +++ b/README.markdown @@ -33,7 +33,12 @@ Here is the first example(with a little extra added) from the [haml][] site conv
Experienced software professional...
-Note that this works almost the same as ruby's [haml][], but doesn't pretty print the html. This would greatly slow down and complicate the code. If you really want pretty printed html, then I suggest writing one using the xml parser library and process the resulting html.. +Note that this works almost the same as ruby's [haml][], but doesn't pretty print the html. This would greatly slow down and complicate the code. If you really want pretty printed html, then I suggest writing one using the xml parser library and process the resulting html. + +## Differences from Ruby HAML + +* `=` and `-` interpolate JavaScript code, not Ruby +* Multi-line attribute blocks are not supported. ## API