Greenwood is your workbench for the web, embracing web standards from the ground up to empower your stack from front to back.
96
stars
9
forks
source link
implement a more idiomatic (HTML) templating solution #1133
Open
thescientist13 opened 1 year ago
Type of Change
Enhancement
Summary
Coming out of #1126 , it's clear that how Greenwood handles various aspects of its templating, primarily for HTML, is a little too naive / brittle.
For example, Greenwood uses placeholders for injecting content into an HTML template
Would get handled like this in the CLI
This issue is that
$1
is used for matching when used in conjunction with the String.replace
function.So we have to keep doing things like
This should also help us ensure that these are handled the same, just in case
Details
So rather than keep suffering through these issues...
1126
743
657
1241
Since we are already using an HTML parser, I see it supports methods like
set_content
which could a much more practical way to approach this problem.So basically any usage of
.replace
, for HTML at minimum, would be a candidate for refactoring.