import {
  a as t,
  c as u
} from "./chunk-IO47FP3U.js";

// ../node_modules/highlight.js/lib/languages/markdown.js
var N = u((B, r) => {
  function b(n) {
    return n ? typeof n == "string" ? n : n.source : null;
  }
  t(b, "source");
  function E(...n) {
    return n.map((i) => b(i)).join("");
  }
  t(E, "concat");
  function m(n) {
    let c = {
      begin: /<\/?[A-Za-z_]/,
      end: ">",
      subLanguage: "xml",
      relevance: 0
    }, i = {
      begin: "^[-\\*]{3,}",
      end: "$"
    }, l = {
      className: "code",
      variants: [
        // TODO: fix to allow these to work with sublanguage also
        {
          begin: "(`{3,})[^`](.|\\n)*?\\1`*[ ]*"
        },
        {
          begin: "(~{3,})[^~](.|\\n)*?\\1~*[ ]*"
        },
        // needed to allow markdown as a sublanguage to work
        {
          begin: "```",
          end: "```+[ ]*$"
        },
        {
          begin: "~~~",
          end: "~~~+[ ]*$"
        },
        {
          begin: "`.+?`"
        },
        {
          begin: "(?=^( {4}|\\t))",
          // use contains to gobble up multiple lines to allow the block to be whatever size
          // but only have a single open/close tag vs one per line
          contains: [
            {
              begin: "^( {4}|\\t)",
              end: "(\\n)$"
            }
          ],
          relevance: 0
        }
      ]
    }, d = {
      className: "bullet",
      begin: "^[ 	]*([*+-]|(\\d+\\.))(?=\\s+)",
      end: "\\s+",
      excludeEnd: !0
    }, g = {
      begin: /^\[[^\n]+\]:/,
      returnBegin: !0,
      contains: [
        {
          className: "symbol",
          begin: /\[/,
          end: /\]/,
          excludeBegin: !0,
          excludeEnd: !0
        },
        {
          className: "link",
          begin: /:\s*/,
          end: /$/,
          excludeBegin: !0
        }
      ]
    }, o = {
      variants: [
        // too much like nested array access in so many languages
        // to have any real relevance
        {
          begin: /\[.+?\]\[.*?\]/,
          relevance: 0
        },
        // popular internet URLs
        {
          begin: /\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,
          relevance: 2
        },
        {
          begin: E(/\[.+?\]\(/, /[A-Za-z][A-Za-z0-9+.-]*/, /:\/\/.*?\)/),
          relevance: 2
        },
        // relative urls
        {
          begin: /\[.+?\]\([./?&#].*?\)/,
          relevance: 1
        },
        // whatever else, lower relevance (might not be a link at all)
        {
          begin: /\[.+?\]\(.*?\)/,
          relevance: 0
        }
      ],
      returnBegin: !0,
      contains: [
        {
          className: "string",
          relevance: 0,
          begin: "\\[",
          end: "\\]",
          excludeBegin: !0,
          returnEnd: !0
        },
        {
          className: "link",
          relevance: 0,
          begin: "\\]\\(",
          end: "\\)",
          excludeBegin: !0,
          excludeEnd: !0
        },
        {
          className: "symbol",
          relevance: 0,
          begin: "\\]\\[",
          end: "\\]",
          excludeBegin: !0,
          excludeEnd: !0
        }
      ]
    }, a = {
      className: "strong",
      contains: [],
      // defined later
      variants: [
        {
          begin: /_{2}/,
          end: /_{2}/
        },
        {
          begin: /\*{2}/,
          end: /\*{2}/
        }
      ]
    }, s = {
      className: "emphasis",
      contains: [],
      // defined later
      variants: [
        {
          begin: /\*(?!\*)/,
          end: /\*/
        },
        {
          begin: /_(?!_)/,
          end: /_/,
          relevance: 0
        }
      ]
    };
    a.contains.push(s), s.contains.push(a);
    let e = [
      c,
      o
    ];
    return a.contains = a.contains.concat(e), s.contains = s.contains.concat(e), e = e.concat(a, s), {
      name: "Markdown",
      aliases: [
        "md",
        "mkdown",
        "mkd"
      ],
      contains: [
        {
          className: "section",
          variants: [
            {
              begin: "^#{1,6}",
              end: "$",
              contains: e
            },
            {
              begin: "(?=^.+?\\n[=-]{2,}$)",
              contains: [
                {
                  begin: "^[=-]*$"
                },
                {
                  begin: "^",
                  end: "\\n",
                  contains: e
                }
              ]
            }
          ]
        },
        c,
        d,
        a,
        s,
        {
          className: "quote",
          begin: "^>\\s+",
          contains: e,
          end: "$"
        },
        l,
        i,
        o,
        g
      ]
    };
  }
  t(m, "markdown");
  r.exports = m;
});

export {
  N as a
};
