Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Development:
Notes:
,
as in an accent). The parent gets no special wrapping behavior, at each child is treated as its own wrappable unit.Technical details:
html.tag('chunkwrap', {split: ','})
, this PR also introduces a new utilityhtml.smush()
. Smushing is a simple recursive operation which provides a nice, even, not-bumpy layer of top-level texts and tags. It takes hierarchies of content-only tags nested directly under other content-only tags, such as produced bylanguage.formatString
or any call tohtml.tags([...])
, and evens them out into a single continuous layer. Any adjacent bits of text, including opposite boundaries ofhtml.tags([])
containing text as well as tags, are combined into single strings, so they can be conveniently operated on.contentOnly
, but never tags which are not. Smush doesn't care at all about what's going on inside a normal element; it only wants to smooth a run of apparently top-level tags and apparently top-level texts into one layer of actually top-level tags and texts.html.tags([])
which directly nests more templates, those will also be resolved, but only until everything at the top layer is a sequence of tags and texts.[html.joinChildren]
attribute at each layer. This means it applies the appropriate joiner wherever stringifying would; each parent applies its joiner to between own children, not between the children that each recursively smushed child will actually be represented as.