Changelog
#v0.1.5
- URL attributes: when anything printed stands in a URL attribute (
href,src,srcset,action,formaction,poster,data,cite,background,ping,manifest,xlink:href, and names containingsrc,uriorurl) or astyleattribute, the whole value, with its literal text and character references decoded, must be relative or usehttp,https,mailtoortel; anything else, such asjavascript:ordata:text/html, now prints as#.srcsetis read candidate by candidate as browsers read it, and eachurl()instyleis checked. Thesrcof<img>and<source>andurl()also acceptdata:image/URLs. - Unquoted attribute values: output in an unquoted value escapes spaces, quotes,
,=,/,<and>`, so it cannot end the value. - Output where an attribute goes: the new
HTMLAttrtype is attribute markup the host vouches for (such as a filter returningloading="lazy") and prints as written; any other value, includingSafeHTML, must be one plain attribute name (not an event handler,styleor URL attribute) and otherwise prints nothing. - **
SafeHTMLinside a tag (breaking):** in an attribute value,SafeHTMLhas its tags removed and the rest escaped, as in Go'shtml/template; it prints unescaped only in the page body. Hosts that returned attribute markup asSafeHTMLmust returnHTMLAttr. - Compile errors (breaking): a template no longer compiles when it prints an element name or part of an attribute name, prints two values in a tag with no space between them, uses
renderinside a tag other than in a quoted value, ends (or ends acapture) inside a tag, or whenif/unless/casebranches, a loop body, orbreak/continueleave the markup in different places, as in Go'shtml/template. Control flow cannot split a name: text or output continuing an element or attribute name that a branch may end inside (<a {% if c %}h{% endif %}ref="…">) fails to compile, as does a loop body orbreak/continueending inside a name or a loop starting inside one. - Dates: an
Instantcompares with another date, or with an ISO 8601 string ("2026-10-01","2026-10-01T09:30:00Z"), by the moment it names, for both equality and ordering. - Host numbers and dates: a value implementing
Number(Float64andString, likejson.Number) is a number in comparisons, arithmetic and number filters and prints as itsString; a value implementingInstant(TimeandString) works with thedatefilter and compares with other dates, and prints as itsString.
#v0.1.4
- Lazy values: a
*Lazy(NewLazy) in data, settings or globals is computed the first time a render uses it, through every access path: reads, loops, output, filters, comparisons and host code arguments.Resolvecomputes theLazyvalues inside a value for host code.
#v0.1.3
- Output observation also identifies a variable printed through a single
defaultfilter when its own value, not the fallback, is printed.
#v0.1.2
- Optional host output observation identifies direct variable outputs in HTML text without changing rendered bytes. Attribute, raw-text, captured, filtered and child outputs are excluded.
#v0.1.1
- Documentation: corrected the number of built-in filters.
#v0.1.0
The first public release of Vascula.
- The template language: variables, conditions, loops and ranges, reusable templates with
render, and 50 built-in filters. - Safe output: everything a template prints is HTML-escaped.
- Explicit data: a template reads only what your application gives it, and you can list every name it reads before you use it.
- Bounded: limits on template size and rendering work.
- Clear errors with a line and column.
- A small Go library with no third-party dependencies, plus your own filters, tags and forms.