# all files / src/ supports.js

87.5% Statements 14/16
100% Branches 0/0
100% Functions 0/0
85.71% Lines 12/14

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    283×
    3×

    3×

    3×
    3×
    3×
    3×

    3×
    3×
    3×

    3×

     let tagSoup = false;
    let selfClose = false;

    let work = window.document.createElement('div');

    try {
      const html = '<P><I></P></I>';
      work.innerHTML = html;
      tagSoup = work.innerHTML !== html;
    } catch (e) {
      tagSoup = false;
    }

    try {
      work.innerHTML = '<P><i><P></P></i></P>';
      selfClose = work.childNodes.length === 2;
    } catch (e) {
      selfClose = false;
    }

    work = null;

    export {
      tagSoup,
      selfClose
    };