From: John Benediktsson Date: Sat, 6 Aug 2022 03:29:40 +0000 (-0700) Subject: html.templates: reverse order of style and scripts X-Git-Tag: 0.99~1200 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=41156cce815648eebcb52143ab785b5669be796d html.templates: reverse order of style and scripts --- 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