valid.js 306 B

123456789
  1. import { base_parse } from './nodes/html';
  2. /**
  3. * Parses HTML and returns a root element
  4. * Parse a chuck of HTML source.
  5. */
  6. export default function valid(data, options = { lowerCaseTagName: false, comment: false }) {
  7. const stack = base_parse(data, options);
  8. return Boolean(stack.length === 1);
  9. }