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AsB,KAAO,MAElF,QAAQ,sBAAuB,MAG/B,QAAQ,yCAA0C,IAElD,QAAQ,sEAAuE,YAE/E,QAAQ,0BAA2B,QAInC,QAAQ,qCAAsC,YAE9C,QAAQ,mBAAoB,MAE5B,QAAQ,WAAY,MAMpB,QAAQ,WAAY,KACzB,CAAE,MAAM,GACN,GAAI,EAAQ,WAAY,MAAM,EAG9B,OADA,QAAQ,MAAM,wCAAyC,GAChD,CACT,CACA,OAAO,CACT","file":"/npm/remove-markdown@0.6.2/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/remove-markdown@0.6.2/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","module.exports = function(md, options) {\n  options = options || {};\n  options.listUnicodeChar = options.hasOwnProperty('listUnicodeChar') ? options.listUnicodeChar : false;\n  options.stripListLeaders = options.hasOwnProperty('stripListLeaders') ? options.stripListLeaders : true;\n  options.gfm = options.hasOwnProperty('gfm') ? options.gfm : true;\n  options.useImgAltText = options.hasOwnProperty('useImgAltText') ? options.useImgAltText : true;\n  options.abbr = options.hasOwnProperty('abbr') ? options.abbr : false;\n  options.replaceLinksWithURL = options.hasOwnProperty('replaceLinksWithURL') ? options.replaceLinksWithURL : false;\n  options.htmlTagsToSkip = options.hasOwnProperty('htmlTagsToSkip') ? options.htmlTagsToSkip : [];\n  options.throwError = options.hasOwnProperty('throwError') ? options.throwError : false;\n\n  var output = md || '';\n\n  // Remove horizontal rules (stripListHeaders conflict with this rule, which is why it has been moved to the top)\n  output = output.replace(/^ {0,3}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/gm, '');\n\n  try {\n    if (options.stripListLeaders) {\n      if (options.listUnicodeChar)\n        output = output.replace(/^([\\s\\t]*)([\\*\\-\\+]|\\d+\\.)\\s+/gm, options.listUnicodeChar + ' $1');\n      else\n        output = output.replace(/^([\\s\\t]*)([\\*\\-\\+]|\\d+\\.)\\s+/gm, '$1');\n    }\n    if (options.gfm) {\n      output = output\n      // Header\n        .replace(/\\n={2,}/g, '\\n')\n        // Fenced codeblocks\n        .replace(/~{3}.*\\n/g, '')\n        // Strikethrough\n        .replace(/~~/g, '')\n        // Fenced codeblocks with backticks\n        .replace(/```(?:.*)\\n([\\s\\S]*?)```/g, (_, code) => code.trim());\n    }\n    if (options.abbr) {\n      // Remove abbreviations\n      output = output.replace(/\\*\\[.*\\]:.*\\n/, '');\n    }\n    \n    let htmlReplaceRegex = /<[^>]*>/g\n    if (options.htmlTagsToSkip && options.htmlTagsToSkip.length > 0) {\n      // Create a regex that matches tags not in htmlTagsToSkip\n      const joinedHtmlTagsToSkip = options.htmlTagsToSkip.join('|')\n      htmlReplaceRegex = new RegExp(\n        `<(?!\\/?(${joinedHtmlTagsToSkip})(?=>|\\s[^>]*>))[^>]*>`,\n        'g',\n      )\n    }\n\n    output = output\n      // Remove HTML tags\n      .replace(htmlReplaceRegex, '')\n      // Remove setext-style headers\n      .replace(/^[=\\-]{2,}\\s*$/g, '')\n      // Remove footnotes?\n      .replace(/\\[\\^.+?\\](\\: .*?$)?/g, '')\n      .replace(/\\s{0,2}\\[.*?\\]: .*?$/g, '')\n      // Remove images\n      .replace(/\\!\\[(.*?)\\][\\[\\(].*?[\\]\\)]/g, options.useImgAltText ? '$1' : '')\n      // Remove inline links\n      .replace(/\\[([\\s\\S]*?)\\]\\s*[\\(\\[].*?[\\)\\]]/g, options.replaceLinksWithURL ? '$2' : '$1')\n      // Remove blockquotes\n      .replace(/^(\\n)?\\s{0,3}>\\s?/gm, '$1')\n      // .replace(/(^|\\n)\\s{0,3}>\\s?/g, '\\n\\n')\n      // Remove reference-style links?\n      .replace(/^\\s{1,2}\\[(.*?)\\]: (\\S+)( \".*?\")?\\s*$/g, '')\n      // Remove atx-style headers\n      .replace(/^(\\n)?\\s{0,}#{1,6}\\s*( (.+))? +#+$|^(\\n)?\\s{0,}#{1,6}\\s*( (.+))?$/gm, '$1$3$4$6')\n      // Remove * emphasis\n      .replace(/([\\*]+)(\\S)(.*?\\S)??\\1/g, '$2$3')\n      // Remove _ emphasis. Unlike *, _ emphasis gets rendered only if \n      //   1. Either there is a whitespace character before opening _ and after closing _.\n      //   2. Or _ is at the start/end of the string.\n      .replace(/(^|\\W)([_]+)(\\S)(.*?\\S)??\\2($|\\W)/g, '$1$3$4$5')\n      // Remove single-line code blocks (already handled multiline above in gfm section)\n      .replace(/(`{3,})(.*?)\\1/gm, '$2')\n      // Remove inline code\n      .replace(/`(.+?)`/g, '$1')\n      // // Replace two or more newlines with exactly two? Not entirely sure this belongs here...\n      // .replace(/\\n{2,}/g, '\\n\\n')\n      // // Remove newlines in a paragraph\n      // .replace(/(\\S+)\\n\\s*(\\S+)/g, '$1 $2')\n      // Replace strike through\n      .replace(/~(.*?)~/g, '$1');\n  } catch(e) {\n    if (options.throwError) throw e;\n\n    console.error(\"remove-markdown encountered error: %s\", e);\n    return md;\n  }\n  return output;\n};\n"]}