From 5e3b71602fc90c5d0daf631709f5f2f64412caf3 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Sat, 9 May 2020 16:06:54 -0400 Subject: [PATCH] Seems inline partials do not bubble up to higher templates. --- js/test_cases/block_register_order/alpha.dust | 1 + js/test_cases/block_register_order/beta.dust | 2 ++ js/test_cases/block_register_order/input1.json | 4 ++++ js/test_cases/block_register_order/main.dust | 3 +++ js/test_cases/block_simple/README.md | 2 ++ 5 files changed, 12 insertions(+) create mode 100644 js/test_cases/block_register_order/alpha.dust create mode 100644 js/test_cases/block_register_order/beta.dust create mode 100644 js/test_cases/block_register_order/input1.json create mode 100644 js/test_cases/block_register_order/main.dust diff --git a/js/test_cases/block_register_order/alpha.dust b/js/test_cases/block_register_order/alpha.dust new file mode 100644 index 0000000..79b1149 --- /dev/null +++ b/js/test_cases/block_register_order/alpha.dust @@ -0,0 +1 @@ +{"alpha"/} diff --git a/js/test_cases/block_register_order/input1.json b/js/test_cases/block_register_order/input1.json new file mode 100644 index 0000000..272dfa5 --- /dev/null +++ b/js/test_cases/block_register_order/input1.json @@ -0,0 +1,4 @@ +{"people": [ + {"name": "Alice", "item": "cat"}, + {"name": "Bob"} +]} diff --git a/js/test_cases/block_register_order/main.dust b/js/test_cases/block_register_order/main.dust new file mode 100644 index 0000000..03b48c7 --- /dev/null +++ b/js/test_cases/block_register_order/main.dust @@ -0,0 +1,3 @@ +The block content is from {+inject/}{~n} +{>"beta"/} +The block content is from {+inject/}{~n} diff --git a/js/test_cases/block_simple/README.md b/js/test_cases/block_simple/README.md index 685e4ec..06be6f1 100644 --- a/js/test_cases/block_simple/README.md +++ b/js/test_cases/block_simple/README.md @@ -3,3 +3,5 @@ Blocks seem to be rendered with the last inline partial of the same name. Blocks appear to be able to be registered in a loop, however, their context is defined by the context during the call to the block `{+}` as opposed to when their override is defined by an inline partial `{<}`. Even if the surrounding dust would prevent a section from being rendered, the inline context is still registered, which makes me think inline contexts are parsed out in a single pass regardless of the context. + +Inline partials in sub-templates do not seem to bubble up to blocks in the higher templates.