Skip to content

Allow HTML in table messages #408

@bubbletroubles

Description

@bubbletroubles

Describe the bug
When using simple-datatables (latest), the HTML is shown in the table, but not actually rendered
Changing it to use v5, the problem goes away (e.g. in the jsfiddle examples above, the spinner is shown for 10 seconds in the working one. In the broken one, it dispalys <div class="spinner-border" role="status"> <span class="visually-hidden">Loading...</span> </div>

To Reproduce

Steps to reproduce the behavior:

  1. Create code as per the jsfiddle request which uses dataTable.setMessage
  2. Configure the code as per the sample code block below
  3. Use the CDN files with latest version
  4. The HTML is written, but not rendered
  5. Update the CDN files to pin to version 5
  6. The HTML is rendered
    dataTable.setMessage(`
    <div class="spinner-border" role="status">
        <span class="visually-hidden">Loading...</span>
    </div>
    `);

Expected behavior
When using latest the HTML should be rendered.

Additional context
Here are the CDNs used

    <link
      href="https://cdn.jsdelivr.net/npm/simple-datatables@latest/dist/style.css"
      rel="stylesheet"
      type="text/css"
    />
    <script
      src="https://cdn.jsdelivr.net/npm/simple-datatables@latest"
      type="text/javascript"
    ></script>

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions