**Update:** This problem still occurs on Cargo 3.3.1, MW 1.39.1 (PHP 8.0.12, cgi-fcgi, MySQL 8.0.28-0ubuntu0.20.04.3) with //all extensions except Cargo disabled--problem is not related to ConfirmEdit extension//.
**What happens?**:
Cargo **[[ https://www.mediawiki.org/wiki/Extension:Cargo/Querying_data | query ]]** HTML, that is created by setting **[[ https://www.mediawiki.org/wiki/Extension:Cargo/Display_formats#template | display format ]]** `|format=template`, shows as escaped on-page when saved. The escaped HTML can be fixed by purging the page; however, the issue remains for **PageForms** extensions, whose queries of Cargo queries `|format=template` remain permanently broken (displaying **always** as escaped HTML) because these can't be purged. We use PageForms queries to create form-controlled inputs to cargo queries, with custom, per-row table formatting of output (which cargo `|format=template` and `template=` provides).
I found **[[ https://www.mediawiki.org/wiki/Extension_talk:Cargo/Archive_March_to_May_2018#Cargo_Query_showing_escaped_HTML_tags_when_page_is_saved | this ]]** old cargo issue report and **[[ https://www.mediawiki.org/wiki/Extension_talk:Cargo/Archive_October_to_December_2017#Links/images_sometimes_displaying_as_plaintext | this ]]** one, suggesting incompatibility between **Cargo** and the **ConfirmEdit** extension, packaged with MediaWiki. Update: This problem still occurs on Cargo 3.3.1, MW 1.39.1 (PHP 8.0.12, cgi-fcgi, MySQL 8.0.28-0ubuntu0.20.04.3) with //all extensions except Cargo disabled--problem is not related to ConfirmEdit extension.
**What should have happened instead?**:
Pages should have rendered HTML, not escaped HTML, for cargo queries on page save, and in PageForms queries.
**Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc**:
**old version occurred on**:
|MediaWiki|1.36.2 (`d17f10c`)|
|PHP|7.3.31-1~deb10u1 (fpm-fcgi)|
|MariaDB|10.4.21-MariaDB-1:10.4.21+maria~buster-log|
**Cargo: 2.8** (`19b7b42`)
**New version still occurring on**:
|MediaWiki|1.37.2 (`75e0d3b`)|
|PHP|7.4.28 (fpm-fcgi)|
|MariaDB|10.5.15-MariaDB-1:10.5.15+maria~bullseye-log|
**Cargo: 3.2 (`0f06913`)**
I've since disabled Cargo on my Miraheze wiki, and privated my wiki. This can be reproduced on multiple versions of MediaWiki from 1.35-1.37 on the Miraheze wikis currently using Cargo.
**Steps to reproduce on a site with an existing Cargo table, that already has pages populating the table:**
1. Create page entitled **Cargo_Query** (change "MyTable" in the code below to an existing Cargo table name, and change "type" to an existing parameter for the same table/template).
```
{{#cargo_query:table=MyTable
|fields=_pageTitle=Title, type
|named args=yes
|format=template
|template=FormatRow
|limit=10
|delimiter=\n
|default=No items to display
|more results text=
}}
```
2. Create **Template:FormatRow** (making sure to change "Existing File.png" in the example below to the name of a file that exists on-wiki):
```
<noinclude><pre>This is a per-line cargo result formatting template</pre>
</noinclude>
<includeonly>
[[{{{Title}}}|{{{Title}}}]]
{{{type|}}}
[[File: Name.png|100px]]
</includeonly>
```
3. Go back to the **Cargo_Query** you just created, edit and make a change (even just adding <!-- note --> is fine, preview to see intended results, then save the page to see resulting, escaped HTML on-page, purging will render as expected.
**To see that this also causes the same (unfixable/unpurgable) issue in PageForms queries**, with PageForms enabled try viewing `Special:RunQuery/<form name>` on any form whose corresponding template has `|format=template` and `|template=RowTemplate` set, and where "RowTemplate" has images in the output.
I don't see this listed on the known issues page for either PageForms or Cargo, and as the previous reports were significantly aged, this is to confirm the issue remains with Cargo and MediaWiki 1.36.2, 1.37.1 packaged extensions (possibly ConfirmEdit).