Close item 156: a JSON string stays a template beside the bare text it holds, for its escapes

This commit is contained in:
2026-10-07 22:04:31 +02:00
committed by Lillem4n
parent 3e932d5e5f
commit 27608a5b22
2 changed files with 4 additions and 7 deletions
+4 -2
View File
@@ -67,8 +67,10 @@ so. Reserving the characters whole — though only a leading one
could collide — keeps one simple name rule instead of a leading-position special case.
The JSON string is what makes the library's own advice reachable: the error for an
object holding only a format names `"…"`, and that spelling has to work where it is
printed. A struct tag of one reference alone, `{/users}`, is refused naming the path
`users`: both render the same text, and only the path names a record. A folder-relative
printed. On stdin and in `NewTemplate`, `"x {/a}"` and `x {/a}` render alike, and the
maintainer kept the JSON string on 2026-10-07, so goal 5.7 does not refuse it: its escapes,
`\t` and `\n`, carry what bare text cannot. A struct tag of one reference alone,
`{/users}`, is refused naming the path `users`: both render the same text, and only the path names a record. A folder-relative
`{.name}` or `{..name}` is refused naming `{/name}`, since an inline template sits in no
folder. `IsTemplate` exports the rule, so struct tags and any other caller read one.