In T401901, we found that VueJsTemplating\HtmlParser::parseHtml (source in github) takes a string value and wraps it in a <p> *only if* it does not start with an html tag. This causes inconsistency in the final rendered HTML for statements, and has caused us to add some stylistic hacks in CSS/LESS to get <a> and <p> tags to behave similarly in their spacing and relationship to other elements.
For example, an entity type snak value looks like this:
<div class="wikibase-wbui2025-snak-value" data-snak-hash="cd2c5132f5528b694b71575ae6a56587185893d0"> <a title="Item:Q52" href="/wiki/Item:Q52">Entity Label</a> </div>
and a string datatype looks like this:
<div class="wikibase-wbui2025-snak-value" data-snak-hash="1a4dc5949ca21bec92999952a7204995d21d35f2"> <p>some simple text ends up in a paragraph</p> </div>
We should update php-vuejs-templating to stop wrapping *some* values in <p> tags, so that we get predictable and consistent html. In other words, we should get html in the exact structure that was given to the parser.
Acceptance Criteria
- statements of all* datatypes are rendered according to the output of the relevant formatter and are not wrapped in a <p>.
*except the Globe Coordinates type, which gets its problematic <p> from the parser in core, and gets its html transformed into an even less valid state via Kartographer's frontend code (T401606)