Is it possible to remove duplicate wikitext code when showing both codeblocks and the result of rendering them?

Found another rough edge:

\procedure definitions()
\function list3() 1 2 3 4 5 6 7 8 9 10 +[format:titlelist[]join[ ]]
\end list3
\end definitions

<$transclude
    $tiddler="CodeTemplate"
    definitions=<<definitions>>
    demoCode="""<<list3>>
"""

this renders as:

\end list31 2 3 4 5 6 7 8 9 10

If I don’t use the optional name of the function in the \end marker, as in:

\procedure definitions()
\function list3() 1 2 3 4 5 6 7 8 9 10 +[format:titlelist[]join[ ]]
\end
\end definitions

then the rendered content is just

1 2 3 4 5 6 7 8 9 10

which is correct. No it is not :frowning: While it produces the expected output for this code snippet, apparently it breaks the parser and further wikitext markup after the transclude widget is rendered the wrong way.

PS: I hope multiple posts highlighting you by name are not disturbing. I’m just posting as I keep refactoring my knowledge base wiki and hit these edge cases.