HTML canvas element missing

We just upgraded from XWiki Enterprise 7.4.4 to XWiki 9.11.4. On testing some of our apps I came across a problem. On one of our pages we are using an HTML canvas element to draw some graphics. The code works fine on 7.4.4 however, on 9.11.4 the line that has the canvas element appears to be stripped out when XWiki renders the page.

Here is a section of the source code taken from the editor:

{{html}}
<form id="ImageTest" method="post" enctype="multipart/form-data">
<div class="container">
  <div class = "buttons">
    <select name="pressType">
      <option value="">Select Press …</option>
      <option value="hy32">HY 32</option>
      <option value="hy25">HY 25</option>
      <option value="hy20">HY 20</option>
      <option value="hy15">HY 15</option>
    </select>

    <button style="margin-bottom: 1em;" type="button" onclick = "saveP()">Save Diagram</button>
    <button style="margin-bottom: 1em;" type="button" onclick = "clearP()">Clear Pins</button>
    <button style="margin-bottom: 1em;" type="button" onclick = "cancelP()">Cancel</button>
  </div>

  <canvas id="myCanvas" onclick = "getPin(event)" width="600" height="600"></canvas>

    <script>
        var canvas = document.getElementById('myCanvas');
        setWC(canvas);

Here is the page source when viewed from debug:

<form enctype="multipart/form-data" id="ImageTest" method="post">
<div class="container">
<div class="buttons">
<select name="pressType">
<option value="">Select Press …</option>
<option value="hy32">HY 32</option>
<option value="hy25">HY 25</option>
<option value="hy20">HY 20</option>
<option value="hy15">HY 15</option>
</select>

<button onclick="saveP()" style="margin-bottom: 1em;" type="button">Save Diagram</button>
<button onclick="clearP()" style="margin-bottom: 1em;" type="button">Clear Pins</button>
<button onclick="cancelP()" style="margin-bottom: 1em;" type="button">Cancel</button>
</div>

<script>//<![CDATA[

var canvas = document.getElementById('myCanvas');
setWC(canvas);

I have tried accessing the page in both Chrome and Firefox with the same result.

Any help would be greatly appreciated.

Thanks,
Steve

The HTML macro performs cleaning by default (see the clean parameter) so it may be the case that the canvas element is cleaned (some change in the HTML cleaner between 7.4.4 and 9.11.4 maybe). In any case, when you’re sure about your HTML it’s better to use clean=“false” so that whatever you put in the HTML macro stays as is.

Thank you, setting clean=“false” fixed the problem.

–Steve