From 0ca9970b58a4716b0c29ab56e4e757d90300dd42 Mon Sep 17 00:00:00 2001 From: Tyler Akins Date: Fri, 21 Apr 2017 09:37:16 -0500 Subject: [PATCH] Fixing multi-line partials --- demo/indented-partial | 15 +++++++++++++++ demo/partial | 1 + tests/multi-line-partial.env | 1 + tests/multi-line-partial.expected | 9 +++++++++ tests/multi-line-partial.partial | 1 + tests/multi-line-partial.template | 7 +++++++ 6 files changed, 34 insertions(+) create mode 100755 demo/indented-partial create mode 100644 demo/partial create mode 100644 tests/multi-line-partial.env create mode 100644 tests/multi-line-partial.expected create mode 100644 tests/multi-line-partial.partial create mode 100644 tests/multi-line-partial.template diff --git a/demo/indented-partial b/demo/indented-partial new file mode 100755 index 0000000..78073f3 --- /dev/null +++ b/demo/indented-partial @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +export data=$'line 1\nline 2' + +cat < partial}} + +And here's the same partial with a 4-space indent: + + {{> partial}} + +:-) +EOF diff --git a/demo/partial b/demo/partial new file mode 100644 index 0000000..367d1bb --- /dev/null +++ b/demo/partial @@ -0,0 +1 @@ +{{data}} diff --git a/tests/multi-line-partial.env b/tests/multi-line-partial.env new file mode 100644 index 0000000..3a1b584 --- /dev/null +++ b/tests/multi-line-partial.env @@ -0,0 +1 @@ +multilineData=$'line 1\nline2' diff --git a/tests/multi-line-partial.expected b/tests/multi-line-partial.expected new file mode 100644 index 0000000..bb6b84b --- /dev/null +++ b/tests/multi-line-partial.expected @@ -0,0 +1,9 @@ +Partial: + +line 1 +line 2 + +Indented: + + line 1 + line 2 diff --git a/tests/multi-line-partial.partial b/tests/multi-line-partial.partial new file mode 100644 index 0000000..da32746 --- /dev/null +++ b/tests/multi-line-partial.partial @@ -0,0 +1 @@ +{{multilineData}} diff --git a/tests/multi-line-partial.template b/tests/multi-line-partial.template new file mode 100644 index 0000000..1fad7a6 --- /dev/null +++ b/tests/multi-line-partial.template @@ -0,0 +1,7 @@ +Partial: + +{{> multi-line-partial.partial}} + +Indented: + + {{> multi-line-partial.partial}}