JTML Dev Log: Raw Update June 9, 2026
Two new JTML updates brings it to production ready until it's not anymore :)
I've been using JTML to build a new project. There were two significant updates. The first one being scrubbing the input in a way that is simple.
Given a file like this
<div>
child of div
<span>
child of span
</span>
</div>
There is inconsistent spacing. The way the parsing works is it uses the indents to determine the children, but when unindenting, used to determine the correct parent. So inconsistent indentation is bad. I mean, if you really give it a horrible input, you will get horrible output. But I wanted to be able to handle some minor input anomalies. In the end, just one additional space is needed to designate hierarchy, so I would normalize it to that. If it's indented based on the previous line at all, it will be normalized to be just one extra space than the previous line.
The first attempt at this was to keep a map of each number of indents and what they were indented to. So if I indented a 4 indented line to 2, each 4 indented line will now get 2 indents instead. This was ok but just wasn't simple to read.
Instead, now, I just take a list of all indents, sort the list, then use the index to apply the indentation. It's basically the same idea but simple.
Indent list could be like [0, 8, 4, 12, 20] and then on normalization it sorts it to [0, 4, 8, 12, 20] and any line with 4 indents gets 1 indent (index 1 in 0 based array), up to 20 indents getting 4 indents. Just easier.
The other update was in the way raws are handled. And not having hierarchy. This fixed an issue where you could have an include inside a bunch of raw values, and it wasn't processing the include.
I think now it's at the point where I won't be touching it for a while. Well, until I find that I need named parameters and conditions on parameters. But there are ways around absolutely needing that. These updates were absolutely needed though! :)
Happy coding!