From 41156cce815648eebcb52143ab785b5669be796d Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Fri, 5 Aug 2022 20:29:40 -0700 Subject: [PATCH] html.templates: reverse order of style and scripts --- basis/html/templates/chloe/chloe-tests.factor | 4 ++-- basis/html/templates/templates.factor | 14 ++++++-------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/basis/html/templates/chloe/chloe-tests.factor b/basis/html/templates/chloe/chloe-tests.factor index 873f5905db..1ba5aaaa7a 100644 --- a/basis/html/templates/chloe/chloe-tests.factor +++ b/basis/html/templates/chloe/chloe-tests.factor @@ -196,13 +196,13 @@ TUPLE: person first-name last-name ; ] [ error>> tag-not-allowed-here? ] must-fail-with { "This is " } [ - SBUF" " clone style [ + V{ } clone style [ [ "test16" test-template call-template ] run-template ] with-variable ] unit-test { "" } [ - SBUF" " clone script [ + V{ } clone script [ [ "test17" test-template call-template ] run-template ] with-variable ] unit-test diff --git a/basis/html/templates/templates.factor b/basis/html/templates/templates.factor index 4ffcf8c4f0..89a9921a54 100644 --- a/basis/html/templates/templates.factor +++ b/basis/html/templates/templates.factor @@ -50,11 +50,10 @@ SYMBOL: title SYMBOL: style : add-style ( string -- ) - "\n" style get push-all - style get push-all ; + style get push ; : get-style ( -- string ) - style get >string ; + style get "\n" join ; : write-style ( -- ) get-style write ; @@ -62,11 +61,10 @@ SYMBOL: style SYMBOL: script : add-script ( string -- ) - "\n" script get push-all - script get push-all ; + script get push ; : get-script ( -- string ) - script get >string ; + script get "\n" join ; : write-script ( -- ) get-script write ; @@ -115,8 +113,8 @@ M: f call-template* drop call-next-template ; : with-boilerplate ( child master -- ) [ title [ [ ] unless* ] change - style [ [ SBUF" " clone ] unless* ] change - script [ [ SBUF" " clone ] unless* ] change + style [ [ V{ } clone ] unless* ] change + script [ [ V{ } clone ] unless* ] change meta [ [ V{ } clone ] unless* ] change atom-feeds [ V{ } like ] change -- 2.34.1