repo_description: Markdown parser, done right. Commonmark support, extensions, syntax plugins, high speed - all in one. Gulp and metalsmith plugins available. Used by Facebook, Docusaurus and many others! Use https://github.com/breakdance/breakdance for HTML-to-markdown conversion. Use https://github.com/jonschlinkert/markdown-toc to generate a table of contents.
repo_topics: commonmark compile docusaurus gfm javascript jonschlinkert markdown markdown-it markdown-parser md node nodejs parse parser syntax-highlighting
code: // Process html tags
  
  import { HTML_TAG_RE } from '../common/html_re';
  
  
  function isLetter(ch) {
    /*eslint no-bitwise:0*/
    var lc = ch | 0x20; // to lower case
    return (lc >= 0x61/* a */) && (lc <= 0x7a/* z */);
  }
  
  
  export default function htmltag(state, silent) {
    var ch, match, max, pos = state.pos;
  
    if (!state.options.html) { return false; }
  
    // Check start
    max = state.posMax;
    if (state.src.charCodeAt(pos) !== 0x3C/* < */ ||
        pos + 2 >= max) {
      return false;
    }
  
    // Quick fail on second char
    ch = state.src.charCodeAt(pos + 1);
    if (ch !== 0x21/* ! */ &&
        ch !== 0x3F/* ? */ &&
        ch !== 0x2F/* / */ &&
        !isLetter(ch)) {
      return false;
    }
  
    match = state.src.slice(pos).match(HTML_TAG_RE);
    if (!match) { return false; }
  
    if (!silent) {
      state.push({
        type: 'htmltag',
        content: state.src.slice(pos, pos + match[0].length),
        level: state.level
      });
    }
    state.pos += match[0].length;
    return true;
  };
  