Readability of lists

Several system tiddlers contain longer lists to define the classes of HTML components, i.e. from $:/core/ui/EditTemplate:

<div data-tiddler-title=<<currentTiddler>> data-tags={{!!tags}} class={{{ tc-tiddler-frame tc-tiddler-edit-frame [<currentTiddler>is[tiddler]then[tc-tiddler-exists]] [<currentTiddler>is[missing]!is[shadow]then[tc-tiddler-missing]] [<currentTiddler>is[shadow]then[tc-tiddler-exists tc-tiddler-shadow]] [<currentTiddler>is[system]then[tc-tiddler-system]] [{!!class}] [<currentTiddler>tags[]encodeuricomponent[]addprefix[tc-tagged-]] +[join[ ]] }}}>

The readability of this code would be much improved if it were possible to put each list item on a separate line:

<div 
    data-tiddler-title=<<currentTiddler>> 
    data-tags={{!!tags}} 
    class={{{ 
        tc-tiddler-frame 
        tc-tiddler-edit-frame
        [<currentTiddler>is[tiddler]then[tc-tiddler-exists]]
        [<currentTiddler>is[missing]!is[shadow]then[tc-tiddler-missing]] 
        [<currentTiddler>is[shadow]then[tc-tiddler-exists tc-tiddler-shadow]] 
        [<currentTiddler>is[system]then[tc-tiddler-system]] 
        [{!!class}] 
        [<currentTiddler>tags[]encodeuricomponent[]addprefix[tc-tagged-]] 
        +[join[ ]] 
    }}}> 
    ... 
</div>

I guess, this would only require a minor change in the parser for this list.

The just released TW 5.2.2 introduces support for line breaks in filtered transclusions used for widget attributes. So the formatting you propose is now possible.

Potentially updating the core templates will happen over time and contributions in this regard are welcome.

2 Likes

Thanks!
I just upgraded to 5.2.2. Works well!