JSFiddle - React, Tailwind, and code Playground

by dandclark_msft

HTML

<style>
#result {
 font-family: monospace;
 width: 750px; 
}
</style>
<div id="result"></div>

JavaScript

// Excluding 'param', which is in the source list at
// https://github.com/web-platform-tests/wpt/blob/master/html/resources/common.js#L3
// but is considered obsolete per
// https://html.spec.whatwg.org/#non-conforming-features
const html5_elements = [
  'a',        'abbr',     'address',  'area',     'article',    'aside',
  'audio',    'b',        'base',     'bdi',      'bdo',        'blockquote',
  'body',     'br',       'button',   'canvas',   'caption',    'cite',
  'code',     'col',      'colgroup', 'data',     'datalist',   'dd',
  'del',      'details',  'dfn',      'dialog',   'div',        'dl',
  'dt',       'em',       'embed',    'fieldset', 'figcaption', 'figure',
  'footer',   'form',     'h1',       'h2',       'h3',         'h4',
  'h5',       'h6',       'head',     'header',   'hr',         'html',
  'i',        'iframe',   'img',      'input',    'ins',        'kbd',
  'label',    'legend',   'li',       'link',     'main',       'map',
  'mark',     'menu',     'meta',     'meter',    'nav',        'noscript',
  'object',   'ol',       'optgroup', 'option',   'output',     'p',
  /*'param',*/'pre',      'progress', 'q',        'rp',         'rt',
  'ruby',     's',        'samp',     'script',   'section',    'select',
  'slot',     'small',    'source',   'span',     'strong',     'style',
  'sub',      'sup',      'summary',  'table',    'tbody',      'td',
  'template', 'textarea', 'tfoot',    'th',       'thead',      'time',
  'title',    'tr',       'track',    'u',        'ul',         'var',
  'video',    'wbr'
];

const metadata_content = ['base', 'link', 'meta', 'noscript', 'script', 'style', 'template', 'title'];
const embedded_content = ['audio', 'canvas', 'embed', 'iframe', 'img', 'math', 'object', 'picture', 'svg', 'video'];
const embedded_content_except_canvas = embedded_content.filter(el => el !== 'canvas');
const interactive_content = ['a', 'audio', 'button', 'details', 'embed', 'iframe', 'img', 'input', 'label',...