From 9c5a6553182a90b4d4549f2258edc33607e30413 Mon Sep 17 00:00:00 2001 From: Kevin Butler Date: Fri, 18 Sep 2015 03:32:19 +0100 Subject: [PATCH 1/4] Enhance the Standalone Indentation test The indentation should only be applied at the start of a line. --- specs/partials.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/specs/partials.yml b/specs/partials.yml index 11b33ee..458e4f6 100644 --- a/specs/partials.yml +++ b/specs/partials.yml @@ -87,7 +87,7 @@ tests: expected: ">\n >\n >" - name: Standalone Indentation - desc: Each line of the partial should be indented before rendering. + desc: Each new line of the partial should be indented before rendering. data: { content: "<\n->" } template: | \ @@ -96,13 +96,14 @@ tests: partials: partial: | | - {{{content}}} + {{{content}}}a b{{{content}}}c | expected: | \ | < - -> + ->a b< + ->c | / From ecabc91de55bee8e286c0ae75834adcc811dce89 Mon Sep 17 00:00:00 2001 From: Ryman Date: Tue, 15 Apr 2025 13:36:11 +0000 Subject: [PATCH 2/4] Add the new per-lint indenting test as a separate example. --- specs/partials.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/specs/partials.yml b/specs/partials.yml index 458e4f6..d1cef34 100644 --- a/specs/partials.yml +++ b/specs/partials.yml @@ -87,7 +87,27 @@ tests: expected: ">\n >\n >" - name: Standalone Indentation - desc: Each new line of the partial should be indented before rendering. + desc: Each line of the partial should be indented before rendering. + data: { content: "<\n->" } + template: | + \ + {{>partial}} + / + partials: + partial: | + | + {{{content}}} + | + expected: | + \ + | + < + -> + | + / + + - name: Standalone Indentation + desc: Indentation should only be applied after each newline in a partial. data: { content: "<\n->" } template: | \ From 8a9a0e1334b23d73bd9d9ab15f46a4435edd4e86 Mon Sep 17 00:00:00 2001 From: Ryman Date: Tue, 15 Apr 2025 13:55:30 +0000 Subject: [PATCH 3/4] Adjust spec name & description --- specs/partials.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specs/partials.yml b/specs/partials.yml index d1cef34..af7de23 100644 --- a/specs/partials.yml +++ b/specs/partials.yml @@ -106,8 +106,8 @@ tests: | / - - name: Standalone Indentation - desc: Indentation should only be applied after each newline in a partial. + - name: Per line Indentation + desc: Indentation should only be applied at the start of each line. data: { content: "<\n->" } template: | \ From 54893cca1d716e214757b5f4122e46428d831aa8 Mon Sep 17 00:00:00 2001 From: Ryman Date: Tue, 15 Apr 2025 13:57:40 +0000 Subject: [PATCH 4/4] Rebuild the spec json --- specs/partials.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/specs/partials.json b/specs/partials.json index cea9a96..71aa0c8 100644 --- a/specs/partials.json +++ b/specs/partials.json @@ -137,6 +137,18 @@ }, "expected": "\\\n |\n <\n->\n |\n/\n" }, + { + "name": "Per line Indentation", + "desc": "Indentation should only be applied at the start of each line.", + "data": { + "content": "<\n->" + }, + "template": "\\\n {{>partial}}\n/\n", + "partials": { + "partial": "|\n{{{content}}}a b{{{content}}}c\n|\n" + }, + "expected": "\\\n |\n <\n->a b<\n->c\n |\n/\n" + }, { "name": "Padding Whitespace", "desc": "Superfluous in-tag whitespace should be ignored.",