Issue with genesis-widget and missing "on"-prefixed parameter

Works:

<$genesis $type=my-element $names="uno two three four" $values="1 2 3 4">Test 1</$genesis>

Fails:

<$genesis $type=my-element $names="one two three four" $values="1 2 3 4">Test 2</$genesis>

Comments?

Can confirm: Demos — Q&A and tools for tiddlywiki

This is very weird … it seems like it happens on attributes beginning with “on”.

Here’s a workaround :

<$genesis $type="div" $names="[[ one]] two three" $values="1 2 3">Content</$genesis>

It’s probably a sanitation problem. … HTML parameters that are prefixed “on” like “onclick” are removed for security reasons.

@jeremyruston We’ll probably need to document this behaviour. Or we output a message instead of a “faulty” html tag.

1 Like

Of course.

:man_facepalming:

The removal of attributes starting with on is actually done at a lower level within the internal <$element> widget. It is what prevents <div onclick="..."> from being rendered.

Nonetheless, of course it would be helpful if the behaviour were documented both under “HTML in WikiText” and in the genesis widget documentation.

Allowing the element widget to display error messages would complicate it quite a bit. I think perhaps we need a general purpose high level mechanism for reporting parsing/rendering issues.

I did create a PR at GitHub: Improve docs for genesis-widget by pmario · Pull Request #7174 · Jermolene/TiddlyWiki5 · GitHub

1 Like

Here’s the proposed addition to the docs. See the last paragraph.

https://tiddlywiki5-git-fork-pmario-improve-docs-for-g-0d5af6-jermolene.vercel.app/#GenesisWidget

1 Like