{
  "version": 3,
  "sources": ["../../../src/api/raw-handling/markdown-converter.js"],
  "sourcesContent": ["/**\n * External dependencies\n */\nimport showdown from 'showdown';\n\n// Reuse the same showdown converter.\nconst converter = new showdown.Converter( {\n\tnoHeaderId: true,\n\ttables: true,\n\tliteralMidWordUnderscores: true,\n\tomitExtraWLInCodeBlocks: true,\n\tsimpleLineBreaks: true,\n\tstrikethrough: true,\n} );\n\n/**\n * Corrects the Slack Markdown variant of the code block.\n * If uncorrected, it will be converted to inline code.\n *\n * @see https://get.slack.help/hc/en-us/articles/202288908-how-can-i-add-formatting-to-my-messages-#code-blocks\n *\n * @param {string} text The potential Markdown text to correct.\n *\n * @return {string} The corrected Markdown.\n */\nfunction slackMarkdownVariantCorrector( text ) {\n\treturn text.replace(\n\t\t/((?:^|\\n)```)([^\\n`]+)(```(?:$|\\n))/,\n\t\t( match, p1, p2, p3 ) => `${ p1 }\\n${ p2 }\\n${ p3 }`\n\t);\n}\n\nfunction bulletsToAsterisks( text ) {\n\treturn text.replace( /(^|\\n)\u2022( +)/g, '$1*$2' );\n}\n\n/**\n * Converts a piece of text into HTML based on any Markdown present.\n * Also decodes any encoded HTML.\n *\n * @param {string} text The plain text to convert.\n *\n * @return {string} HTML.\n */\nexport default function markdownConverter( text ) {\n\treturn converter.makeHtml(\n\t\tslackMarkdownVariantCorrector( bulletsToAsterisks( text ) )\n\t);\n}\n"],
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,sBAAqB;AAGrB,IAAM,YAAY,IAAI,gBAAAA,QAAS,UAAW;AAAA,EACzC,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,2BAA2B;AAAA,EAC3B,yBAAyB;AAAA,EACzB,kBAAkB;AAAA,EAClB,eAAe;AAChB,CAAE;AAYF,SAAS,8BAA+B,MAAO;AAC9C,SAAO,KAAK;AAAA,IACX;AAAA,IACA,CAAE,OAAO,IAAI,IAAI,OAAQ,GAAI,EAAG;AAAA,EAAM,EAAG;AAAA,EAAM,EAAG;AAAA,EACnD;AACD;AAEA,SAAS,mBAAoB,MAAO;AACnC,SAAO,KAAK,QAAS,gBAAgB,OAAQ;AAC9C;AAUe,SAAR,kBAAoC,MAAO;AACjD,SAAO,UAAU;AAAA,IAChB,8BAA+B,mBAAoB,IAAK,CAAE;AAAA,EAC3D;AACD;",
  "names": ["showdown"]
}
