| @@ -1,4 +1,5 @@ | ||
| 1 | +(function() { | |
| 1 | 2 | "use strict"; |
| 2 | 3 | var wp; |
| 3 | 4 | (wp ||= {}).blocks = (() => { |
| 4 | 5 | var __create = Object.create; |
| @@ -569,8 +570,64 @@ | ||
| 569 | 570 | module.exports.remove = removeAccents2; |
| 570 | 571 | } |
| 571 | 572 | }); |
| 572 | 573 | |
| 574 | + // node_modules/fast-deep-equal/es6/index.js | |
| 575 | + var require_es6 = __commonJS({ | |
| 576 | + "node_modules/fast-deep-equal/es6/index.js"(exports, module) { | |
| 577 | + "use strict"; | |
| 578 | + module.exports = function equal(a, b2) { | |
| 579 | + if (a === b2) return true; | |
| 580 | + if (a && b2 && typeof a == "object" && typeof b2 == "object") { | |
| 581 | + if (a.constructor !== b2.constructor) return false; | |
| 582 | + var length, i, keys; | |
| 583 | + if (Array.isArray(a)) { | |
| 584 | + length = a.length; | |
| 585 | + if (length != b2.length) return false; | |
| 586 | + for (i = length; i-- !== 0; ) | |
| 587 | + if (!equal(a[i], b2[i])) return false; | |
| 588 | + return true; | |
| 589 | + } | |
| 590 | + if (a instanceof Map && b2 instanceof Map) { | |
| 591 | + if (a.size !== b2.size) return false; | |
| 592 | + for (i of a.entries()) | |
| 593 | + if (!b2.has(i[0])) return false; | |
| 594 | + for (i of a.entries()) | |
| 595 | + if (!equal(i[1], b2.get(i[0]))) return false; | |
| 596 | + return true; | |
| 597 | + } | |
| 598 | + if (a instanceof Set && b2 instanceof Set) { | |
| 599 | + if (a.size !== b2.size) return false; | |
| 600 | + for (i of a.entries()) | |
| 601 | + if (!b2.has(i[0])) return false; | |
| 602 | + return true; | |
| 603 | + } | |
| 604 | + if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b2)) { | |
| 605 | + length = a.length; | |
| 606 | + if (length != b2.length) return false; | |
| 607 | + for (i = length; i-- !== 0; ) | |
| 608 | + if (a[i] !== b2[i]) return false; | |
| 609 | + return true; | |
| 610 | + } | |
| 611 | + if (a.constructor === RegExp) return a.source === b2.source && a.flags === b2.flags; | |
| 612 | + if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b2.valueOf(); | |
| 613 | + if (a.toString !== Object.prototype.toString) return a.toString() === b2.toString(); | |
| 614 | + keys = Object.keys(a); | |
| 615 | + length = keys.length; | |
| 616 | + if (length !== Object.keys(b2).length) return false; | |
| 617 | + for (i = length; i-- !== 0; ) | |
| 618 | + if (!Object.prototype.hasOwnProperty.call(b2, keys[i])) return false; | |
| 619 | + for (i = length; i-- !== 0; ) { | |
| 620 | + var key = keys[i]; | |
| 621 | + if (!equal(a[key], b2[key])) return false; | |
| 622 | + } | |
| 623 | + return true; | |
| 624 | + } | |
| 625 | + return a !== a && b2 !== b2; | |
| 626 | + }; | |
| 627 | + } | |
| 628 | + }); | |
| 629 | + | |
| 573 | 630 | // packages/blocks/node_modules/react-is/cjs/react-is.development.js |
| 574 | 631 | var require_react_is_development = __commonJS({ |
| 575 | 632 | "packages/blocks/node_modules/react-is/cjs/react-is.development.js"(exports) { |
| 576 | 633 | "use strict"; |
| @@ -798,64 +855,8 @@ | ||
| 798 | 855 | module.exports = window.ReactJSXRuntime; |
| 799 | 856 | } |
| 800 | 857 | }); |
| 801 | 858 | |
| 802 | - // node_modules/fast-deep-equal/es6/index.js | |
| 803 | - var require_es6 = __commonJS({ | |
| 804 | - "node_modules/fast-deep-equal/es6/index.js"(exports, module) { | |
| 805 | - "use strict"; | |
| 806 | - module.exports = function equal(a2, b2) { | |
| 807 | - if (a2 === b2) return true; | |
| 808 | - if (a2 && b2 && typeof a2 == "object" && typeof b2 == "object") { | |
| 809 | - if (a2.constructor !== b2.constructor) return false; | |
| 810 | - var length, i2, keys; | |
| 811 | - if (Array.isArray(a2)) { | |
| 812 | - length = a2.length; | |
| 813 | - if (length != b2.length) return false; | |
| 814 | - for (i2 = length; i2-- !== 0; ) | |
| 815 | - if (!equal(a2[i2], b2[i2])) return false; | |
| 816 | - return true; | |
| 817 | - } | |
| 818 | - if (a2 instanceof Map && b2 instanceof Map) { | |
| 819 | - if (a2.size !== b2.size) return false; | |
| 820 | - for (i2 of a2.entries()) | |
| 821 | - if (!b2.has(i2[0])) return false; | |
| 822 | - for (i2 of a2.entries()) | |
| 823 | - if (!equal(i2[1], b2.get(i2[0]))) return false; | |
| 824 | - return true; | |
| 825 | - } | |
| 826 | - if (a2 instanceof Set && b2 instanceof Set) { | |
| 827 | - if (a2.size !== b2.size) return false; | |
| 828 | - for (i2 of a2.entries()) | |
| 829 | - if (!b2.has(i2[0])) return false; | |
| 830 | - return true; | |
| 831 | - } | |
| 832 | - if (ArrayBuffer.isView(a2) && ArrayBuffer.isView(b2)) { | |
| 833 | - length = a2.length; | |
| 834 | - if (length != b2.length) return false; | |
| 835 | - for (i2 = length; i2-- !== 0; ) | |
| 836 | - if (a2[i2] !== b2[i2]) return false; | |
| 837 | - return true; | |
| 838 | - } | |
| 839 | - if (a2.constructor === RegExp) return a2.source === b2.source && a2.flags === b2.flags; | |
| 840 | - if (a2.valueOf !== Object.prototype.valueOf) return a2.valueOf() === b2.valueOf(); | |
| 841 | - if (a2.toString !== Object.prototype.toString) return a2.toString() === b2.toString(); | |
| 842 | - keys = Object.keys(a2); | |
| 843 | - length = keys.length; | |
| 844 | - if (length !== Object.keys(b2).length) return false; | |
| 845 | - for (i2 = length; i2-- !== 0; ) | |
| 846 | - if (!Object.prototype.hasOwnProperty.call(b2, keys[i2])) return false; | |
| 847 | - for (i2 = length; i2-- !== 0; ) { | |
| 848 | - var key = keys[i2]; | |
| 849 | - if (!equal(a2[key], b2[key])) return false; | |
| 850 | - } | |
| 851 | - return true; | |
| 852 | - } | |
| 853 | - return a2 !== a2 && b2 !== b2; | |
| 854 | - }; | |
| 855 | - } | |
| 856 | - }); | |
| 857 | - | |
| 858 | 859 | // package-external:@wordpress/html-entities |
| 859 | 860 | var require_html_entities = __commonJS({ |
| 860 | 861 | "package-external:@wordpress/html-entities"(exports, module) { |
| 861 | 862 | module.exports = window.wp.htmlEntities; |
| @@ -875,3632 +876,8 @@ | ||
| 875 | 876 | module.exports = window.wp.blob; |
| 876 | 877 | } |
| 877 | 878 | }); |
| 878 | 879 | |
| 879 | - // node_modules/showdown/dist/showdown.js | |
| 880 | - var require_showdown = __commonJS({ | |
| 881 | - "node_modules/showdown/dist/showdown.js"(exports, module) { | |
| 882 | - (function() { | |
| 883 | - function getDefaultOpts(simple) { | |
| 884 | - "use strict"; | |
| 885 | - var defaultOptions = { | |
| 886 | - omitExtraWLInCodeBlocks: { | |
| 887 | - defaultValue: false, | |
| 888 | - describe: "Omit the default extra whiteline added to code blocks", | |
| 889 | - type: "boolean" | |
| 890 | - }, | |
| 891 | - noHeaderId: { | |
| 892 | - defaultValue: false, | |
| 893 | - describe: "Turn on/off generated header id", | |
| 894 | - type: "boolean" | |
| 895 | - }, | |
| 896 | - prefixHeaderId: { | |
| 897 | - defaultValue: false, | |
| 898 | - describe: "Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix", | |
| 899 | - type: "string" | |
| 900 | - }, | |
| 901 | - rawPrefixHeaderId: { | |
| 902 | - defaultValue: false, | |
| 903 | - describe: 'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)', | |
| 904 | - type: "boolean" | |
| 905 | - }, | |
| 906 | - ghCompatibleHeaderId: { | |
| 907 | - defaultValue: false, | |
| 908 | - describe: "Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)", | |
| 909 | - type: "boolean" | |
| 910 | - }, | |
| 911 | - rawHeaderId: { | |
| 912 | - defaultValue: false, | |
| 913 | - describe: `Remove only spaces, ' and " from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids`, | |
| 914 | - type: "boolean" | |
| 915 | - }, | |
| 916 | - headerLevelStart: { | |
| 917 | - defaultValue: false, | |
| 918 | - describe: "The header blocks level start", | |
| 919 | - type: "integer" | |
| 920 | - }, | |
| 921 | - parseImgDimensions: { | |
| 922 | - defaultValue: false, | |
| 923 | - describe: "Turn on/off image dimension parsing", | |
| 924 | - type: "boolean" | |
| 925 | - }, | |
| 926 | - simplifiedAutoLink: { | |
| 927 | - defaultValue: false, | |
| 928 | - describe: "Turn on/off GFM autolink style", | |
| 929 | - type: "boolean" | |
| 930 | - }, | |
| 931 | - excludeTrailingPunctuationFromURLs: { | |
| 932 | - defaultValue: false, | |
| 933 | - describe: "Excludes trailing punctuation from links generated with autoLinking", | |
| 934 | - type: "boolean" | |
| 935 | - }, | |
| 936 | - literalMidWordUnderscores: { | |
| 937 | - defaultValue: false, | |
| 938 | - describe: "Parse midword underscores as literal underscores", | |
| 939 | - type: "boolean" | |
| 940 | - }, | |
| 941 | - literalMidWordAsterisks: { | |
| 942 | - defaultValue: false, | |
| 943 | - describe: "Parse midword asterisks as literal asterisks", | |
| 944 | - type: "boolean" | |
| 945 | - }, | |
| 946 | - strikethrough: { | |
| 947 | - defaultValue: false, | |
| 948 | - describe: "Turn on/off strikethrough support", | |
| 949 | - type: "boolean" | |
| 950 | - }, | |
| 951 | - tables: { | |
| 952 | - defaultValue: false, | |
| 953 | - describe: "Turn on/off tables support", | |
| 954 | - type: "boolean" | |
| 955 | - }, | |
| 956 | - tablesHeaderId: { | |
| 957 | - defaultValue: false, | |
| 958 | - describe: "Add an id to table headers", | |
| 959 | - type: "boolean" | |
| 960 | - }, | |
| 961 | - ghCodeBlocks: { | |
| 962 | - defaultValue: true, | |
| 963 | - describe: "Turn on/off GFM fenced code blocks support", | |
| 964 | - type: "boolean" | |
| 965 | - }, | |
| 966 | - tasklists: { | |
| 967 | - defaultValue: false, | |
| 968 | - describe: "Turn on/off GFM tasklist support", | |
| 969 | - type: "boolean" | |
| 970 | - }, | |
| 971 | - smoothLivePreview: { | |
| 972 | - defaultValue: false, | |
| 973 | - describe: "Prevents weird effects in live previews due to incomplete input", | |
| 974 | - type: "boolean" | |
| 975 | - }, | |
| 976 | - smartIndentationFix: { | |
| 977 | - defaultValue: false, | |
| 978 | - description: "Tries to smartly fix indentation in es6 strings", | |
| 979 | - type: "boolean" | |
| 980 | - }, | |
| 981 | - disableForced4SpacesIndentedSublists: { | |
| 982 | - defaultValue: false, | |
| 983 | - description: "Disables the requirement of indenting nested sublists by 4 spaces", | |
| 984 | - type: "boolean" | |
| 985 | - }, | |
| 986 | - simpleLineBreaks: { | |
| 987 | - defaultValue: false, | |
| 988 | - description: "Parses simple line breaks as <br> (GFM Style)", | |
| 989 | - type: "boolean" | |
| 990 | - }, | |
| 991 | - requireSpaceBeforeHeadingText: { | |
| 992 | - defaultValue: false, | |
| 993 | - description: "Makes adding a space between `#` and the header text mandatory (GFM Style)", | |
| 994 | - type: "boolean" | |
| 995 | - }, | |
| 996 | - ghMentions: { | |
| 997 | - defaultValue: false, | |
| 998 | - description: "Enables github @mentions", | |
| 999 | - type: "boolean" | |
| 1000 | - }, | |
| 1001 | - ghMentionsLink: { | |
| 1002 | - defaultValue: "https://github.com/{u}", | |
| 1003 | - description: "Changes the link generated by @mentions. Only applies if ghMentions option is enabled.", | |
| 1004 | - type: "string" | |
| 1005 | - }, | |
| 1006 | - encodeEmails: { | |
| 1007 | - defaultValue: true, | |
| 1008 | - description: "Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities", | |
| 1009 | - type: "boolean" | |
| 1010 | - }, | |
| 1011 | - openLinksInNewWindow: { | |
| 1012 | - defaultValue: false, | |
| 1013 | - description: "Open all links in new windows", | |
| 1014 | - type: "boolean" | |
| 1015 | - }, | |
| 1016 | - backslashEscapesHTMLTags: { | |
| 1017 | - defaultValue: false, | |
| 1018 | - description: "Support for HTML Tag escaping. ex: <div>foo</div>", | |
| 1019 | - type: "boolean" | |
| 1020 | - }, | |
| 1021 | - emoji: { | |
| 1022 | - defaultValue: false, | |
| 1023 | - description: "Enable emoji support. Ex: `this is a :smile: emoji`", | |
| 1024 | - type: "boolean" | |
| 1025 | - }, | |
| 1026 | - underline: { | |
| 1027 | - defaultValue: false, | |
| 1028 | - description: "Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `<em>` and `<strong>`", | |
| 1029 | - type: "boolean" | |
| 1030 | - }, | |
| 1031 | - completeHTMLDocument: { | |
| 1032 | - defaultValue: false, | |
| 1033 | - description: "Outputs a complete html document, including `<html>`, `<head>` and `<body>` tags", | |
| 1034 | - type: "boolean" | |
| 1035 | - }, | |
| 1036 | - metadata: { | |
| 1037 | - defaultValue: false, | |
| 1038 | - description: "Enable support for document metadata (defined at the top of the document between `\xAB\xAB\xAB` and `\xBB\xBB\xBB` or between `---` and `---`).", | |
| 1039 | - type: "boolean" | |
| 1040 | - }, | |
| 1041 | - splitAdjacentBlockquotes: { | |
| 1042 | - defaultValue: false, | |
| 1043 | - description: "Split adjacent blockquote blocks", | |
| 1044 | - type: "boolean" | |
| 1045 | - } | |
| 1046 | - }; | |
| 1047 | - if (simple === false) { | |
| 1048 | - return JSON.parse(JSON.stringify(defaultOptions)); | |
| 1049 | - } | |
| 1050 | - var ret = {}; | |
| 1051 | - for (var opt in defaultOptions) { | |
| 1052 | - if (defaultOptions.hasOwnProperty(opt)) { | |
| 1053 | - ret[opt] = defaultOptions[opt].defaultValue; | |
| 1054 | - } | |
| 1055 | - } | |
| 1056 | - return ret; | |
| 1057 | - } | |
| 1058 | - function allOptionsOn() { | |
| 1059 | - "use strict"; | |
| 1060 | - var options = getDefaultOpts(true), ret = {}; | |
| 1061 | - for (var opt in options) { | |
| 1062 | - if (options.hasOwnProperty(opt)) { | |
| 1063 | - ret[opt] = true; | |
| 1064 | - } | |
| 1065 | - } | |
| 1066 | - return ret; | |
| 1067 | - } | |
| 1068 | - var showdown2 = {}, parsers = {}, extensions = {}, globalOptions = getDefaultOpts(true), setFlavor = "vanilla", flavor = { | |
| 1069 | - github: { | |
| 1070 | - omitExtraWLInCodeBlocks: true, | |
| 1071 | - simplifiedAutoLink: true, | |
| 1072 | - excludeTrailingPunctuationFromURLs: true, | |
| 1073 | - literalMidWordUnderscores: true, | |
| 1074 | - strikethrough: true, | |
| 1075 | - tables: true, | |
| 1076 | - tablesHeaderId: true, | |
| 1077 | - ghCodeBlocks: true, | |
| 1078 | - tasklists: true, | |
| 1079 | - disableForced4SpacesIndentedSublists: true, | |
| 1080 | - simpleLineBreaks: true, | |
| 1081 | - requireSpaceBeforeHeadingText: true, | |
| 1082 | - ghCompatibleHeaderId: true, | |
| 1083 | - ghMentions: true, | |
| 1084 | - backslashEscapesHTMLTags: true, | |
| 1085 | - emoji: true, | |
| 1086 | - splitAdjacentBlockquotes: true | |
| 1087 | - }, | |
| 1088 | - original: { | |
| 1089 | - noHeaderId: true, | |
| 1090 | - ghCodeBlocks: false | |
| 1091 | - }, | |
| 1092 | - ghost: { | |
| 1093 | - omitExtraWLInCodeBlocks: true, | |
| 1094 | - parseImgDimensions: true, | |
| 1095 | - simplifiedAutoLink: true, | |
| 1096 | - excludeTrailingPunctuationFromURLs: true, | |
| 1097 | - literalMidWordUnderscores: true, | |
| 1098 | - strikethrough: true, | |
| 1099 | - tables: true, | |
| 1100 | - tablesHeaderId: true, | |
| 1101 | - ghCodeBlocks: true, | |
| 1102 | - tasklists: true, | |
| 1103 | - smoothLivePreview: true, | |
| 1104 | - simpleLineBreaks: true, | |
| 1105 | - requireSpaceBeforeHeadingText: true, | |
| 1106 | - ghMentions: false, | |
| 1107 | - encodeEmails: true | |
| 1108 | - }, | |
| 1109 | - vanilla: getDefaultOpts(true), | |
| 1110 | - allOn: allOptionsOn() | |
| 1111 | - }; | |
| 1112 | - showdown2.helper = {}; | |
| 1113 | - showdown2.extensions = {}; | |
| 1114 | - showdown2.setOption = function(key, value) { | |
| 1115 | - "use strict"; | |
| 1116 | - globalOptions[key] = value; | |
| 1117 | - return this; | |
| 1118 | - }; | |
| 1119 | - showdown2.getOption = function(key) { | |
| 1120 | - "use strict"; | |
| 1121 | - return globalOptions[key]; | |
| 1122 | - }; | |
| 1123 | - showdown2.getOptions = function() { | |
| 1124 | - "use strict"; | |
| 1125 | - return globalOptions; | |
| 1126 | - }; | |
| 1127 | - showdown2.resetOptions = function() { | |
| 1128 | - "use strict"; | |
| 1129 | - globalOptions = getDefaultOpts(true); | |
| 1130 | - }; | |
| 1131 | - showdown2.setFlavor = function(name) { | |
| 1132 | - "use strict"; | |
| 1133 | - if (!flavor.hasOwnProperty(name)) { | |
| 1134 | - throw Error(name + " flavor was not found"); | |
| 1135 | - } | |
| 1136 | - showdown2.resetOptions(); | |
| 1137 | - var preset = flavor[name]; | |
| 1138 | - setFlavor = name; | |
| 1139 | - for (var option in preset) { | |
| 1140 | - if (preset.hasOwnProperty(option)) { | |
| 1141 | - globalOptions[option] = preset[option]; | |
| 1142 | - } | |
| 1143 | - } | |
| 1144 | - }; | |
| 1145 | - showdown2.getFlavor = function() { | |
| 1146 | - "use strict"; | |
| 1147 | - return setFlavor; | |
| 1148 | - }; | |
| 1149 | - showdown2.getFlavorOptions = function(name) { | |
| 1150 | - "use strict"; | |
| 1151 | - if (flavor.hasOwnProperty(name)) { | |
| 1152 | - return flavor[name]; | |
| 1153 | - } | |
| 1154 | - }; | |
| 1155 | - showdown2.getDefaultOptions = function(simple) { | |
| 1156 | - "use strict"; | |
| 1157 | - return getDefaultOpts(simple); | |
| 1158 | - }; | |
| 1159 | - showdown2.subParser = function(name, func) { | |
| 1160 | - "use strict"; | |
| 1161 | - if (showdown2.helper.isString(name)) { | |
| 1162 | - if (typeof func !== "undefined") { | |
| 1163 | - parsers[name] = func; | |
| 1164 | - } else { | |
| 1165 | - if (parsers.hasOwnProperty(name)) { | |
| 1166 | - return parsers[name]; | |
| 1167 | - } else { | |
| 1168 | - throw Error("SubParser named " + name + " not registered!"); | |
| 1169 | - } | |
| 1170 | - } | |
| 1171 | - } | |
| 1172 | - }; | |
| 1173 | - showdown2.extension = function(name, ext) { | |
| 1174 | - "use strict"; | |
| 1175 | - if (!showdown2.helper.isString(name)) { | |
| 1176 | - throw Error("Extension 'name' must be a string"); | |
| 1177 | - } | |
| 1178 | - name = showdown2.helper.stdExtName(name); | |
| 1179 | - if (showdown2.helper.isUndefined(ext)) { | |
| 1180 | - if (!extensions.hasOwnProperty(name)) { | |
| 1181 | - throw Error("Extension named " + name + " is not registered!"); | |
| 1182 | - } | |
| 1183 | - return extensions[name]; | |
| 1184 | - } else { | |
| 1185 | - if (typeof ext === "function") { | |
| 1186 | - ext = ext(); | |
| 1187 | - } | |
| 1188 | - if (!showdown2.helper.isArray(ext)) { | |
| 1189 | - ext = [ext]; | |
| 1190 | - } | |
| 1191 | - var validExtension = validate(ext, name); | |
| 1192 | - if (validExtension.valid) { | |
| 1193 | - extensions[name] = ext; | |
| 1194 | - } else { | |
| 1195 | - throw Error(validExtension.error); | |
| 1196 | - } | |
| 1197 | - } | |
| 1198 | - }; | |
| 1199 | - showdown2.getAllExtensions = function() { | |
| 1200 | - "use strict"; | |
| 1201 | - return extensions; | |
| 1202 | - }; | |
| 1203 | - showdown2.removeExtension = function(name) { | |
| 1204 | - "use strict"; | |
| 1205 | - delete extensions[name]; | |
| 1206 | - }; | |
| 1207 | - showdown2.resetExtensions = function() { | |
| 1208 | - "use strict"; | |
| 1209 | - extensions = {}; | |
| 1210 | - }; | |
| 1211 | - function validate(extension, name) { | |
| 1212 | - "use strict"; | |
| 1213 | - var errMsg = name ? "Error in " + name + " extension->" : "Error in unnamed extension", ret = { | |
| 1214 | - valid: true, | |
| 1215 | - error: "" | |
| 1216 | - }; | |
| 1217 | - if (!showdown2.helper.isArray(extension)) { | |
| 1218 | - extension = [extension]; | |
| 1219 | - } | |
| 1220 | - for (var i2 = 0; i2 < extension.length; ++i2) { | |
| 1221 | - var baseMsg = errMsg + " sub-extension " + i2 + ": ", ext = extension[i2]; | |
| 1222 | - if (typeof ext !== "object") { | |
| 1223 | - ret.valid = false; | |
| 1224 | - ret.error = baseMsg + "must be an object, but " + typeof ext + " given"; | |
| 1225 | - return ret; | |
| 1226 | - } | |
| 1227 | - if (!showdown2.helper.isString(ext.type)) { | |
| 1228 | - ret.valid = false; | |
| 1229 | - ret.error = baseMsg + 'property "type" must be a string, but ' + typeof ext.type + " given"; | |
| 1230 | - return ret; | |
| 1231 | - } | |
| 1232 | - var type = ext.type = ext.type.toLowerCase(); | |
| 1233 | - if (type === "language") { | |
| 1234 | - type = ext.type = "lang"; | |
| 1235 | - } | |
| 1236 | - if (type === "html") { | |
| 1237 | - type = ext.type = "output"; | |
| 1238 | - } | |
| 1239 | - if (type !== "lang" && type !== "output" && type !== "listener") { | |
| 1240 | - ret.valid = false; | |
| 1241 | - ret.error = baseMsg + "type " + type + ' is not recognized. Valid values: "lang/language", "output/html" or "listener"'; | |
| 1242 | - return ret; | |
| 1243 | - } | |
| 1244 | - if (type === "listener") { | |
| 1245 | - if (showdown2.helper.isUndefined(ext.listeners)) { | |
| 1246 | - ret.valid = false; | |
| 1247 | - ret.error = baseMsg + '. Extensions of type "listener" must have a property called "listeners"'; | |
| 1248 | - return ret; | |
| 1249 | - } | |
| 1250 | - } else { | |
| 1251 | - if (showdown2.helper.isUndefined(ext.filter) && showdown2.helper.isUndefined(ext.regex)) { | |
| 1252 | - ret.valid = false; | |
| 1253 | - ret.error = baseMsg + type + ' extensions must define either a "regex" property or a "filter" method'; | |
| 1254 | - return ret; | |
| 1255 | - } | |
| 1256 | - } | |
| 1257 | - if (ext.listeners) { | |
| 1258 | - if (typeof ext.listeners !== "object") { | |
| 1259 | - ret.valid = false; | |
| 1260 | - ret.error = baseMsg + '"listeners" property must be an object but ' + typeof ext.listeners + " given"; | |
| 1261 | - return ret; | |
| 1262 | - } | |
| 1263 | - for (var ln in ext.listeners) { | |
| 1264 | - if (ext.listeners.hasOwnProperty(ln)) { | |
| 1265 | - if (typeof ext.listeners[ln] !== "function") { | |
| 1266 | - ret.valid = false; | |
| 1267 | - ret.error = baseMsg + '"listeners" property must be an hash of [event name]: [callback]. listeners.' + ln + " must be a function but " + typeof ext.listeners[ln] + " given"; | |
| 1268 | - return ret; | |
| 1269 | - } | |
| 1270 | - } | |
| 1271 | - } | |
| 1272 | - } | |
| 1273 | - if (ext.filter) { | |
| 1274 | - if (typeof ext.filter !== "function") { | |
| 1275 | - ret.valid = false; | |
| 1276 | - ret.error = baseMsg + '"filter" must be a function, but ' + typeof ext.filter + " given"; | |
| 1277 | - return ret; | |
| 1278 | - } | |
| 1279 | - } else if (ext.regex) { | |
| 1280 | - if (showdown2.helper.isString(ext.regex)) { | |
| 1281 | - ext.regex = new RegExp(ext.regex, "g"); | |
| 1282 | - } | |
| 1283 | - if (!(ext.regex instanceof RegExp)) { | |
| 1284 | - ret.valid = false; | |
| 1285 | - ret.error = baseMsg + '"regex" property must either be a string or a RegExp object, but ' + typeof ext.regex + " given"; | |
| 1286 | - return ret; | |
| 1287 | - } | |
| 1288 | - if (showdown2.helper.isUndefined(ext.replace)) { | |
| 1289 | - ret.valid = false; | |
| 1290 | - ret.error = baseMsg + '"regex" extensions must implement a replace string or function'; | |
| 1291 | - return ret; | |
| 1292 | - } | |
| 1293 | - } | |
| 1294 | - } | |
| 1295 | - return ret; | |
| 1296 | - } | |
| 1297 | - showdown2.validateExtension = function(ext) { | |
| 1298 | - "use strict"; | |
| 1299 | - var validateExtension = validate(ext, null); | |
| 1300 | - if (!validateExtension.valid) { | |
| 1301 | - console.warn(validateExtension.error); | |
| 1302 | - return false; | |
| 1303 | - } | |
| 1304 | - return true; | |
| 1305 | - }; | |
| 1306 | - if (!showdown2.hasOwnProperty("helper")) { | |
| 1307 | - showdown2.helper = {}; | |
| 1308 | - } | |
| 1309 | - showdown2.helper.isString = function(a2) { | |
| 1310 | - "use strict"; | |
| 1311 | - return typeof a2 === "string" || a2 instanceof String; | |
| 1312 | - }; | |
| 1313 | - showdown2.helper.isFunction = function(a2) { | |
| 1314 | - "use strict"; | |
| 1315 | - var getType = {}; | |
| 1316 | - return a2 && getType.toString.call(a2) === "[object Function]"; | |
| 1317 | - }; | |
| 1318 | - showdown2.helper.isArray = function(a2) { | |
| 1319 | - "use strict"; | |
| 1320 | - return Array.isArray(a2); | |
| 1321 | - }; | |
| 1322 | - showdown2.helper.isUndefined = function(value) { | |
| 1323 | - "use strict"; | |
| 1324 | - return typeof value === "undefined"; | |
| 1325 | - }; | |
| 1326 | - showdown2.helper.forEach = function(obj, callback) { | |
| 1327 | - "use strict"; | |
| 1328 | - if (showdown2.helper.isUndefined(obj)) { | |
| 1329 | - throw new Error("obj param is required"); | |
| 1330 | - } | |
| 1331 | - if (showdown2.helper.isUndefined(callback)) { | |
| 1332 | - throw new Error("callback param is required"); | |
| 1333 | - } | |
| 1334 | - if (!showdown2.helper.isFunction(callback)) { | |
| 1335 | - throw new Error("callback param must be a function/closure"); | |
| 1336 | - } | |
| 1337 | - if (typeof obj.forEach === "function") { | |
| 1338 | - obj.forEach(callback); | |
| 1339 | - } else if (showdown2.helper.isArray(obj)) { | |
| 1340 | - for (var i2 = 0; i2 < obj.length; i2++) { | |
| 1341 | - callback(obj[i2], i2, obj); | |
| 1342 | - } | |
| 1343 | - } else if (typeof obj === "object") { | |
| 1344 | - for (var prop2 in obj) { | |
| 1345 | - if (obj.hasOwnProperty(prop2)) { | |
| 1346 | - callback(obj[prop2], prop2, obj); | |
| 1347 | - } | |
| 1348 | - } | |
| 1349 | - } else { | |
| 1350 | - throw new Error("obj does not seem to be an array or an iterable object"); | |
| 1351 | - } | |
| 1352 | - }; | |
| 1353 | - showdown2.helper.stdExtName = function(s2) { | |
| 1354 | - "use strict"; | |
| 1355 | - return s2.replace(/[_?*+\/\\.^-]/g, "").replace(/\s/g, "").toLowerCase(); | |
| 1356 | - }; | |
| 1357 | - function escapeCharactersCallback(wholeMatch, m1) { | |
| 1358 | - "use strict"; | |
| 1359 | - var charCodeToEscape = m1.charCodeAt(0); | |
| 1360 | - return "\xA8E" + charCodeToEscape + "E"; | |
| 1361 | - } | |
| 1362 | - showdown2.helper.escapeCharactersCallback = escapeCharactersCallback; | |
| 1363 | - showdown2.helper.escapeCharacters = function(text2, charsToEscape, afterBackslash) { | |
| 1364 | - "use strict"; | |
| 1365 | - var regexString = "([" + charsToEscape.replace(/([\[\]\\])/g, "\\$1") + "])"; | |
| 1366 | - if (afterBackslash) { | |
| 1367 | - regexString = "\\\\" + regexString; | |
| 1368 | - } | |
| 1369 | - var regex = new RegExp(regexString, "g"); | |
| 1370 | - text2 = text2.replace(regex, escapeCharactersCallback); | |
| 1371 | - return text2; | |
| 1372 | - }; | |
| 1373 | - showdown2.helper.unescapeHTMLEntities = function(txt) { | |
| 1374 | - "use strict"; | |
| 1375 | - return txt.replace(/"/g, '"').replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&"); | |
| 1376 | - }; | |
| 1377 | - var rgxFindMatchPos = function(str, left, right, flags) { | |
| 1378 | - "use strict"; | |
| 1379 | - var f2 = flags || "", g2 = f2.indexOf("g") > -1, x2 = new RegExp(left + "|" + right, "g" + f2.replace(/g/g, "")), l2 = new RegExp(left, f2.replace(/g/g, "")), pos = [], t3, s2, m2, start, end; | |
| 1380 | - do { | |
| 1381 | - t3 = 0; | |
| 1382 | - while (m2 = x2.exec(str)) { | |
| 1383 | - if (l2.test(m2[0])) { | |
| 1384 | - if (!t3++) { | |
| 1385 | - s2 = x2.lastIndex; | |
| 1386 | - start = s2 - m2[0].length; | |
| 1387 | - } | |
| 1388 | - } else if (t3) { | |
| 1389 | - if (!--t3) { | |
| 1390 | - end = m2.index + m2[0].length; | |
| 1391 | - var obj = { | |
| 1392 | - left: { start, end: s2 }, | |
| 1393 | - match: { start: s2, end: m2.index }, | |
| 1394 | - right: { start: m2.index, end }, | |
| 1395 | - wholeMatch: { start, end } | |
| 1396 | - }; | |
| 1397 | - pos.push(obj); | |
| 1398 | - if (!g2) { | |
| 1399 | - return pos; | |
| 1400 | - } | |
| 1401 | - } | |
| 1402 | - } | |
| 1403 | - } | |
| 1404 | - } while (t3 && (x2.lastIndex = s2)); | |
| 1405 | - return pos; | |
| 1406 | - }; | |
| 1407 | - showdown2.helper.matchRecursiveRegExp = function(str, left, right, flags) { | |
| 1408 | - "use strict"; | |
| 1409 | - var matchPos = rgxFindMatchPos(str, left, right, flags), results = []; | |
| 1410 | - for (var i2 = 0; i2 < matchPos.length; ++i2) { | |
| 1411 | - results.push([ | |
| 1412 | - str.slice(matchPos[i2].wholeMatch.start, matchPos[i2].wholeMatch.end), | |
| 1413 | - str.slice(matchPos[i2].match.start, matchPos[i2].match.end), | |
| 1414 | - str.slice(matchPos[i2].left.start, matchPos[i2].left.end), | |
| 1415 | - str.slice(matchPos[i2].right.start, matchPos[i2].right.end) | |
| 1416 | - ]); | |
| 1417 | - } | |
| 1418 | - return results; | |
| 1419 | - }; | |
| 1420 | - showdown2.helper.replaceRecursiveRegExp = function(str, replacement, left, right, flags) { | |
| 1421 | - "use strict"; | |
| 1422 | - if (!showdown2.helper.isFunction(replacement)) { | |
| 1423 | - var repStr = replacement; | |
| 1424 | - replacement = function() { | |
| 1425 | - return repStr; | |
| 1426 | - }; | |
| 1427 | - } | |
| 1428 | - var matchPos = rgxFindMatchPos(str, left, right, flags), finalStr = str, lng = matchPos.length; | |
| 1429 | - if (lng > 0) { | |
| 1430 | - var bits = []; | |
| 1431 | - if (matchPos[0].wholeMatch.start !== 0) { | |
| 1432 | - bits.push(str.slice(0, matchPos[0].wholeMatch.start)); | |
| 1433 | - } | |
| 1434 | - for (var i2 = 0; i2 < lng; ++i2) { | |
| 1435 | - bits.push( | |
| 1436 | - replacement( | |
| 1437 | - str.slice(matchPos[i2].wholeMatch.start, matchPos[i2].wholeMatch.end), | |
| 1438 | - str.slice(matchPos[i2].match.start, matchPos[i2].match.end), | |
| 1439 | - str.slice(matchPos[i2].left.start, matchPos[i2].left.end), | |
| 1440 | - str.slice(matchPos[i2].right.start, matchPos[i2].right.end) | |
| 1441 | - ) | |
| 1442 | - ); | |
| 1443 | - if (i2 < lng - 1) { | |
| 1444 | - bits.push(str.slice(matchPos[i2].wholeMatch.end, matchPos[i2 + 1].wholeMatch.start)); | |
| 1445 | - } | |
| 1446 | - } | |
| 1447 | - if (matchPos[lng - 1].wholeMatch.end < str.length) { | |
| 1448 | - bits.push(str.slice(matchPos[lng - 1].wholeMatch.end)); | |
| 1449 | - } | |
| 1450 | - finalStr = bits.join(""); | |
| 1451 | - } | |
| 1452 | - return finalStr; | |
| 1453 | - }; | |
| 1454 | - showdown2.helper.regexIndexOf = function(str, regex, fromIndex) { | |
| 1455 | - "use strict"; | |
| 1456 | - if (!showdown2.helper.isString(str)) { | |
| 1457 | - throw "InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string"; | |
| 1458 | - } | |
| 1459 | - if (regex instanceof RegExp === false) { | |
| 1460 | - throw "InvalidArgumentError: second parameter of showdown.helper.regexIndexOf function must be an instance of RegExp"; | |
| 1461 | - } | |
| 1462 | - var indexOf = str.substring(fromIndex || 0).search(regex); | |
| 1463 | - return indexOf >= 0 ? indexOf + (fromIndex || 0) : indexOf; | |
| 1464 | - }; | |
| 1465 | - showdown2.helper.splitAtIndex = function(str, index) { | |
| 1466 | - "use strict"; | |
| 1467 | - if (!showdown2.helper.isString(str)) { | |
| 1468 | - throw "InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string"; | |
| 1469 | - } | |
| 1470 | - return [str.substring(0, index), str.substring(index)]; | |
| 1471 | - }; | |
| 1472 | - showdown2.helper.encodeEmailAddress = function(mail) { | |
| 1473 | - "use strict"; | |
| 1474 | - var encode = [ | |
| 1475 | - function(ch) { | |
| 1476 | - return "&#" + ch.charCodeAt(0) + ";"; | |
| 1477 | - }, | |
| 1478 | - function(ch) { | |
| 1479 | - return "&#x" + ch.charCodeAt(0).toString(16) + ";"; | |
| 1480 | - }, | |
| 1481 | - function(ch) { | |
| 1482 | - return ch; | |
| 1483 | - } | |
| 1484 | - ]; | |
| 1485 | - mail = mail.replace(/./g, function(ch) { | |
| 1486 | - if (ch === "@") { | |
| 1487 | - ch = encode[Math.floor(Math.random() * 2)](ch); | |
| 1488 | - } else { | |
| 1489 | - var r2 = Math.random(); | |
| 1490 | - ch = r2 > 0.9 ? encode[2](ch) : r2 > 0.45 ? encode[1](ch) : encode[0](ch); | |
| 1491 | - } | |
| 1492 | - return ch; | |
| 1493 | - }); | |
| 1494 | - return mail; | |
| 1495 | - }; | |
| 1496 | - showdown2.helper.padEnd = function padEnd(str, targetLength, padString) { | |
| 1497 | - "use strict"; | |
| 1498 | - targetLength = targetLength >> 0; | |
| 1499 | - padString = String(padString || " "); | |
| 1500 | - if (str.length > targetLength) { | |
| 1501 | - return String(str); | |
| 1502 | - } else { | |
| 1503 | - targetLength = targetLength - str.length; | |
| 1504 | - if (targetLength > padString.length) { | |
| 1505 | - padString += padString.repeat(targetLength / padString.length); | |
| 1506 | - } | |
| 1507 | - return String(str) + padString.slice(0, targetLength); | |
| 1508 | - } | |
| 1509 | - }; | |
| 1510 | - if (typeof console === "undefined") { | |
| 1511 | - console = { | |
| 1512 | - warn: function(msg) { | |
| 1513 | - "use strict"; | |
| 1514 | - alert(msg); | |
| 1515 | - }, | |
| 1516 | - log: function(msg) { | |
| 1517 | - "use strict"; | |
| 1518 | - alert(msg); | |
| 1519 | - }, | |
| 1520 | - error: function(msg) { | |
| 1521 | - "use strict"; | |
| 1522 | - throw msg; | |
| 1523 | - } | |
| 1524 | - }; | |
| 1525 | - } | |
| 1526 | - showdown2.helper.regexes = { | |
| 1527 | - asteriskDashAndColon: /([*_:~])/g | |
| 1528 | - }; | |
| 1529 | - showdown2.helper.emojis = { | |
| 1530 | - "+1": "\u{1F44D}", | |
| 1531 | - "-1": "\u{1F44E}", | |
| 1532 | - "100": "\u{1F4AF}", | |
| 1533 | - "1234": "\u{1F522}", | |
| 1534 | - "1st_place_medal": "\u{1F947}", | |
| 1535 | - "2nd_place_medal": "\u{1F948}", | |
| 1536 | - "3rd_place_medal": "\u{1F949}", | |
| 1537 | - "8ball": "\u{1F3B1}", | |
| 1538 | - "a": "\u{1F170}\uFE0F", | |
| 1539 | - "ab": "\u{1F18E}", | |
| 1540 | - "abc": "\u{1F524}", | |
| 1541 | - "abcd": "\u{1F521}", | |
| 1542 | - "accept": "\u{1F251}", | |
| 1543 | - "aerial_tramway": "\u{1F6A1}", | |
| 1544 | - "airplane": "\u2708\uFE0F", | |
| 1545 | - "alarm_clock": "\u23F0", | |
| 1546 | - "alembic": "\u2697\uFE0F", | |
| 1547 | - "alien": "\u{1F47D}", | |
| 1548 | - "ambulance": "\u{1F691}", | |
| 1549 | - "amphora": "\u{1F3FA}", | |
| 1550 | - "anchor": "\u2693\uFE0F", | |
| 1551 | - "angel": "\u{1F47C}", | |
| 1552 | - "anger": "\u{1F4A2}", | |
| 1553 | - "angry": "\u{1F620}", | |
| 1554 | - "anguished": "\u{1F627}", | |
| 1555 | - "ant": "\u{1F41C}", | |
| 1556 | - "apple": "\u{1F34E}", | |
| 1557 | - "aquarius": "\u2652\uFE0F", | |
| 1558 | - "aries": "\u2648\uFE0F", | |
| 1559 | - "arrow_backward": "\u25C0\uFE0F", | |
| 1560 | - "arrow_double_down": "\u23EC", | |
| 1561 | - "arrow_double_up": "\u23EB", | |
| 1562 | - "arrow_down": "\u2B07\uFE0F", | |
| 1563 | - "arrow_down_small": "\u{1F53D}", | |
| 1564 | - "arrow_forward": "\u25B6\uFE0F", | |
| 1565 | - "arrow_heading_down": "\u2935\uFE0F", | |
| 1566 | - "arrow_heading_up": "\u2934\uFE0F", | |
| 1567 | - "arrow_left": "\u2B05\uFE0F", | |
| 1568 | - "arrow_lower_left": "\u2199\uFE0F", | |
| 1569 | - "arrow_lower_right": "\u2198\uFE0F", | |
| 1570 | - "arrow_right": "\u27A1\uFE0F", | |
| 1571 | - "arrow_right_hook": "\u21AA\uFE0F", | |
| 1572 | - "arrow_up": "\u2B06\uFE0F", | |
| 1573 | - "arrow_up_down": "\u2195\uFE0F", | |
| 1574 | - "arrow_up_small": "\u{1F53C}", | |
| 1575 | - "arrow_upper_left": "\u2196\uFE0F", | |
| 1576 | - "arrow_upper_right": "\u2197\uFE0F", | |
| 1577 | - "arrows_clockwise": "\u{1F503}", | |
| 1578 | - "arrows_counterclockwise": "\u{1F504}", | |
| 1579 | - "art": "\u{1F3A8}", | |
| 1580 | - "articulated_lorry": "\u{1F69B}", | |
| 1581 | - "artificial_satellite": "\u{1F6F0}", | |
| 1582 | - "astonished": "\u{1F632}", | |
| 1583 | - "athletic_shoe": "\u{1F45F}", | |
| 1584 | - "atm": "\u{1F3E7}", | |
| 1585 | - "atom_symbol": "\u269B\uFE0F", | |
| 1586 | - "avocado": "\u{1F951}", | |
| 1587 | - "b": "\u{1F171}\uFE0F", | |
| 1588 | - "baby": "\u{1F476}", | |
| 1589 | - "baby_bottle": "\u{1F37C}", | |
| 1590 | - "baby_chick": "\u{1F424}", | |
| 1591 | - "baby_symbol": "\u{1F6BC}", | |
| 1592 | - "back": "\u{1F519}", | |
| 1593 | - "bacon": "\u{1F953}", | |
| 1594 | - "badminton": "\u{1F3F8}", | |
| 1595 | - "baggage_claim": "\u{1F6C4}", | |
| 1596 | - "baguette_bread": "\u{1F956}", | |
| 1597 | - "balance_scale": "\u2696\uFE0F", | |
| 1598 | - "balloon": "\u{1F388}", | |
| 1599 | - "ballot_box": "\u{1F5F3}", | |
| 1600 | - "ballot_box_with_check": "\u2611\uFE0F", | |
| 1601 | - "bamboo": "\u{1F38D}", | |
| 1602 | - "banana": "\u{1F34C}", | |
| 1603 | - "bangbang": "\u203C\uFE0F", | |
| 1604 | - "bank": "\u{1F3E6}", | |
| 1605 | - "bar_chart": "\u{1F4CA}", | |
| 1606 | - "barber": "\u{1F488}", | |
| 1607 | - "baseball": "\u26BE\uFE0F", | |
| 1608 | - "basketball": "\u{1F3C0}", | |
| 1609 | - "basketball_man": "\u26F9\uFE0F", | |
| 1610 | - "basketball_woman": "\u26F9\uFE0F‍\u2640\uFE0F", | |
| 1611 | - "bat": "\u{1F987}", | |
| 1612 | - "bath": "\u{1F6C0}", | |
| 1613 | - "bathtub": "\u{1F6C1}", | |
| 1614 | - "battery": "\u{1F50B}", | |
| 1615 | - "beach_umbrella": "\u{1F3D6}", | |
| 1616 | - "bear": "\u{1F43B}", | |
| 1617 | - "bed": "\u{1F6CF}", | |
| 1618 | - "bee": "\u{1F41D}", | |
| 1619 | - "beer": "\u{1F37A}", | |
| 1620 | - "beers": "\u{1F37B}", | |
| 1621 | - "beetle": "\u{1F41E}", | |
| 1622 | - "beginner": "\u{1F530}", | |
| 1623 | - "bell": "\u{1F514}", | |
| 1624 | - "bellhop_bell": "\u{1F6CE}", | |
| 1625 | - "bento": "\u{1F371}", | |
| 1626 | - "biking_man": "\u{1F6B4}", | |
| 1627 | - "bike": "\u{1F6B2}", | |
| 1628 | - "biking_woman": "\u{1F6B4}‍\u2640\uFE0F", | |
| 1629 | - "bikini": "\u{1F459}", | |
| 1630 | - "biohazard": "\u2623\uFE0F", | |
| 1631 | - "bird": "\u{1F426}", | |
| 1632 | - "birthday": "\u{1F382}", | |
| 1633 | - "black_circle": "\u26AB\uFE0F", | |
| 1634 | - "black_flag": "\u{1F3F4}", | |
| 1635 | - "black_heart": "\u{1F5A4}", | |
| 1636 | - "black_joker": "\u{1F0CF}", | |
| 1637 | - "black_large_square": "\u2B1B\uFE0F", | |
| 1638 | - "black_medium_small_square": "\u25FE\uFE0F", | |
| 1639 | - "black_medium_square": "\u25FC\uFE0F", | |
| 1640 | - "black_nib": "\u2712\uFE0F", | |
| 1641 | - "black_small_square": "\u25AA\uFE0F", | |
| 1642 | - "black_square_button": "\u{1F532}", | |
| 1643 | - "blonde_man": "\u{1F471}", | |
| 1644 | - "blonde_woman": "\u{1F471}‍\u2640\uFE0F", | |
| 1645 | - "blossom": "\u{1F33C}", | |
| 1646 | - "blowfish": "\u{1F421}", | |
| 1647 | - "blue_book": "\u{1F4D8}", | |
| 1648 | - "blue_car": "\u{1F699}", | |
| 1649 | - "blue_heart": "\u{1F499}", | |
| 1650 | - "blush": "\u{1F60A}", | |
| 1651 | - "boar": "\u{1F417}", | |
| 1652 | - "boat": "\u26F5\uFE0F", | |
| 1653 | - "bomb": "\u{1F4A3}", | |
| 1654 | - "book": "\u{1F4D6}", | |
| 1655 | - "bookmark": "\u{1F516}", | |
| 1656 | - "bookmark_tabs": "\u{1F4D1}", | |
| 1657 | - "books": "\u{1F4DA}", | |
| 1658 | - "boom": "\u{1F4A5}", | |
| 1659 | - "boot": "\u{1F462}", | |
| 1660 | - "bouquet": "\u{1F490}", | |
| 1661 | - "bowing_man": "\u{1F647}", | |
| 1662 | - "bow_and_arrow": "\u{1F3F9}", | |
| 1663 | - "bowing_woman": "\u{1F647}‍\u2640\uFE0F", | |
| 1664 | - "bowling": "\u{1F3B3}", | |
| 1665 | - "boxing_glove": "\u{1F94A}", | |
| 1666 | - "boy": "\u{1F466}", | |
| 1667 | - "bread": "\u{1F35E}", | |
| 1668 | - "bride_with_veil": "\u{1F470}", | |
| 1669 | - "bridge_at_night": "\u{1F309}", | |
| 1670 | - "briefcase": "\u{1F4BC}", | |
| 1671 | - "broken_heart": "\u{1F494}", | |
| 1672 | - "bug": "\u{1F41B}", | |
| 1673 | - "building_construction": "\u{1F3D7}", | |
| 1674 | - "bulb": "\u{1F4A1}", | |
| 1675 | - "bullettrain_front": "\u{1F685}", | |
| 1676 | - "bullettrain_side": "\u{1F684}", | |
| 1677 | - "burrito": "\u{1F32F}", | |
| 1678 | - "bus": "\u{1F68C}", | |
| 1679 | - "business_suit_levitating": "\u{1F574}", | |
| 1680 | - "busstop": "\u{1F68F}", | |
| 1681 | - "bust_in_silhouette": "\u{1F464}", | |
| 1682 | - "busts_in_silhouette": "\u{1F465}", | |
| 1683 | - "butterfly": "\u{1F98B}", | |
| 1684 | - "cactus": "\u{1F335}", | |
| 1685 | - "cake": "\u{1F370}", | |
| 1686 | - "calendar": "\u{1F4C6}", | |
| 1687 | - "call_me_hand": "\u{1F919}", | |
| 1688 | - "calling": "\u{1F4F2}", | |
| 1689 | - "camel": "\u{1F42B}", | |
| 1690 | - "camera": "\u{1F4F7}", | |
| 1691 | - "camera_flash": "\u{1F4F8}", | |
| 1692 | - "camping": "\u{1F3D5}", | |
| 1693 | - "cancer": "\u264B\uFE0F", | |
| 1694 | - "candle": "\u{1F56F}", | |
| 1695 | - "candy": "\u{1F36C}", | |
| 1696 | - "canoe": "\u{1F6F6}", | |
| 1697 | - "capital_abcd": "\u{1F520}", | |
| 1698 | - "capricorn": "\u2651\uFE0F", | |
| 1699 | - "car": "\u{1F697}", | |
| 1700 | - "card_file_box": "\u{1F5C3}", | |
| 1701 | - "card_index": "\u{1F4C7}", | |
| 1702 | - "card_index_dividers": "\u{1F5C2}", | |
| 1703 | - "carousel_horse": "\u{1F3A0}", | |
| 1704 | - "carrot": "\u{1F955}", | |
| 1705 | - "cat": "\u{1F431}", | |
| 1706 | - "cat2": "\u{1F408}", | |
| 1707 | - "cd": "\u{1F4BF}", | |
| 1708 | - "chains": "\u26D3", | |
| 1709 | - "champagne": "\u{1F37E}", | |
| 1710 | - "chart": "\u{1F4B9}", | |
| 1711 | - "chart_with_downwards_trend": "\u{1F4C9}", | |
| 1712 | - "chart_with_upwards_trend": "\u{1F4C8}", | |
| 1713 | - "checkered_flag": "\u{1F3C1}", | |
| 1714 | - "cheese": "\u{1F9C0}", | |
| 1715 | - "cherries": "\u{1F352}", | |
| 1716 | - "cherry_blossom": "\u{1F338}", | |
| 1717 | - "chestnut": "\u{1F330}", | |
| 1718 | - "chicken": "\u{1F414}", | |
| 1719 | - "children_crossing": "\u{1F6B8}", | |
| 1720 | - "chipmunk": "\u{1F43F}", | |
| 1721 | - "chocolate_bar": "\u{1F36B}", | |
| 1722 | - "christmas_tree": "\u{1F384}", | |
| 1723 | - "church": "\u26EA\uFE0F", | |
| 1724 | - "cinema": "\u{1F3A6}", | |
| 1725 | - "circus_tent": "\u{1F3AA}", | |
| 1726 | - "city_sunrise": "\u{1F307}", | |
| 1727 | - "city_sunset": "\u{1F306}", | |
| 1728 | - "cityscape": "\u{1F3D9}", | |
| 1729 | - "cl": "\u{1F191}", | |
| 1730 | - "clamp": "\u{1F5DC}", | |
| 1731 | - "clap": "\u{1F44F}", | |
| 1732 | - "clapper": "\u{1F3AC}", | |
| 1733 | - "classical_building": "\u{1F3DB}", | |
| 1734 | - "clinking_glasses": "\u{1F942}", | |
| 1735 | - "clipboard": "\u{1F4CB}", | |
| 1736 | - "clock1": "\u{1F550}", | |
| 1737 | - "clock10": "\u{1F559}", | |
| 1738 | - "clock1030": "\u{1F565}", | |
| 1739 | - "clock11": "\u{1F55A}", | |
| 1740 | - "clock1130": "\u{1F566}", | |
| 1741 | - "clock12": "\u{1F55B}", | |
| 1742 | - "clock1230": "\u{1F567}", | |
| 1743 | - "clock130": "\u{1F55C}", | |
| 1744 | - "clock2": "\u{1F551}", | |
| 1745 | - "clock230": "\u{1F55D}", | |
| 1746 | - "clock3": "\u{1F552}", | |
| 1747 | - "clock330": "\u{1F55E}", | |
| 1748 | - "clock4": "\u{1F553}", | |
| 1749 | - "clock430": "\u{1F55F}", | |
| 1750 | - "clock5": "\u{1F554}", | |
| 1751 | - "clock530": "\u{1F560}", | |
| 1752 | - "clock6": "\u{1F555}", | |
| 1753 | - "clock630": "\u{1F561}", | |
| 1754 | - "clock7": "\u{1F556}", | |
| 1755 | - "clock730": "\u{1F562}", | |
| 1756 | - "clock8": "\u{1F557}", | |
| 1757 | - "clock830": "\u{1F563}", | |
| 1758 | - "clock9": "\u{1F558}", | |
| 1759 | - "clock930": "\u{1F564}", | |
| 1760 | - "closed_book": "\u{1F4D5}", | |
| 1761 | - "closed_lock_with_key": "\u{1F510}", | |
| 1762 | - "closed_umbrella": "\u{1F302}", | |
| 1763 | - "cloud": "\u2601\uFE0F", | |
| 1764 | - "cloud_with_lightning": "\u{1F329}", | |
| 1765 | - "cloud_with_lightning_and_rain": "\u26C8", | |
| 1766 | - "cloud_with_rain": "\u{1F327}", | |
| 1767 | - "cloud_with_snow": "\u{1F328}", | |
| 1768 | - "clown_face": "\u{1F921}", | |
| 1769 | - "clubs": "\u2663\uFE0F", | |
| 1770 | - "cocktail": "\u{1F378}", | |
| 1771 | - "coffee": "\u2615\uFE0F", | |
| 1772 | - "coffin": "\u26B0\uFE0F", | |
| 1773 | - "cold_sweat": "\u{1F630}", | |
| 1774 | - "comet": "\u2604\uFE0F", | |
| 1775 | - "computer": "\u{1F4BB}", | |
| 1776 | - "computer_mouse": "\u{1F5B1}", | |
| 1777 | - "confetti_ball": "\u{1F38A}", | |
| 1778 | - "confounded": "\u{1F616}", | |
| 1779 | - "confused": "\u{1F615}", | |
| 1780 | - "congratulations": "\u3297\uFE0F", | |
| 1781 | - "construction": "\u{1F6A7}", | |
| 1782 | - "construction_worker_man": "\u{1F477}", | |
| 1783 | - "construction_worker_woman": "\u{1F477}‍\u2640\uFE0F", | |
| 1784 | - "control_knobs": "\u{1F39B}", | |
| 1785 | - "convenience_store": "\u{1F3EA}", | |
| 1786 | - "cookie": "\u{1F36A}", | |
| 1787 | - "cool": "\u{1F192}", | |
| 1788 | - "policeman": "\u{1F46E}", | |
| 1789 | - "copyright": "\xA9\uFE0F", | |
| 1790 | - "corn": "\u{1F33D}", | |
| 1791 | - "couch_and_lamp": "\u{1F6CB}", | |
| 1792 | - "couple": "\u{1F46B}", | |
| 1793 | - "couple_with_heart_woman_man": "\u{1F491}", | |
| 1794 | - "couple_with_heart_man_man": "\u{1F468}‍\u2764\uFE0F‍\u{1F468}", | |
| 1795 | - "couple_with_heart_woman_woman": "\u{1F469}‍\u2764\uFE0F‍\u{1F469}", | |
| 1796 | - "couplekiss_man_man": "\u{1F468}‍\u2764\uFE0F‍\u{1F48B}‍\u{1F468}", | |
| 1797 | - "couplekiss_man_woman": "\u{1F48F}", | |
| 1798 | - "couplekiss_woman_woman": "\u{1F469}‍\u2764\uFE0F‍\u{1F48B}‍\u{1F469}", | |
| 1799 | - "cow": "\u{1F42E}", | |
| 1800 | - "cow2": "\u{1F404}", | |
| 1801 | - "cowboy_hat_face": "\u{1F920}", | |
| 1802 | - "crab": "\u{1F980}", | |
| 1803 | - "crayon": "\u{1F58D}", | |
| 1804 | - "credit_card": "\u{1F4B3}", | |
| 1805 | - "crescent_moon": "\u{1F319}", | |
| 1806 | - "cricket": "\u{1F3CF}", | |
| 1807 | - "crocodile": "\u{1F40A}", | |
| 1808 | - "croissant": "\u{1F950}", | |
| 1809 | - "crossed_fingers": "\u{1F91E}", | |
| 1810 | - "crossed_flags": "\u{1F38C}", | |
| 1811 | - "crossed_swords": "\u2694\uFE0F", | |
| 1812 | - "crown": "\u{1F451}", | |
| 1813 | - "cry": "\u{1F622}", | |
| 1814 | - "crying_cat_face": "\u{1F63F}", | |
| 1815 | - "crystal_ball": "\u{1F52E}", | |
| 1816 | - "cucumber": "\u{1F952}", | |
| 1817 | - "cupid": "\u{1F498}", | |
| 1818 | - "curly_loop": "\u27B0", | |
| 1819 | - "currency_exchange": "\u{1F4B1}", | |
| 1820 | - "curry": "\u{1F35B}", | |
| 1821 | - "custard": "\u{1F36E}", | |
| 1822 | - "customs": "\u{1F6C3}", | |
| 1823 | - "cyclone": "\u{1F300}", | |
| 1824 | - "dagger": "\u{1F5E1}", | |
| 1825 | - "dancer": "\u{1F483}", | |
| 1826 | - "dancing_women": "\u{1F46F}", | |
| 1827 | - "dancing_men": "\u{1F46F}‍\u2642\uFE0F", | |
| 1828 | - "dango": "\u{1F361}", | |
| 1829 | - "dark_sunglasses": "\u{1F576}", | |
| 1830 | - "dart": "\u{1F3AF}", | |
| 1831 | - "dash": "\u{1F4A8}", | |
| 1832 | - "date": "\u{1F4C5}", | |
| 1833 | - "deciduous_tree": "\u{1F333}", | |
| 1834 | - "deer": "\u{1F98C}", | |
| 1835 | - "department_store": "\u{1F3EC}", | |
| 1836 | - "derelict_house": "\u{1F3DA}", | |
| 1837 | - "desert": "\u{1F3DC}", | |
| 1838 | - "desert_island": "\u{1F3DD}", | |
| 1839 | - "desktop_computer": "\u{1F5A5}", | |
| 1840 | - "male_detective": "\u{1F575}\uFE0F", | |
| 1841 | - "diamond_shape_with_a_dot_inside": "\u{1F4A0}", | |
| 1842 | - "diamonds": "\u2666\uFE0F", | |
| 1843 | - "disappointed": "\u{1F61E}", | |
| 1844 | - "disappointed_relieved": "\u{1F625}", | |
| 1845 | - "dizzy": "\u{1F4AB}", | |
| 1846 | - "dizzy_face": "\u{1F635}", | |
| 1847 | - "do_not_litter": "\u{1F6AF}", | |
| 1848 | - "dog": "\u{1F436}", | |
| 1849 | - "dog2": "\u{1F415}", | |
| 1850 | - "dollar": "\u{1F4B5}", | |
| 1851 | - "dolls": "\u{1F38E}", | |
| 1852 | - "dolphin": "\u{1F42C}", | |
| 1853 | - "door": "\u{1F6AA}", | |
| 1854 | - "doughnut": "\u{1F369}", | |
| 1855 | - "dove": "\u{1F54A}", | |
| 1856 | - "dragon": "\u{1F409}", | |
| 1857 | - "dragon_face": "\u{1F432}", | |
| 1858 | - "dress": "\u{1F457}", | |
| 1859 | - "dromedary_camel": "\u{1F42A}", | |
| 1860 | - "drooling_face": "\u{1F924}", | |
| 1861 | - "droplet": "\u{1F4A7}", | |
| 1862 | - "drum": "\u{1F941}", | |
| 1863 | - "duck": "\u{1F986}", | |
| 1864 | - "dvd": "\u{1F4C0}", | |
| 1865 | - "e-mail": "\u{1F4E7}", | |
| 1866 | - "eagle": "\u{1F985}", | |
| 1867 | - "ear": "\u{1F442}", | |
| 1868 | - "ear_of_rice": "\u{1F33E}", | |
| 1869 | - "earth_africa": "\u{1F30D}", | |
| 1870 | - "earth_americas": "\u{1F30E}", | |
| 1871 | - "earth_asia": "\u{1F30F}", | |
| 1872 | - "egg": "\u{1F95A}", | |
| 1873 | - "eggplant": "\u{1F346}", | |
| 1874 | - "eight_pointed_black_star": "\u2734\uFE0F", | |
| 1875 | - "eight_spoked_asterisk": "\u2733\uFE0F", | |
| 1876 | - "electric_plug": "\u{1F50C}", | |
| 1877 | - "elephant": "\u{1F418}", | |
| 1878 | - "email": "\u2709\uFE0F", | |
| 1879 | - "end": "\u{1F51A}", | |
| 1880 | - "envelope_with_arrow": "\u{1F4E9}", | |
| 1881 | - "euro": "\u{1F4B6}", | |
| 1882 | - "european_castle": "\u{1F3F0}", | |
| 1883 | - "european_post_office": "\u{1F3E4}", | |
| 1884 | - "evergreen_tree": "\u{1F332}", | |
| 1885 | - "exclamation": "\u2757\uFE0F", | |
| 1886 | - "expressionless": "\u{1F611}", | |
| 1887 | - "eye": "\u{1F441}", | |
| 1888 | - "eye_speech_bubble": "\u{1F441}‍\u{1F5E8}", | |
| 1889 | - "eyeglasses": "\u{1F453}", | |
| 1890 | - "eyes": "\u{1F440}", | |
| 1891 | - "face_with_head_bandage": "\u{1F915}", | |
| 1892 | - "face_with_thermometer": "\u{1F912}", | |
| 1893 | - "fist_oncoming": "\u{1F44A}", | |
| 1894 | - "factory": "\u{1F3ED}", | |
| 1895 | - "fallen_leaf": "\u{1F342}", | |
| 1896 | - "family_man_woman_boy": "\u{1F46A}", | |
| 1897 | - "family_man_boy": "\u{1F468}‍\u{1F466}", | |
| 1898 | - "family_man_boy_boy": "\u{1F468}‍\u{1F466}‍\u{1F466}", | |
| 1899 | - "family_man_girl": "\u{1F468}‍\u{1F467}", | |
| 1900 | - "family_man_girl_boy": "\u{1F468}‍\u{1F467}‍\u{1F466}", | |
| 1901 | - "family_man_girl_girl": "\u{1F468}‍\u{1F467}‍\u{1F467}", | |
| 1902 | - "family_man_man_boy": "\u{1F468}‍\u{1F468}‍\u{1F466}", | |
| 1903 | - "family_man_man_boy_boy": "\u{1F468}‍\u{1F468}‍\u{1F466}‍\u{1F466}", | |
| 1904 | - "family_man_man_girl": "\u{1F468}‍\u{1F468}‍\u{1F467}", | |
| 1905 | - "family_man_man_girl_boy": "\u{1F468}‍\u{1F468}‍\u{1F467}‍\u{1F466}", | |
| 1906 | - "family_man_man_girl_girl": "\u{1F468}‍\u{1F468}‍\u{1F467}‍\u{1F467}", | |
| 1907 | - "family_man_woman_boy_boy": "\u{1F468}‍\u{1F469}‍\u{1F466}‍\u{1F466}", | |
| 1908 | - "family_man_woman_girl": "\u{1F468}‍\u{1F469}‍\u{1F467}", | |
| 1909 | - "family_man_woman_girl_boy": "\u{1F468}‍\u{1F469}‍\u{1F467}‍\u{1F466}", | |
| 1910 | - "family_man_woman_girl_girl": "\u{1F468}‍\u{1F469}‍\u{1F467}‍\u{1F467}", | |
| 1911 | - "family_woman_boy": "\u{1F469}‍\u{1F466}", | |
| 1912 | - "family_woman_boy_boy": "\u{1F469}‍\u{1F466}‍\u{1F466}", | |
| 1913 | - "family_woman_girl": "\u{1F469}‍\u{1F467}", | |
| 1914 | - "family_woman_girl_boy": "\u{1F469}‍\u{1F467}‍\u{1F466}", | |
| 1915 | - "family_woman_girl_girl": "\u{1F469}‍\u{1F467}‍\u{1F467}", | |
| 1916 | - "family_woman_woman_boy": "\u{1F469}‍\u{1F469}‍\u{1F466}", | |
| 1917 | - "family_woman_woman_boy_boy": "\u{1F469}‍\u{1F469}‍\u{1F466}‍\u{1F466}", | |
| 1918 | - "family_woman_woman_girl": "\u{1F469}‍\u{1F469}‍\u{1F467}", | |
| 1919 | - "family_woman_woman_girl_boy": "\u{1F469}‍\u{1F469}‍\u{1F467}‍\u{1F466}", | |
| 1920 | - "family_woman_woman_girl_girl": "\u{1F469}‍\u{1F469}‍\u{1F467}‍\u{1F467}", | |
| 1921 | - "fast_forward": "\u23E9", | |
| 1922 | - "fax": "\u{1F4E0}", | |
| 1923 | - "fearful": "\u{1F628}", | |
| 1924 | - "feet": "\u{1F43E}", | |
| 1925 | - "female_detective": "\u{1F575}\uFE0F‍\u2640\uFE0F", | |
| 1926 | - "ferris_wheel": "\u{1F3A1}", | |
| 1927 | - "ferry": "\u26F4", | |
| 1928 | - "field_hockey": "\u{1F3D1}", | |
| 1929 | - "file_cabinet": "\u{1F5C4}", | |
| 1930 | - "file_folder": "\u{1F4C1}", | |
| 1931 | - "film_projector": "\u{1F4FD}", | |
| 1932 | - "film_strip": "\u{1F39E}", | |
| 1933 | - "fire": "\u{1F525}", | |
| 1934 | - "fire_engine": "\u{1F692}", | |
| 1935 | - "fireworks": "\u{1F386}", | |
| 1936 | - "first_quarter_moon": "\u{1F313}", | |
| 1937 | - "first_quarter_moon_with_face": "\u{1F31B}", | |
| 1938 | - "fish": "\u{1F41F}", | |
| 1939 | - "fish_cake": "\u{1F365}", | |
| 1940 | - "fishing_pole_and_fish": "\u{1F3A3}", | |
| 1941 | - "fist_raised": "\u270A", | |
| 1942 | - "fist_left": "\u{1F91B}", | |
| 1943 | - "fist_right": "\u{1F91C}", | |
| 1944 | - "flags": "\u{1F38F}", | |
| 1945 | - "flashlight": "\u{1F526}", | |
| 1946 | - "fleur_de_lis": "\u269C\uFE0F", | |
| 1947 | - "flight_arrival": "\u{1F6EC}", | |
| 1948 | - "flight_departure": "\u{1F6EB}", | |
| 1949 | - "floppy_disk": "\u{1F4BE}", | |
| 1950 | - "flower_playing_cards": "\u{1F3B4}", | |
| 1951 | - "flushed": "\u{1F633}", | |
| 1952 | - "fog": "\u{1F32B}", | |
| 1953 | - "foggy": "\u{1F301}", | |
| 1954 | - "football": "\u{1F3C8}", | |
| 1955 | - "footprints": "\u{1F463}", | |
| 1956 | - "fork_and_knife": "\u{1F374}", | |
| 1957 | - "fountain": "\u26F2\uFE0F", | |
| 1958 | - "fountain_pen": "\u{1F58B}", | |
| 1959 | - "four_leaf_clover": "\u{1F340}", | |
| 1960 | - "fox_face": "\u{1F98A}", | |
| 1961 | - "framed_picture": "\u{1F5BC}", | |
| 1962 | - "free": "\u{1F193}", | |
| 1963 | - "fried_egg": "\u{1F373}", | |
| 1964 | - "fried_shrimp": "\u{1F364}", | |
| 1965 | - "fries": "\u{1F35F}", | |
| 1966 | - "frog": "\u{1F438}", | |
| 1967 | - "frowning": "\u{1F626}", | |
| 1968 | - "frowning_face": "\u2639\uFE0F", | |
| 1969 | - "frowning_man": "\u{1F64D}‍\u2642\uFE0F", | |
| 1970 | - "frowning_woman": "\u{1F64D}", | |
| 1971 | - "middle_finger": "\u{1F595}", | |
| 1972 | - "fuelpump": "\u26FD\uFE0F", | |
| 1973 | - "full_moon": "\u{1F315}", | |
| 1974 | - "full_moon_with_face": "\u{1F31D}", | |
| 1975 | - "funeral_urn": "\u26B1\uFE0F", | |
| 1976 | - "game_die": "\u{1F3B2}", | |
| 1977 | - "gear": "\u2699\uFE0F", | |
| 1978 | - "gem": "\u{1F48E}", | |
| 1979 | - "gemini": "\u264A\uFE0F", | |
| 1980 | - "ghost": "\u{1F47B}", | |
| 1981 | - "gift": "\u{1F381}", | |
| 1982 | - "gift_heart": "\u{1F49D}", | |
| 1983 | - "girl": "\u{1F467}", | |
| 1984 | - "globe_with_meridians": "\u{1F310}", | |
| 1985 | - "goal_net": "\u{1F945}", | |
| 1986 | - "goat": "\u{1F410}", | |
| 1987 | - "golf": "\u26F3\uFE0F", | |
| 1988 | - "golfing_man": "\u{1F3CC}\uFE0F", | |
| 1989 | - "golfing_woman": "\u{1F3CC}\uFE0F‍\u2640\uFE0F", | |
| 1990 | - "gorilla": "\u{1F98D}", | |
| 1991 | - "grapes": "\u{1F347}", | |
| 1992 | - "green_apple": "\u{1F34F}", | |
| 1993 | - "green_book": "\u{1F4D7}", | |
| 1994 | - "green_heart": "\u{1F49A}", | |
| 1995 | - "green_salad": "\u{1F957}", | |
| 1996 | - "grey_exclamation": "\u2755", | |
| 1997 | - "grey_question": "\u2754", | |
| 1998 | - "grimacing": "\u{1F62C}", | |
| 1999 | - "grin": "\u{1F601}", | |
| 2000 | - "grinning": "\u{1F600}", | |
| 2001 | - "guardsman": "\u{1F482}", | |
| 2002 | - "guardswoman": "\u{1F482}‍\u2640\uFE0F", | |
| 2003 | - "guitar": "\u{1F3B8}", | |
| 2004 | - "gun": "\u{1F52B}", | |
| 2005 | - "haircut_woman": "\u{1F487}", | |
| 2006 | - "haircut_man": "\u{1F487}‍\u2642\uFE0F", | |
| 2007 | - "hamburger": "\u{1F354}", | |
| 2008 | - "hammer": "\u{1F528}", | |
| 2009 | - "hammer_and_pick": "\u2692", | |
| 2010 | - "hammer_and_wrench": "\u{1F6E0}", | |
| 2011 | - "hamster": "\u{1F439}", | |
| 2012 | - "hand": "\u270B", | |
| 2013 | - "handbag": "\u{1F45C}", | |
| 2014 | - "handshake": "\u{1F91D}", | |
| 2015 | - "hankey": "\u{1F4A9}", | |
| 2016 | - "hatched_chick": "\u{1F425}", | |
| 2017 | - "hatching_chick": "\u{1F423}", | |
| 2018 | - "headphones": "\u{1F3A7}", | |
| 2019 | - "hear_no_evil": "\u{1F649}", | |
| 2020 | - "heart": "\u2764\uFE0F", | |
| 2021 | - "heart_decoration": "\u{1F49F}", | |
| 2022 | - "heart_eyes": "\u{1F60D}", | |
| 2023 | - "heart_eyes_cat": "\u{1F63B}", | |
| 2024 | - "heartbeat": "\u{1F493}", | |
| 2025 | - "heartpulse": "\u{1F497}", | |
| 2026 | - "hearts": "\u2665\uFE0F", | |
| 2027 | - "heavy_check_mark": "\u2714\uFE0F", | |
| 2028 | - "heavy_division_sign": "\u2797", | |
| 2029 | - "heavy_dollar_sign": "\u{1F4B2}", | |
| 2030 | - "heavy_heart_exclamation": "\u2763\uFE0F", | |
| 2031 | - "heavy_minus_sign": "\u2796", | |
| 2032 | - "heavy_multiplication_x": "\u2716\uFE0F", | |
| 2033 | - "heavy_plus_sign": "\u2795", | |
| 2034 | - "helicopter": "\u{1F681}", | |
| 2035 | - "herb": "\u{1F33F}", | |
| 2036 | - "hibiscus": "\u{1F33A}", | |
| 2037 | - "high_brightness": "\u{1F506}", | |
| 2038 | - "high_heel": "\u{1F460}", | |
| 2039 | - "hocho": "\u{1F52A}", | |
| 2040 | - "hole": "\u{1F573}", | |
| 2041 | - "honey_pot": "\u{1F36F}", | |
| 2042 | - "horse": "\u{1F434}", | |
| 2043 | - "horse_racing": "\u{1F3C7}", | |
| 2044 | - "hospital": "\u{1F3E5}", | |
| 2045 | - "hot_pepper": "\u{1F336}", | |
| 2046 | - "hotdog": "\u{1F32D}", | |
| 2047 | - "hotel": "\u{1F3E8}", | |
| 2048 | - "hotsprings": "\u2668\uFE0F", | |
| 2049 | - "hourglass": "\u231B\uFE0F", | |
| 2050 | - "hourglass_flowing_sand": "\u23F3", | |
| 2051 | - "house": "\u{1F3E0}", | |
| 2052 | - "house_with_garden": "\u{1F3E1}", | |
| 2053 | - "houses": "\u{1F3D8}", | |
| 2054 | - "hugs": "\u{1F917}", | |
| 2055 | - "hushed": "\u{1F62F}", | |
| 2056 | - "ice_cream": "\u{1F368}", | |
| 2057 | - "ice_hockey": "\u{1F3D2}", | |
| 2058 | - "ice_skate": "\u26F8", | |
| 2059 | - "icecream": "\u{1F366}", | |
| 2060 | - "id": "\u{1F194}", | |
| 2061 | - "ideograph_advantage": "\u{1F250}", | |
| 2062 | - "imp": "\u{1F47F}", | |
| 2063 | - "inbox_tray": "\u{1F4E5}", | |
| 2064 | - "incoming_envelope": "\u{1F4E8}", | |
| 2065 | - "tipping_hand_woman": "\u{1F481}", | |
| 2066 | - "information_source": "\u2139\uFE0F", | |
| 2067 | - "innocent": "\u{1F607}", | |
| 2068 | - "interrobang": "\u2049\uFE0F", | |
| 2069 | - "iphone": "\u{1F4F1}", | |
| 2070 | - "izakaya_lantern": "\u{1F3EE}", | |
| 2071 | - "jack_o_lantern": "\u{1F383}", | |
| 2072 | - "japan": "\u{1F5FE}", | |
| 2073 | - "japanese_castle": "\u{1F3EF}", | |
| 2074 | - "japanese_goblin": "\u{1F47A}", | |
| 2075 | - "japanese_ogre": "\u{1F479}", | |
| 2076 | - "jeans": "\u{1F456}", | |
| 2077 | - "joy": "\u{1F602}", | |
| 2078 | - "joy_cat": "\u{1F639}", | |
| 2079 | - "joystick": "\u{1F579}", | |
| 2080 | - "kaaba": "\u{1F54B}", | |
| 2081 | - "key": "\u{1F511}", | |
| 2082 | - "keyboard": "\u2328\uFE0F", | |
| 2083 | - "keycap_ten": "\u{1F51F}", | |
| 2084 | - "kick_scooter": "\u{1F6F4}", | |
| 2085 | - "kimono": "\u{1F458}", | |
| 2086 | - "kiss": "\u{1F48B}", | |
| 2087 | - "kissing": "\u{1F617}", | |
| 2088 | - "kissing_cat": "\u{1F63D}", | |
| 2089 | - "kissing_closed_eyes": "\u{1F61A}", | |
| 2090 | - "kissing_heart": "\u{1F618}", | |
| 2091 | - "kissing_smiling_eyes": "\u{1F619}", | |
| 2092 | - "kiwi_fruit": "\u{1F95D}", | |
| 2093 | - "koala": "\u{1F428}", | |
| 2094 | - "koko": "\u{1F201}", | |
| 2095 | - "label": "\u{1F3F7}", | |
| 2096 | - "large_blue_circle": "\u{1F535}", | |
| 2097 | - "large_blue_diamond": "\u{1F537}", | |
| 2098 | - "large_orange_diamond": "\u{1F536}", | |
| 2099 | - "last_quarter_moon": "\u{1F317}", | |
| 2100 | - "last_quarter_moon_with_face": "\u{1F31C}", | |
| 2101 | - "latin_cross": "\u271D\uFE0F", | |
| 2102 | - "laughing": "\u{1F606}", | |
| 2103 | - "leaves": "\u{1F343}", | |
| 2104 | - "ledger": "\u{1F4D2}", | |
| 2105 | - "left_luggage": "\u{1F6C5}", | |
| 2106 | - "left_right_arrow": "\u2194\uFE0F", | |
| 2107 | - "leftwards_arrow_with_hook": "\u21A9\uFE0F", | |
| 2108 | - "lemon": "\u{1F34B}", | |
| 2109 | - "leo": "\u264C\uFE0F", | |
| 2110 | - "leopard": "\u{1F406}", | |
| 2111 | - "level_slider": "\u{1F39A}", | |
| 2112 | - "libra": "\u264E\uFE0F", | |
| 2113 | - "light_rail": "\u{1F688}", | |
| 2114 | - "link": "\u{1F517}", | |
| 2115 | - "lion": "\u{1F981}", | |
| 2116 | - "lips": "\u{1F444}", | |
| 2117 | - "lipstick": "\u{1F484}", | |
| 2118 | - "lizard": "\u{1F98E}", | |
| 2119 | - "lock": "\u{1F512}", | |
| 2120 | - "lock_with_ink_pen": "\u{1F50F}", | |
| 2121 | - "lollipop": "\u{1F36D}", | |
| 2122 | - "loop": "\u27BF", | |
| 2123 | - "loud_sound": "\u{1F50A}", | |
| 2124 | - "loudspeaker": "\u{1F4E2}", | |
| 2125 | - "love_hotel": "\u{1F3E9}", | |
| 2126 | - "love_letter": "\u{1F48C}", | |
| 2127 | - "low_brightness": "\u{1F505}", | |
| 2128 | - "lying_face": "\u{1F925}", | |
| 2129 | - "m": "\u24C2\uFE0F", | |
| 2130 | - "mag": "\u{1F50D}", | |
| 2131 | - "mag_right": "\u{1F50E}", | |
| 2132 | - "mahjong": "\u{1F004}\uFE0F", | |
| 2133 | - "mailbox": "\u{1F4EB}", | |
| 2134 | - "mailbox_closed": "\u{1F4EA}", | |
| 2135 | - "mailbox_with_mail": "\u{1F4EC}", | |
| 2136 | - "mailbox_with_no_mail": "\u{1F4ED}", | |
| 2137 | - "man": "\u{1F468}", | |
| 2138 | - "man_artist": "\u{1F468}‍\u{1F3A8}", | |
| 2139 | - "man_astronaut": "\u{1F468}‍\u{1F680}", | |
| 2140 | - "man_cartwheeling": "\u{1F938}‍\u2642\uFE0F", | |
| 2141 | - "man_cook": "\u{1F468}‍\u{1F373}", | |
| 2142 | - "man_dancing": "\u{1F57A}", | |
| 2143 | - "man_facepalming": "\u{1F926}‍\u2642\uFE0F", | |
| 2144 | - "man_factory_worker": "\u{1F468}‍\u{1F3ED}", | |
| 2145 | - "man_farmer": "\u{1F468}‍\u{1F33E}", | |
| 2146 | - "man_firefighter": "\u{1F468}‍\u{1F692}", | |
| 2147 | - "man_health_worker": "\u{1F468}‍\u2695\uFE0F", | |
| 2148 | - "man_in_tuxedo": "\u{1F935}", | |
| 2149 | - "man_judge": "\u{1F468}‍\u2696\uFE0F", | |
| 2150 | - "man_juggling": "\u{1F939}‍\u2642\uFE0F", | |
| 2151 | - "man_mechanic": "\u{1F468}‍\u{1F527}", | |
| 2152 | - "man_office_worker": "\u{1F468}‍\u{1F4BC}", | |
| 2153 | - "man_pilot": "\u{1F468}‍\u2708\uFE0F", | |
| 2154 | - "man_playing_handball": "\u{1F93E}‍\u2642\uFE0F", | |
| 2155 | - "man_playing_water_polo": "\u{1F93D}‍\u2642\uFE0F", | |
| 2156 | - "man_scientist": "\u{1F468}‍\u{1F52C}", | |
| 2157 | - "man_shrugging": "\u{1F937}‍\u2642\uFE0F", | |
| 2158 | - "man_singer": "\u{1F468}‍\u{1F3A4}", | |
| 2159 | - "man_student": "\u{1F468}‍\u{1F393}", | |
| 2160 | - "man_teacher": "\u{1F468}‍\u{1F3EB}", | |
| 2161 | - "man_technologist": "\u{1F468}‍\u{1F4BB}", | |
| 2162 | - "man_with_gua_pi_mao": "\u{1F472}", | |
| 2163 | - "man_with_turban": "\u{1F473}", | |
| 2164 | - "tangerine": "\u{1F34A}", | |
| 2165 | - "mans_shoe": "\u{1F45E}", | |
| 2166 | - "mantelpiece_clock": "\u{1F570}", | |
| 2167 | - "maple_leaf": "\u{1F341}", | |
| 2168 | - "martial_arts_uniform": "\u{1F94B}", | |
| 2169 | - "mask": "\u{1F637}", | |
| 2170 | - "massage_woman": "\u{1F486}", | |
| 2171 | - "massage_man": "\u{1F486}‍\u2642\uFE0F", | |
| 2172 | - "meat_on_bone": "\u{1F356}", | |
| 2173 | - "medal_military": "\u{1F396}", | |
| 2174 | - "medal_sports": "\u{1F3C5}", | |
| 2175 | - "mega": "\u{1F4E3}", | |
| 2176 | - "melon": "\u{1F348}", | |
| 2177 | - "memo": "\u{1F4DD}", | |
| 2178 | - "men_wrestling": "\u{1F93C}‍\u2642\uFE0F", | |
| 2179 | - "menorah": "\u{1F54E}", | |
| 2180 | - "mens": "\u{1F6B9}", | |
| 2181 | - "metal": "\u{1F918}", | |
| 2182 | - "metro": "\u{1F687}", | |
| 2183 | - "microphone": "\u{1F3A4}", | |
| 2184 | - "microscope": "\u{1F52C}", | |
| 2185 | - "milk_glass": "\u{1F95B}", | |
| 2186 | - "milky_way": "\u{1F30C}", | |
| 2187 | - "minibus": "\u{1F690}", | |
| 2188 | - "minidisc": "\u{1F4BD}", | |
| 2189 | - "mobile_phone_off": "\u{1F4F4}", | |
| 2190 | - "money_mouth_face": "\u{1F911}", | |
| 2191 | - "money_with_wings": "\u{1F4B8}", | |
| 2192 | - "moneybag": "\u{1F4B0}", | |
| 2193 | - "monkey": "\u{1F412}", | |
| 2194 | - "monkey_face": "\u{1F435}", | |
| 2195 | - "monorail": "\u{1F69D}", | |
| 2196 | - "moon": "\u{1F314}", | |
| 2197 | - "mortar_board": "\u{1F393}", | |
| 2198 | - "mosque": "\u{1F54C}", | |
| 2199 | - "motor_boat": "\u{1F6E5}", | |
| 2200 | - "motor_scooter": "\u{1F6F5}", | |
| 2201 | - "motorcycle": "\u{1F3CD}", | |
| 2202 | - "motorway": "\u{1F6E3}", | |
| 2203 | - "mount_fuji": "\u{1F5FB}", | |
| 2204 | - "mountain": "\u26F0", | |
| 2205 | - "mountain_biking_man": "\u{1F6B5}", | |
| 2206 | - "mountain_biking_woman": "\u{1F6B5}‍\u2640\uFE0F", | |
| 2207 | - "mountain_cableway": "\u{1F6A0}", | |
| 2208 | - "mountain_railway": "\u{1F69E}", | |
| 2209 | - "mountain_snow": "\u{1F3D4}", | |
| 2210 | - "mouse": "\u{1F42D}", | |
| 2211 | - "mouse2": "\u{1F401}", | |
| 2212 | - "movie_camera": "\u{1F3A5}", | |
| 2213 | - "moyai": "\u{1F5FF}", | |
| 2214 | - "mrs_claus": "\u{1F936}", | |
| 2215 | - "muscle": "\u{1F4AA}", | |
| 2216 | - "mushroom": "\u{1F344}", | |
| 2217 | - "musical_keyboard": "\u{1F3B9}", | |
| 2218 | - "musical_note": "\u{1F3B5}", | |
| 2219 | - "musical_score": "\u{1F3BC}", | |
| 2220 | - "mute": "\u{1F507}", | |
| 2221 | - "nail_care": "\u{1F485}", | |
| 2222 | - "name_badge": "\u{1F4DB}", | |
| 2223 | - "national_park": "\u{1F3DE}", | |
| 2224 | - "nauseated_face": "\u{1F922}", | |
| 2225 | - "necktie": "\u{1F454}", | |
| 2226 | - "negative_squared_cross_mark": "\u274E", | |
| 2227 | - "nerd_face": "\u{1F913}", | |
| 2228 | - "neutral_face": "\u{1F610}", | |
| 2229 | - "new": "\u{1F195}", | |
| 2230 | - "new_moon": "\u{1F311}", | |
| 2231 | - "new_moon_with_face": "\u{1F31A}", | |
| 2232 | - "newspaper": "\u{1F4F0}", | |
| 2233 | - "newspaper_roll": "\u{1F5DE}", | |
| 2234 | - "next_track_button": "\u23ED", | |
| 2235 | - "ng": "\u{1F196}", | |
| 2236 | - "no_good_man": "\u{1F645}‍\u2642\uFE0F", | |
| 2237 | - "no_good_woman": "\u{1F645}", | |
| 2238 | - "night_with_stars": "\u{1F303}", | |
| 2239 | - "no_bell": "\u{1F515}", | |
| 2240 | - "no_bicycles": "\u{1F6B3}", | |
| 2241 | - "no_entry": "\u26D4\uFE0F", | |
| 2242 | - "no_entry_sign": "\u{1F6AB}", | |
| 2243 | - "no_mobile_phones": "\u{1F4F5}", | |
| 2244 | - "no_mouth": "\u{1F636}", | |
| 2245 | - "no_pedestrians": "\u{1F6B7}", | |
| 2246 | - "no_smoking": "\u{1F6AD}", | |
| 2247 | - "non-potable_water": "\u{1F6B1}", | |
| 2248 | - "nose": "\u{1F443}", | |
| 2249 | - "notebook": "\u{1F4D3}", | |
| 2250 | - "notebook_with_decorative_cover": "\u{1F4D4}", | |
| 2251 | - "notes": "\u{1F3B6}", | |
| 2252 | - "nut_and_bolt": "\u{1F529}", | |
| 2253 | - "o": "\u2B55\uFE0F", | |
| 2254 | - "o2": "\u{1F17E}\uFE0F", | |
| 2255 | - "ocean": "\u{1F30A}", | |
| 2256 | - "octopus": "\u{1F419}", | |
| 2257 | - "oden": "\u{1F362}", | |
| 2258 | - "office": "\u{1F3E2}", | |
| 2259 | - "oil_drum": "\u{1F6E2}", | |
| 2260 | - "ok": "\u{1F197}", | |
| 2261 | - "ok_hand": "\u{1F44C}", | |
| 2262 | - "ok_man": "\u{1F646}‍\u2642\uFE0F", | |
| 2263 | - "ok_woman": "\u{1F646}", | |
| 2264 | - "old_key": "\u{1F5DD}", | |
| 2265 | - "older_man": "\u{1F474}", | |
| 2266 | - "older_woman": "\u{1F475}", | |
| 2267 | - "om": "\u{1F549}", | |
| 2268 | - "on": "\u{1F51B}", | |
| 2269 | - "oncoming_automobile": "\u{1F698}", | |
| 2270 | - "oncoming_bus": "\u{1F68D}", | |
| 2271 | - "oncoming_police_car": "\u{1F694}", | |
| 2272 | - "oncoming_taxi": "\u{1F696}", | |
| 2273 | - "open_file_folder": "\u{1F4C2}", | |
| 2274 | - "open_hands": "\u{1F450}", | |
| 2275 | - "open_mouth": "\u{1F62E}", | |
| 2276 | - "open_umbrella": "\u2602\uFE0F", | |
| 2277 | - "ophiuchus": "\u26CE", | |
| 2278 | - "orange_book": "\u{1F4D9}", | |
| 2279 | - "orthodox_cross": "\u2626\uFE0F", | |
| 2280 | - "outbox_tray": "\u{1F4E4}", | |
| 2281 | - "owl": "\u{1F989}", | |
| 2282 | - "ox": "\u{1F402}", | |
| 2283 | - "package": "\u{1F4E6}", | |
| 2284 | - "page_facing_up": "\u{1F4C4}", | |
| 2285 | - "page_with_curl": "\u{1F4C3}", | |
| 2286 | - "pager": "\u{1F4DF}", | |
| 2287 | - "paintbrush": "\u{1F58C}", | |
| 2288 | - "palm_tree": "\u{1F334}", | |
| 2289 | - "pancakes": "\u{1F95E}", | |
| 2290 | - "panda_face": "\u{1F43C}", | |
| 2291 | - "paperclip": "\u{1F4CE}", | |
| 2292 | - "paperclips": "\u{1F587}", | |
| 2293 | - "parasol_on_ground": "\u26F1", | |
| 2294 | - "parking": "\u{1F17F}\uFE0F", | |
| 2295 | - "part_alternation_mark": "\u303D\uFE0F", | |
| 2296 | - "partly_sunny": "\u26C5\uFE0F", | |
| 2297 | - "passenger_ship": "\u{1F6F3}", | |
| 2298 | - "passport_control": "\u{1F6C2}", | |
| 2299 | - "pause_button": "\u23F8", | |
| 2300 | - "peace_symbol": "\u262E\uFE0F", | |
| 2301 | - "peach": "\u{1F351}", | |
| 2302 | - "peanuts": "\u{1F95C}", | |
| 2303 | - "pear": "\u{1F350}", | |
| 2304 | - "pen": "\u{1F58A}", | |
| 2305 | - "pencil2": "\u270F\uFE0F", | |
| 2306 | - "penguin": "\u{1F427}", | |
| 2307 | - "pensive": "\u{1F614}", | |
| 2308 | - "performing_arts": "\u{1F3AD}", | |
| 2309 | - "persevere": "\u{1F623}", | |
| 2310 | - "person_fencing": "\u{1F93A}", | |
| 2311 | - "pouting_woman": "\u{1F64E}", | |
| 2312 | - "phone": "\u260E\uFE0F", | |
| 2313 | - "pick": "\u26CF", | |
| 2314 | - "pig": "\u{1F437}", | |
| 2315 | - "pig2": "\u{1F416}", | |
| 2316 | - "pig_nose": "\u{1F43D}", | |
| 2317 | - "pill": "\u{1F48A}", | |
| 2318 | - "pineapple": "\u{1F34D}", | |
| 2319 | - "ping_pong": "\u{1F3D3}", | |
| 2320 | - "pisces": "\u2653\uFE0F", | |
| 2321 | - "pizza": "\u{1F355}", | |
| 2322 | - "place_of_worship": "\u{1F6D0}", | |
| 2323 | - "plate_with_cutlery": "\u{1F37D}", | |
| 2324 | - "play_or_pause_button": "\u23EF", | |
| 2325 | - "point_down": "\u{1F447}", | |
| 2326 | - "point_left": "\u{1F448}", | |
| 2327 | - "point_right": "\u{1F449}", | |
| 2328 | - "point_up": "\u261D\uFE0F", | |
| 2329 | - "point_up_2": "\u{1F446}", | |
| 2330 | - "police_car": "\u{1F693}", | |
| 2331 | - "policewoman": "\u{1F46E}‍\u2640\uFE0F", | |
| 2332 | - "poodle": "\u{1F429}", | |
| 2333 | - "popcorn": "\u{1F37F}", | |
| 2334 | - "post_office": "\u{1F3E3}", | |
| 2335 | - "postal_horn": "\u{1F4EF}", | |
| 2336 | - "postbox": "\u{1F4EE}", | |
| 2337 | - "potable_water": "\u{1F6B0}", | |
| 2338 | - "potato": "\u{1F954}", | |
| 2339 | - "pouch": "\u{1F45D}", | |
| 2340 | - "poultry_leg": "\u{1F357}", | |
| 2341 | - "pound": "\u{1F4B7}", | |
| 2342 | - "rage": "\u{1F621}", | |
| 2343 | - "pouting_cat": "\u{1F63E}", | |
| 2344 | - "pouting_man": "\u{1F64E}‍\u2642\uFE0F", | |
| 2345 | - "pray": "\u{1F64F}", | |
| 2346 | - "prayer_beads": "\u{1F4FF}", | |
| 2347 | - "pregnant_woman": "\u{1F930}", | |
| 2348 | - "previous_track_button": "\u23EE", | |
| 2349 | - "prince": "\u{1F934}", | |
| 2350 | - "princess": "\u{1F478}", | |
| 2351 | - "printer": "\u{1F5A8}", | |
| 2352 | - "purple_heart": "\u{1F49C}", | |
| 2353 | - "purse": "\u{1F45B}", | |
| 2354 | - "pushpin": "\u{1F4CC}", | |
| 2355 | - "put_litter_in_its_place": "\u{1F6AE}", | |
| 2356 | - "question": "\u2753", | |
| 2357 | - "rabbit": "\u{1F430}", | |
| 2358 | - "rabbit2": "\u{1F407}", | |
| 2359 | - "racehorse": "\u{1F40E}", | |
| 2360 | - "racing_car": "\u{1F3CE}", | |
| 2361 | - "radio": "\u{1F4FB}", | |
| 2362 | - "radio_button": "\u{1F518}", | |
| 2363 | - "radioactive": "\u2622\uFE0F", | |
| 2364 | - "railway_car": "\u{1F683}", | |
| 2365 | - "railway_track": "\u{1F6E4}", | |
| 2366 | - "rainbow": "\u{1F308}", | |
| 2367 | - "rainbow_flag": "\u{1F3F3}\uFE0F‍\u{1F308}", | |
| 2368 | - "raised_back_of_hand": "\u{1F91A}", | |
| 2369 | - "raised_hand_with_fingers_splayed": "\u{1F590}", | |
| 2370 | - "raised_hands": "\u{1F64C}", | |
| 2371 | - "raising_hand_woman": "\u{1F64B}", | |
| 2372 | - "raising_hand_man": "\u{1F64B}‍\u2642\uFE0F", | |
| 2373 | - "ram": "\u{1F40F}", | |
| 2374 | - "ramen": "\u{1F35C}", | |
| 2375 | - "rat": "\u{1F400}", | |
| 2376 | - "record_button": "\u23FA", | |
| 2377 | - "recycle": "\u267B\uFE0F", | |
| 2378 | - "red_circle": "\u{1F534}", | |
| 2379 | - "registered": "\xAE\uFE0F", | |
| 2380 | - "relaxed": "\u263A\uFE0F", | |
| 2381 | - "relieved": "\u{1F60C}", | |
| 2382 | - "reminder_ribbon": "\u{1F397}", | |
| 2383 | - "repeat": "\u{1F501}", | |
| 2384 | - "repeat_one": "\u{1F502}", | |
| 2385 | - "rescue_worker_helmet": "\u26D1", | |
| 2386 | - "restroom": "\u{1F6BB}", | |
| 2387 | - "revolving_hearts": "\u{1F49E}", | |
| 2388 | - "rewind": "\u23EA", | |
| 2389 | - "rhinoceros": "\u{1F98F}", | |
| 2390 | - "ribbon": "\u{1F380}", | |
| 2391 | - "rice": "\u{1F35A}", | |
| 2392 | - "rice_ball": "\u{1F359}", | |
| 2393 | - "rice_cracker": "\u{1F358}", | |
| 2394 | - "rice_scene": "\u{1F391}", | |
| 2395 | - "right_anger_bubble": "\u{1F5EF}", | |
| 2396 | - "ring": "\u{1F48D}", | |
| 2397 | - "robot": "\u{1F916}", | |
| 2398 | - "rocket": "\u{1F680}", | |
| 2399 | - "rofl": "\u{1F923}", | |
| 2400 | - "roll_eyes": "\u{1F644}", | |
| 2401 | - "roller_coaster": "\u{1F3A2}", | |
| 2402 | - "rooster": "\u{1F413}", | |
| 2403 | - "rose": "\u{1F339}", | |
| 2404 | - "rosette": "\u{1F3F5}", | |
| 2405 | - "rotating_light": "\u{1F6A8}", | |
| 2406 | - "round_pushpin": "\u{1F4CD}", | |
| 2407 | - "rowing_man": "\u{1F6A3}", | |
| 2408 | - "rowing_woman": "\u{1F6A3}‍\u2640\uFE0F", | |
| 2409 | - "rugby_football": "\u{1F3C9}", | |
| 2410 | - "running_man": "\u{1F3C3}", | |
| 2411 | - "running_shirt_with_sash": "\u{1F3BD}", | |
| 2412 | - "running_woman": "\u{1F3C3}‍\u2640\uFE0F", | |
| 2413 | - "sa": "\u{1F202}\uFE0F", | |
| 2414 | - "sagittarius": "\u2650\uFE0F", | |
| 2415 | - "sake": "\u{1F376}", | |
| 2416 | - "sandal": "\u{1F461}", | |
| 2417 | - "santa": "\u{1F385}", | |
| 2418 | - "satellite": "\u{1F4E1}", | |
| 2419 | - "saxophone": "\u{1F3B7}", | |
| 2420 | - "school": "\u{1F3EB}", | |
| 2421 | - "school_satchel": "\u{1F392}", | |
| 2422 | - "scissors": "\u2702\uFE0F", | |
| 2423 | - "scorpion": "\u{1F982}", | |
| 2424 | - "scorpius": "\u264F\uFE0F", | |
| 2425 | - "scream": "\u{1F631}", | |
| 2426 | - "scream_cat": "\u{1F640}", | |
| 2427 | - "scroll": "\u{1F4DC}", | |
| 2428 | - "seat": "\u{1F4BA}", | |
| 2429 | - "secret": "\u3299\uFE0F", | |
| 2430 | - "see_no_evil": "\u{1F648}", | |
| 2431 | - "seedling": "\u{1F331}", | |
| 2432 | - "selfie": "\u{1F933}", | |
| 2433 | - "shallow_pan_of_food": "\u{1F958}", | |
| 2434 | - "shamrock": "\u2618\uFE0F", | |
| 2435 | - "shark": "\u{1F988}", | |
| 2436 | - "shaved_ice": "\u{1F367}", | |
| 2437 | - "sheep": "\u{1F411}", | |
| 2438 | - "shell": "\u{1F41A}", | |
| 2439 | - "shield": "\u{1F6E1}", | |
| 2440 | - "shinto_shrine": "\u26E9", | |
| 2441 | - "ship": "\u{1F6A2}", | |
| 2442 | - "shirt": "\u{1F455}", | |
| 2443 | - "shopping": "\u{1F6CD}", | |
| 2444 | - "shopping_cart": "\u{1F6D2}", | |
| 2445 | - "shower": "\u{1F6BF}", | |
| 2446 | - "shrimp": "\u{1F990}", | |
| 2447 | - "signal_strength": "\u{1F4F6}", | |
| 2448 | - "six_pointed_star": "\u{1F52F}", | |
| 2449 | - "ski": "\u{1F3BF}", | |
| 2450 | - "skier": "\u26F7", | |
| 2451 | - "skull": "\u{1F480}", | |
| 2452 | - "skull_and_crossbones": "\u2620\uFE0F", | |
| 2453 | - "sleeping": "\u{1F634}", | |
| 2454 | - "sleeping_bed": "\u{1F6CC}", | |
| 2455 | - "sleepy": "\u{1F62A}", | |
| 2456 | - "slightly_frowning_face": "\u{1F641}", | |
| 2457 | - "slightly_smiling_face": "\u{1F642}", | |
| 2458 | - "slot_machine": "\u{1F3B0}", | |
| 2459 | - "small_airplane": "\u{1F6E9}", | |
| 2460 | - "small_blue_diamond": "\u{1F539}", | |
| 2461 | - "small_orange_diamond": "\u{1F538}", | |
| 2462 | - "small_red_triangle": "\u{1F53A}", | |
| 2463 | - "small_red_triangle_down": "\u{1F53B}", | |
| 2464 | - "smile": "\u{1F604}", | |
| 2465 | - "smile_cat": "\u{1F638}", | |
| 2466 | - "smiley": "\u{1F603}", | |
| 2467 | - "smiley_cat": "\u{1F63A}", | |
| 2468 | - "smiling_imp": "\u{1F608}", | |
| 2469 | - "smirk": "\u{1F60F}", | |
| 2470 | - "smirk_cat": "\u{1F63C}", | |
| 2471 | - "smoking": "\u{1F6AC}", | |
| 2472 | - "snail": "\u{1F40C}", | |
| 2473 | - "snake": "\u{1F40D}", | |
| 2474 | - "sneezing_face": "\u{1F927}", | |
| 2475 | - "snowboarder": "\u{1F3C2}", | |
| 2476 | - "snowflake": "\u2744\uFE0F", | |
| 2477 | - "snowman": "\u26C4\uFE0F", | |
| 2478 | - "snowman_with_snow": "\u2603\uFE0F", | |
| 2479 | - "sob": "\u{1F62D}", | |
| 2480 | - "soccer": "\u26BD\uFE0F", | |
| 2481 | - "soon": "\u{1F51C}", | |
| 2482 | - "sos": "\u{1F198}", | |
| 2483 | - "sound": "\u{1F509}", | |
| 2484 | - "space_invader": "\u{1F47E}", | |
| 2485 | - "spades": "\u2660\uFE0F", | |
| 2486 | - "spaghetti": "\u{1F35D}", | |
| 2487 | - "sparkle": "\u2747\uFE0F", | |
| 2488 | - "sparkler": "\u{1F387}", | |
| 2489 | - "sparkles": "\u2728", | |
| 2490 | - "sparkling_heart": "\u{1F496}", | |
| 2491 | - "speak_no_evil": "\u{1F64A}", | |
| 2492 | - "speaker": "\u{1F508}", | |
| 2493 | - "speaking_head": "\u{1F5E3}", | |
| 2494 | - "speech_balloon": "\u{1F4AC}", | |
| 2495 | - "speedboat": "\u{1F6A4}", | |
| 2496 | - "spider": "\u{1F577}", | |
| 2497 | - "spider_web": "\u{1F578}", | |
| 2498 | - "spiral_calendar": "\u{1F5D3}", | |
| 2499 | - "spiral_notepad": "\u{1F5D2}", | |
| 2500 | - "spoon": "\u{1F944}", | |
| 2501 | - "squid": "\u{1F991}", | |
| 2502 | - "stadium": "\u{1F3DF}", | |
| 2503 | - "star": "\u2B50\uFE0F", | |
| 2504 | - "star2": "\u{1F31F}", | |
| 2505 | - "star_and_crescent": "\u262A\uFE0F", | |
| 2506 | - "star_of_david": "\u2721\uFE0F", | |
| 2507 | - "stars": "\u{1F320}", | |
| 2508 | - "station": "\u{1F689}", | |
| 2509 | - "statue_of_liberty": "\u{1F5FD}", | |
| 2510 | - "steam_locomotive": "\u{1F682}", | |
| 2511 | - "stew": "\u{1F372}", | |
| 2512 | - "stop_button": "\u23F9", | |
| 2513 | - "stop_sign": "\u{1F6D1}", | |
| 2514 | - "stopwatch": "\u23F1", | |
| 2515 | - "straight_ruler": "\u{1F4CF}", | |
| 2516 | - "strawberry": "\u{1F353}", | |
| 2517 | - "stuck_out_tongue": "\u{1F61B}", | |
| 2518 | - "stuck_out_tongue_closed_eyes": "\u{1F61D}", | |
| 2519 | - "stuck_out_tongue_winking_eye": "\u{1F61C}", | |
| 2520 | - "studio_microphone": "\u{1F399}", | |
| 2521 | - "stuffed_flatbread": "\u{1F959}", | |
| 2522 | - "sun_behind_large_cloud": "\u{1F325}", | |
| 2523 | - "sun_behind_rain_cloud": "\u{1F326}", | |
| 2524 | - "sun_behind_small_cloud": "\u{1F324}", | |
| 2525 | - "sun_with_face": "\u{1F31E}", | |
| 2526 | - "sunflower": "\u{1F33B}", | |
| 2527 | - "sunglasses": "\u{1F60E}", | |
| 2528 | - "sunny": "\u2600\uFE0F", | |
| 2529 | - "sunrise": "\u{1F305}", | |
| 2530 | - "sunrise_over_mountains": "\u{1F304}", | |
| 2531 | - "surfing_man": "\u{1F3C4}", | |
| 2532 | - "surfing_woman": "\u{1F3C4}‍\u2640\uFE0F", | |
| 2533 | - "sushi": "\u{1F363}", | |
| 2534 | - "suspension_railway": "\u{1F69F}", | |
| 2535 | - "sweat": "\u{1F613}", | |
| 2536 | - "sweat_drops": "\u{1F4A6}", | |
| 2537 | - "sweat_smile": "\u{1F605}", | |
| 2538 | - "sweet_potato": "\u{1F360}", | |
| 2539 | - "swimming_man": "\u{1F3CA}", | |
| 2540 | - "swimming_woman": "\u{1F3CA}‍\u2640\uFE0F", | |
| 2541 | - "symbols": "\u{1F523}", | |
| 2542 | - "synagogue": "\u{1F54D}", | |
| 2543 | - "syringe": "\u{1F489}", | |
| 2544 | - "taco": "\u{1F32E}", | |
| 2545 | - "tada": "\u{1F389}", | |
| 2546 | - "tanabata_tree": "\u{1F38B}", | |
| 2547 | - "taurus": "\u2649\uFE0F", | |
| 2548 | - "taxi": "\u{1F695}", | |
| 2549 | - "tea": "\u{1F375}", | |
| 2550 | - "telephone_receiver": "\u{1F4DE}", | |
| 2551 | - "telescope": "\u{1F52D}", | |
| 2552 | - "tennis": "\u{1F3BE}", | |
| 2553 | - "tent": "\u26FA\uFE0F", | |
| 2554 | - "thermometer": "\u{1F321}", | |
| 2555 | - "thinking": "\u{1F914}", | |
| 2556 | - "thought_balloon": "\u{1F4AD}", | |
| 2557 | - "ticket": "\u{1F3AB}", | |
| 2558 | - "tickets": "\u{1F39F}", | |
| 2559 | - "tiger": "\u{1F42F}", | |
| 2560 | - "tiger2": "\u{1F405}", | |
| 2561 | - "timer_clock": "\u23F2", | |
| 2562 | - "tipping_hand_man": "\u{1F481}‍\u2642\uFE0F", | |
| 2563 | - "tired_face": "\u{1F62B}", | |
| 2564 | - "tm": "\u2122\uFE0F", | |
| 2565 | - "toilet": "\u{1F6BD}", | |
| 2566 | - "tokyo_tower": "\u{1F5FC}", | |
| 2567 | - "tomato": "\u{1F345}", | |
| 2568 | - "tongue": "\u{1F445}", | |
| 2569 | - "top": "\u{1F51D}", | |
| 2570 | - "tophat": "\u{1F3A9}", | |
| 2571 | - "tornado": "\u{1F32A}", | |
| 2572 | - "trackball": "\u{1F5B2}", | |
| 2573 | - "tractor": "\u{1F69C}", | |
| 2574 | - "traffic_light": "\u{1F6A5}", | |
| 2575 | - "train": "\u{1F68B}", | |
| 2576 | - "train2": "\u{1F686}", | |
| 2577 | - "tram": "\u{1F68A}", | |
| 2578 | - "triangular_flag_on_post": "\u{1F6A9}", | |
| 2579 | - "triangular_ruler": "\u{1F4D0}", | |
| 2580 | - "trident": "\u{1F531}", | |
| 2581 | - "triumph": "\u{1F624}", | |
| 2582 | - "trolleybus": "\u{1F68E}", | |
| 2583 | - "trophy": "\u{1F3C6}", | |
| 2584 | - "tropical_drink": "\u{1F379}", | |
| 2585 | - "tropical_fish": "\u{1F420}", | |
| 2586 | - "truck": "\u{1F69A}", | |
| 2587 | - "trumpet": "\u{1F3BA}", | |
| 2588 | - "tulip": "\u{1F337}", | |
| 2589 | - "tumbler_glass": "\u{1F943}", | |
| 2590 | - "turkey": "\u{1F983}", | |
| 2591 | - "turtle": "\u{1F422}", | |
| 2592 | - "tv": "\u{1F4FA}", | |
| 2593 | - "twisted_rightwards_arrows": "\u{1F500}", | |
| 2594 | - "two_hearts": "\u{1F495}", | |
| 2595 | - "two_men_holding_hands": "\u{1F46C}", | |
| 2596 | - "two_women_holding_hands": "\u{1F46D}", | |
| 2597 | - "u5272": "\u{1F239}", | |
| 2598 | - "u5408": "\u{1F234}", | |
| 2599 | - "u55b6": "\u{1F23A}", | |
| 2600 | - "u6307": "\u{1F22F}\uFE0F", | |
| 2601 | - "u6708": "\u{1F237}\uFE0F", | |
| 2602 | - "u6709": "\u{1F236}", | |
| 2603 | - "u6e80": "\u{1F235}", | |
| 2604 | - "u7121": "\u{1F21A}\uFE0F", | |
| 2605 | - "u7533": "\u{1F238}", | |
| 2606 | - "u7981": "\u{1F232}", | |
| 2607 | - "u7a7a": "\u{1F233}", | |
| 2608 | - "umbrella": "\u2614\uFE0F", | |
| 2609 | - "unamused": "\u{1F612}", | |
| 2610 | - "underage": "\u{1F51E}", | |
| 2611 | - "unicorn": "\u{1F984}", | |
| 2612 | - "unlock": "\u{1F513}", | |
| 2613 | - "up": "\u{1F199}", | |
| 2614 | - "upside_down_face": "\u{1F643}", | |
| 2615 | - "v": "\u270C\uFE0F", | |
| 2616 | - "vertical_traffic_light": "\u{1F6A6}", | |
| 2617 | - "vhs": "\u{1F4FC}", | |
| 2618 | - "vibration_mode": "\u{1F4F3}", | |
| 2619 | - "video_camera": "\u{1F4F9}", | |
| 2620 | - "video_game": "\u{1F3AE}", | |
| 2621 | - "violin": "\u{1F3BB}", | |
| 2622 | - "virgo": "\u264D\uFE0F", | |
| 2623 | - "volcano": "\u{1F30B}", | |
| 2624 | - "volleyball": "\u{1F3D0}", | |
| 2625 | - "vs": "\u{1F19A}", | |
| 2626 | - "vulcan_salute": "\u{1F596}", | |
| 2627 | - "walking_man": "\u{1F6B6}", | |
| 2628 | - "walking_woman": "\u{1F6B6}‍\u2640\uFE0F", | |
| 2629 | - "waning_crescent_moon": "\u{1F318}", | |
| 2630 | - "waning_gibbous_moon": "\u{1F316}", | |
| 2631 | - "warning": "\u26A0\uFE0F", | |
| 2632 | - "wastebasket": "\u{1F5D1}", | |
| 2633 | - "watch": "\u231A\uFE0F", | |
| 2634 | - "water_buffalo": "\u{1F403}", | |
| 2635 | - "watermelon": "\u{1F349}", | |
| 2636 | - "wave": "\u{1F44B}", | |
| 2637 | - "wavy_dash": "\u3030\uFE0F", | |
| 2638 | - "waxing_crescent_moon": "\u{1F312}", | |
| 2639 | - "wc": "\u{1F6BE}", | |
| 2640 | - "weary": "\u{1F629}", | |
| 2641 | - "wedding": "\u{1F492}", | |
| 2642 | - "weight_lifting_man": "\u{1F3CB}\uFE0F", | |
| 2643 | - "weight_lifting_woman": "\u{1F3CB}\uFE0F‍\u2640\uFE0F", | |
| 2644 | - "whale": "\u{1F433}", | |
| 2645 | - "whale2": "\u{1F40B}", | |
| 2646 | - "wheel_of_dharma": "\u2638\uFE0F", | |
| 2647 | - "wheelchair": "\u267F\uFE0F", | |
| 2648 | - "white_check_mark": "\u2705", | |
| 2649 | - "white_circle": "\u26AA\uFE0F", | |
| 2650 | - "white_flag": "\u{1F3F3}\uFE0F", | |
| 2651 | - "white_flower": "\u{1F4AE}", | |
| 2652 | - "white_large_square": "\u2B1C\uFE0F", | |
| 2653 | - "white_medium_small_square": "\u25FD\uFE0F", | |
| 2654 | - "white_medium_square": "\u25FB\uFE0F", | |
| 2655 | - "white_small_square": "\u25AB\uFE0F", | |
| 2656 | - "white_square_button": "\u{1F533}", | |
| 2657 | - "wilted_flower": "\u{1F940}", | |
| 2658 | - "wind_chime": "\u{1F390}", | |
| 2659 | - "wind_face": "\u{1F32C}", | |
| 2660 | - "wine_glass": "\u{1F377}", | |
| 2661 | - "wink": "\u{1F609}", | |
| 2662 | - "wolf": "\u{1F43A}", | |
| 2663 | - "woman": "\u{1F469}", | |
| 2664 | - "woman_artist": "\u{1F469}‍\u{1F3A8}", | |
| 2665 | - "woman_astronaut": "\u{1F469}‍\u{1F680}", | |
| 2666 | - "woman_cartwheeling": "\u{1F938}‍\u2640\uFE0F", | |
| 2667 | - "woman_cook": "\u{1F469}‍\u{1F373}", | |
| 2668 | - "woman_facepalming": "\u{1F926}‍\u2640\uFE0F", | |
| 2669 | - "woman_factory_worker": "\u{1F469}‍\u{1F3ED}", | |
| 2670 | - "woman_farmer": "\u{1F469}‍\u{1F33E}", | |
| 2671 | - "woman_firefighter": "\u{1F469}‍\u{1F692}", | |
| 2672 | - "woman_health_worker": "\u{1F469}‍\u2695\uFE0F", | |
| 2673 | - "woman_judge": "\u{1F469}‍\u2696\uFE0F", | |
| 2674 | - "woman_juggling": "\u{1F939}‍\u2640\uFE0F", | |
| 2675 | - "woman_mechanic": "\u{1F469}‍\u{1F527}", | |
| 2676 | - "woman_office_worker": "\u{1F469}‍\u{1F4BC}", | |
| 2677 | - "woman_pilot": "\u{1F469}‍\u2708\uFE0F", | |
| 2678 | - "woman_playing_handball": "\u{1F93E}‍\u2640\uFE0F", | |
| 2679 | - "woman_playing_water_polo": "\u{1F93D}‍\u2640\uFE0F", | |
| 2680 | - "woman_scientist": "\u{1F469}‍\u{1F52C}", | |
| 2681 | - "woman_shrugging": "\u{1F937}‍\u2640\uFE0F", | |
| 2682 | - "woman_singer": "\u{1F469}‍\u{1F3A4}", | |
| 2683 | - "woman_student": "\u{1F469}‍\u{1F393}", | |
| 2684 | - "woman_teacher": "\u{1F469}‍\u{1F3EB}", | |
| 2685 | - "woman_technologist": "\u{1F469}‍\u{1F4BB}", | |
| 2686 | - "woman_with_turban": "\u{1F473}‍\u2640\uFE0F", | |
| 2687 | - "womans_clothes": "\u{1F45A}", | |
| 2688 | - "womans_hat": "\u{1F452}", | |
| 2689 | - "women_wrestling": "\u{1F93C}‍\u2640\uFE0F", | |
| 2690 | - "womens": "\u{1F6BA}", | |
| 2691 | - "world_map": "\u{1F5FA}", | |
| 2692 | - "worried": "\u{1F61F}", | |
| 2693 | - "wrench": "\u{1F527}", | |
| 2694 | - "writing_hand": "\u270D\uFE0F", | |
| 2695 | - "x": "\u274C", | |
| 2696 | - "yellow_heart": "\u{1F49B}", | |
| 2697 | - "yen": "\u{1F4B4}", | |
| 2698 | - "yin_yang": "\u262F\uFE0F", | |
| 2699 | - "yum": "\u{1F60B}", | |
| 2700 | - "zap": "\u26A1\uFE0F", | |
| 2701 | - "zipper_mouth_face": "\u{1F910}", | |
| 2702 | - "zzz": "\u{1F4A4}", | |
| 2703 | - /* special emojis :P */ | |
| 2704 | - "octocat": '<img alt=":octocat:" height="20" width="20" align="absmiddle" src="https://assets-cdn.github.com/images/icons/emoji/octocat.png">', | |
| 2705 | - "showdown": `<span style="font-family: 'Anonymous Pro', monospace; text-decoration: underline; text-decoration-style: dashed; text-decoration-color: #3e8b8a;text-underline-position: under;">S</span>` | |
| 2706 | - }; | |
| 2707 | - showdown2.Converter = function(converterOptions) { | |
| 2708 | - "use strict"; | |
| 2709 | - var options = {}, langExtensions = [], outputModifiers = [], listeners = {}, setConvFlavor = setFlavor, metadata = { | |
| 2710 | - parsed: {}, | |
| 2711 | - raw: "", | |
| 2712 | - format: "" | |
| 2713 | - }; | |
| 2714 | - _constructor(); | |
| 2715 | - function _constructor() { | |
| 2716 | - converterOptions = converterOptions || {}; | |
| 2717 | - for (var gOpt in globalOptions) { | |
| 2718 | - if (globalOptions.hasOwnProperty(gOpt)) { | |
| 2719 | - options[gOpt] = globalOptions[gOpt]; | |
| 2720 | - } | |
| 2721 | - } | |
| 2722 | - if (typeof converterOptions === "object") { | |
| 2723 | - for (var opt in converterOptions) { | |
| 2724 | - if (converterOptions.hasOwnProperty(opt)) { | |
| 2725 | - options[opt] = converterOptions[opt]; | |
| 2726 | - } | |
| 2727 | - } | |
| 2728 | - } else { | |
| 2729 | - throw Error("Converter expects the passed parameter to be an object, but " + typeof converterOptions + " was passed instead."); | |
| 2730 | - } | |
| 2731 | - if (options.extensions) { | |
| 2732 | - showdown2.helper.forEach(options.extensions, _parseExtension); | |
| 2733 | - } | |
| 2734 | - } | |
| 2735 | - function _parseExtension(ext, name) { | |
| 2736 | - name = name || null; | |
| 2737 | - if (showdown2.helper.isString(ext)) { | |
| 2738 | - ext = showdown2.helper.stdExtName(ext); | |
| 2739 | - name = ext; | |
| 2740 | - if (showdown2.extensions[ext]) { | |
| 2741 | - console.warn("DEPRECATION WARNING: " + ext + " is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"); | |
| 2742 | - legacyExtensionLoading(showdown2.extensions[ext], ext); | |
| 2743 | - return; | |
| 2744 | - } else if (!showdown2.helper.isUndefined(extensions[ext])) { | |
| 2745 | - ext = extensions[ext]; | |
| 2746 | - } else { | |
| 2747 | - throw Error('Extension "' + ext + '" could not be loaded. It was either not found or is not a valid extension.'); | |
| 2748 | - } | |
| 2749 | - } | |
| 2750 | - if (typeof ext === "function") { | |
| 2751 | - ext = ext(); | |
| 2752 | - } | |
| 2753 | - if (!showdown2.helper.isArray(ext)) { | |
| 2754 | - ext = [ext]; | |
| 2755 | - } | |
| 2756 | - var validExt = validate(ext, name); | |
| 2757 | - if (!validExt.valid) { | |
| 2758 | - throw Error(validExt.error); | |
| 2759 | - } | |
| 2760 | - for (var i2 = 0; i2 < ext.length; ++i2) { | |
| 2761 | - switch (ext[i2].type) { | |
| 2762 | - case "lang": | |
| 2763 | - langExtensions.push(ext[i2]); | |
| 2764 | - break; | |
| 2765 | - case "output": | |
| 2766 | - outputModifiers.push(ext[i2]); | |
| 2767 | - break; | |
| 2768 | - } | |
| 2769 | - if (ext[i2].hasOwnProperty("listeners")) { | |
| 2770 | - for (var ln in ext[i2].listeners) { | |
| 2771 | - if (ext[i2].listeners.hasOwnProperty(ln)) { | |
| 2772 | - listen(ln, ext[i2].listeners[ln]); | |
| 2773 | - } | |
| 2774 | - } | |
| 2775 | - } | |
| 2776 | - } | |
| 2777 | - } | |
| 2778 | - function legacyExtensionLoading(ext, name) { | |
| 2779 | - if (typeof ext === "function") { | |
| 2780 | - ext = ext(new showdown2.Converter()); | |
| 2781 | - } | |
| 2782 | - if (!showdown2.helper.isArray(ext)) { | |
| 2783 | - ext = [ext]; | |
| 2784 | - } | |
| 2785 | - var valid = validate(ext, name); | |
| 2786 | - if (!valid.valid) { | |
| 2787 | - throw Error(valid.error); | |
| 2788 | - } | |
| 2789 | - for (var i2 = 0; i2 < ext.length; ++i2) { | |
| 2790 | - switch (ext[i2].type) { | |
| 2791 | - case "lang": | |
| 2792 | - langExtensions.push(ext[i2]); | |
| 2793 | - break; | |
| 2794 | - case "output": | |
| 2795 | - outputModifiers.push(ext[i2]); | |
| 2796 | - break; | |
| 2797 | - default: | |
| 2798 | - throw Error("Extension loader error: Type unrecognized!!!"); | |
| 2799 | - } | |
| 2800 | - } | |
| 2801 | - } | |
| 2802 | - function listen(name, callback) { | |
| 2803 | - if (!showdown2.helper.isString(name)) { | |
| 2804 | - throw Error("Invalid argument in converter.listen() method: name must be a string, but " + typeof name + " given"); | |
| 2805 | - } | |
| 2806 | - if (typeof callback !== "function") { | |
| 2807 | - throw Error("Invalid argument in converter.listen() method: callback must be a function, but " + typeof callback + " given"); | |
| 2808 | - } | |
| 2809 | - if (!listeners.hasOwnProperty(name)) { | |
| 2810 | - listeners[name] = []; | |
| 2811 | - } | |
| 2812 | - listeners[name].push(callback); | |
| 2813 | - } | |
| 2814 | - function rTrimInputText(text2) { | |
| 2815 | - var rsp = text2.match(/^\s*/)[0].length, rgx = new RegExp("^\\s{0," + rsp + "}", "gm"); | |
| 2816 | - return text2.replace(rgx, ""); | |
| 2817 | - } | |
| 2818 | - this._dispatch = function dispatch3(evtName, text2, options2, globals) { | |
| 2819 | - if (listeners.hasOwnProperty(evtName)) { | |
| 2820 | - for (var ei = 0; ei < listeners[evtName].length; ++ei) { | |
| 2821 | - var nText = listeners[evtName][ei](evtName, text2, this, options2, globals); | |
| 2822 | - if (nText && typeof nText !== "undefined") { | |
| 2823 | - text2 = nText; | |
| 2824 | - } | |
| 2825 | - } | |
| 2826 | - } | |
| 2827 | - return text2; | |
| 2828 | - }; | |
| 2829 | - this.listen = function(name, callback) { | |
| 2830 | - listen(name, callback); | |
| 2831 | - return this; | |
| 2832 | - }; | |
| 2833 | - this.makeHtml = function(text2) { | |
| 2834 | - if (!text2) { | |
| 2835 | - return text2; | |
| 2836 | - } | |
| 2837 | - var globals = { | |
| 2838 | - gHtmlBlocks: [], | |
| 2839 | - gHtmlMdBlocks: [], | |
| 2840 | - gHtmlSpans: [], | |
| 2841 | - gUrls: {}, | |
| 2842 | - gTitles: {}, | |
| 2843 | - gDimensions: {}, | |
| 2844 | - gListLevel: 0, | |
| 2845 | - hashLinkCounts: {}, | |
| 2846 | - langExtensions, | |
| 2847 | - outputModifiers, | |
| 2848 | - converter: this, | |
| 2849 | - ghCodeBlocks: [], | |
| 2850 | - metadata: { | |
| 2851 | - parsed: {}, | |
| 2852 | - raw: "", | |
| 2853 | - format: "" | |
| 2854 | - } | |
| 2855 | - }; | |
| 2856 | - text2 = text2.replace(/¨/g, "\xA8T"); | |
| 2857 | - text2 = text2.replace(/\$/g, "\xA8D"); | |
| 2858 | - text2 = text2.replace(/\r\n/g, "\n"); | |
| 2859 | - text2 = text2.replace(/\r/g, "\n"); | |
| 2860 | - text2 = text2.replace(/\u00A0/g, " "); | |
| 2861 | - if (options.smartIndentationFix) { | |
| 2862 | - text2 = rTrimInputText(text2); | |
| 2863 | - } | |
| 2864 | - text2 = "\n\n" + text2 + "\n\n"; | |
| 2865 | - text2 = showdown2.subParser("detab")(text2, options, globals); | |
| 2866 | - text2 = text2.replace(/^[ \t]+$/mg, ""); | |
| 2867 | - showdown2.helper.forEach(langExtensions, function(ext) { | |
| 2868 | - text2 = showdown2.subParser("runExtension")(ext, text2, options, globals); | |
| 2869 | - }); | |
| 2870 | - text2 = showdown2.subParser("metadata")(text2, options, globals); | |
| 2871 | - text2 = showdown2.subParser("hashPreCodeTags")(text2, options, globals); | |
| 2872 | - text2 = showdown2.subParser("githubCodeBlocks")(text2, options, globals); | |
| 2873 | - text2 = showdown2.subParser("hashHTMLBlocks")(text2, options, globals); | |
| 2874 | - text2 = showdown2.subParser("hashCodeTags")(text2, options, globals); | |
| 2875 | - text2 = showdown2.subParser("stripLinkDefinitions")(text2, options, globals); | |
| 2876 | - text2 = showdown2.subParser("blockGamut")(text2, options, globals); | |
| 2877 | - text2 = showdown2.subParser("unhashHTMLSpans")(text2, options, globals); | |
| 2878 | - text2 = showdown2.subParser("unescapeSpecialChars")(text2, options, globals); | |
| 2879 | - text2 = text2.replace(/¨D/g, "$$"); | |
| 2880 | - text2 = text2.replace(/¨T/g, "\xA8"); | |
| 2881 | - text2 = showdown2.subParser("completeHTMLDocument")(text2, options, globals); | |
| 2882 | - showdown2.helper.forEach(outputModifiers, function(ext) { | |
| 2883 | - text2 = showdown2.subParser("runExtension")(ext, text2, options, globals); | |
| 2884 | - }); | |
| 2885 | - metadata = globals.metadata; | |
| 2886 | - return text2; | |
| 2887 | - }; | |
| 2888 | - this.makeMarkdown = this.makeMd = function(src, HTMLParser) { | |
| 2889 | - src = src.replace(/\r\n/g, "\n"); | |
| 2890 | - src = src.replace(/\r/g, "\n"); | |
| 2891 | - src = src.replace(/>[ \t]+</, ">\xA8NBSP;<"); | |
| 2892 | - if (!HTMLParser) { | |
| 2893 | - if (window && window.document) { | |
| 2894 | - HTMLParser = window.document; | |
| 2895 | - } else { | |
| 2896 | - throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM"); | |
| 2897 | - } | |
| 2898 | - } | |
| 2899 | - var doc = HTMLParser.createElement("div"); | |
| 2900 | - doc.innerHTML = src; | |
| 2901 | - var globals = { | |
| 2902 | - preList: substitutePreCodeTags(doc) | |
| 2903 | - }; | |
| 2904 | - clean(doc); | |
| 2905 | - var nodes = doc.childNodes, mdDoc = ""; | |
| 2906 | - for (var i2 = 0; i2 < nodes.length; i2++) { | |
| 2907 | - mdDoc += showdown2.subParser("makeMarkdown.node")(nodes[i2], globals); | |
| 2908 | - } | |
| 2909 | - function clean(node) { | |
| 2910 | - for (var n2 = 0; n2 < node.childNodes.length; ++n2) { | |
| 2911 | - var child = node.childNodes[n2]; | |
| 2912 | - if (child.nodeType === 3) { | |
| 2913 | - if (!/\S/.test(child.nodeValue)) { | |
| 2914 | - node.removeChild(child); | |
| 2915 | - --n2; | |
| 2916 | - } else { | |
| 2917 | - child.nodeValue = child.nodeValue.split("\n").join(" "); | |
| 2918 | - child.nodeValue = child.nodeValue.replace(/(\s)+/g, "$1"); | |
| 2919 | - } | |
| 2920 | - } else if (child.nodeType === 1) { | |
| 2921 | - clean(child); | |
| 2922 | - } | |
| 2923 | - } | |
| 2924 | - } | |
| 2925 | - function substitutePreCodeTags(doc2) { | |
| 2926 | - var pres = doc2.querySelectorAll("pre"), presPH = []; | |
| 2927 | - for (var i3 = 0; i3 < pres.length; ++i3) { | |
| 2928 | - if (pres[i3].childElementCount === 1 && pres[i3].firstChild.tagName.toLowerCase() === "code") { | |
| 2929 | - var content = pres[i3].firstChild.innerHTML.trim(), language = pres[i3].firstChild.getAttribute("data-language") || ""; | |
| 2930 | - if (language === "") { | |
| 2931 | - var classes = pres[i3].firstChild.className.split(" "); | |
| 2932 | - for (var c2 = 0; c2 < classes.length; ++c2) { | |
| 2933 | - var matches = classes[c2].match(/^language-(.+)$/); | |
| 2934 | - if (matches !== null) { | |
| 2935 | - language = matches[1]; | |
| 2936 | - break; | |
| 2937 | - } | |
| 2938 | - } | |
| 2939 | - } | |
| 2940 | - content = showdown2.helper.unescapeHTMLEntities(content); | |
| 2941 | - presPH.push(content); | |
| 2942 | - pres[i3].outerHTML = '<precode language="' + language + '" precodenum="' + i3.toString() + '"></precode>'; | |
| 2943 | - } else { | |
| 2944 | - presPH.push(pres[i3].innerHTML); | |
| 2945 | - pres[i3].innerHTML = ""; | |
| 2946 | - pres[i3].setAttribute("prenum", i3.toString()); | |
| 2947 | - } | |
| 2948 | - } | |
| 2949 | - return presPH; | |
| 2950 | - } | |
| 2951 | - return mdDoc; | |
| 2952 | - }; | |
| 2953 | - this.setOption = function(key, value) { | |
| 2954 | - options[key] = value; | |
| 2955 | - }; | |
| 2956 | - this.getOption = function(key) { | |
| 2957 | - return options[key]; | |
| 2958 | - }; | |
| 2959 | - this.getOptions = function() { | |
| 2960 | - return options; | |
| 2961 | - }; | |
| 2962 | - this.addExtension = function(extension, name) { | |
| 2963 | - name = name || null; | |
| 2964 | - _parseExtension(extension, name); | |
| 2965 | - }; | |
| 2966 | - this.useExtension = function(extensionName) { | |
| 2967 | - _parseExtension(extensionName); | |
| 2968 | - }; | |
| 2969 | - this.setFlavor = function(name) { | |
| 2970 | - if (!flavor.hasOwnProperty(name)) { | |
| 2971 | - throw Error(name + " flavor was not found"); | |
| 2972 | - } | |
| 2973 | - var preset = flavor[name]; | |
| 2974 | - setConvFlavor = name; | |
| 2975 | - for (var option in preset) { | |
| 2976 | - if (preset.hasOwnProperty(option)) { | |
| 2977 | - options[option] = preset[option]; | |
| 2978 | - } | |
| 2979 | - } | |
| 2980 | - }; | |
| 2981 | - this.getFlavor = function() { | |
| 2982 | - return setConvFlavor; | |
| 2983 | - }; | |
| 2984 | - this.removeExtension = function(extension) { | |
| 2985 | - if (!showdown2.helper.isArray(extension)) { | |
| 2986 | - extension = [extension]; | |
| 2987 | - } | |
| 2988 | - for (var a2 = 0; a2 < extension.length; ++a2) { | |
| 2989 | - var ext = extension[a2]; | |
| 2990 | - for (var i2 = 0; i2 < langExtensions.length; ++i2) { | |
| 2991 | - if (langExtensions[i2] === ext) { | |
| 2992 | - langExtensions[i2].splice(i2, 1); | |
| 2993 | - } | |
| 2994 | - } | |
| 2995 | - for (var ii = 0; ii < outputModifiers.length; ++i2) { | |
| 2996 | - if (outputModifiers[ii] === ext) { | |
| 2997 | - outputModifiers[ii].splice(i2, 1); | |
| 2998 | - } | |
| 2999 | - } | |
| 3000 | - } | |
| 3001 | - }; | |
| 3002 | - this.getAllExtensions = function() { | |
| 3003 | - return { | |
| 3004 | - language: langExtensions, | |
| 3005 | - output: outputModifiers | |
| 3006 | - }; | |
| 3007 | - }; | |
| 3008 | - this.getMetadata = function(raw) { | |
| 3009 | - if (raw) { | |
| 3010 | - return metadata.raw; | |
| 3011 | - } else { | |
| 3012 | - return metadata.parsed; | |
| 3013 | - } | |
| 3014 | - }; | |
| 3015 | - this.getMetadataFormat = function() { | |
| 3016 | - return metadata.format; | |
| 3017 | - }; | |
| 3018 | - this._setMetadataPair = function(key, value) { | |
| 3019 | - metadata.parsed[key] = value; | |
| 3020 | - }; | |
| 3021 | - this._setMetadataFormat = function(format) { | |
| 3022 | - metadata.format = format; | |
| 3023 | - }; | |
| 3024 | - this._setMetadataRaw = function(raw) { | |
| 3025 | - metadata.raw = raw; | |
| 3026 | - }; | |
| 3027 | - }; | |
| 3028 | - showdown2.subParser("anchors", function(text2, options, globals) { | |
| 3029 | - "use strict"; | |
| 3030 | - text2 = globals.converter._dispatch("anchors.before", text2, options, globals); | |
| 3031 | - var writeAnchorTag = function(wholeMatch, linkText, linkId, url, m5, m6, title) { | |
| 3032 | - if (showdown2.helper.isUndefined(title)) { | |
| 3033 | - title = ""; | |
| 3034 | - } | |
| 3035 | - linkId = linkId.toLowerCase(); | |
| 3036 | - if (wholeMatch.search(/\(<?\s*>? ?(['"].*['"])?\)$/m) > -1) { | |
| 3037 | - url = ""; | |
| 3038 | - } else if (!url) { | |
| 3039 | - if (!linkId) { | |
| 3040 | - linkId = linkText.toLowerCase().replace(/ ?\n/g, " "); | |
| 3041 | - } | |
| 3042 | - url = "#" + linkId; | |
| 3043 | - if (!showdown2.helper.isUndefined(globals.gUrls[linkId])) { | |
| 3044 | - url = globals.gUrls[linkId]; | |
| 3045 | - if (!showdown2.helper.isUndefined(globals.gTitles[linkId])) { | |
| 3046 | - title = globals.gTitles[linkId]; | |
| 3047 | - } | |
| 3048 | - } else { | |
| 3049 | - return wholeMatch; | |
| 3050 | - } | |
| 3051 | - } | |
| 3052 | - url = url.replace(showdown2.helper.regexes.asteriskDashAndColon, showdown2.helper.escapeCharactersCallback); | |
| 3053 | - var result = '<a href="' + url + '"'; | |
| 3054 | - if (title !== "" && title !== null) { | |
| 3055 | - title = title.replace(/"/g, """); | |
| 3056 | - title = title.replace(showdown2.helper.regexes.asteriskDashAndColon, showdown2.helper.escapeCharactersCallback); | |
| 3057 | - result += ' title="' + title + '"'; | |
| 3058 | - } | |
| 3059 | - if (options.openLinksInNewWindow && !/^#/.test(url)) { | |
| 3060 | - result += ' rel="noopener noreferrer" target="\xA8E95Eblank"'; | |
| 3061 | - } | |
| 3062 | - result += ">" + linkText + "</a>"; | |
| 3063 | - return result; | |
| 3064 | - }; | |
| 3065 | - text2 = text2.replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g, writeAnchorTag); | |
| 3066 | - text2 = text2.replace( | |
| 3067 | - /\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g, | |
| 3068 | - writeAnchorTag | |
| 3069 | - ); | |
| 3070 | - text2 = text2.replace( | |
| 3071 | - /\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g, | |
| 3072 | - writeAnchorTag | |
| 3073 | - ); | |
| 3074 | - text2 = text2.replace(/\[([^\[\]]+)]()()()()()/g, writeAnchorTag); | |
| 3075 | - if (options.ghMentions) { | |
| 3076 | - text2 = text2.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gmi, function(wm, st, escape, mentions, username) { | |
| 3077 | - if (escape === "\\") { | |
| 3078 | - return st + mentions; | |
| 3079 | - } | |
| 3080 | - if (!showdown2.helper.isString(options.ghMentionsLink)) { | |
| 3081 | - throw new Error("ghMentionsLink option must be a string"); | |
| 3082 | - } | |
| 3083 | - var lnk = options.ghMentionsLink.replace(/\{u}/g, username), target = ""; | |
| 3084 | - if (options.openLinksInNewWindow) { | |
| 3085 | - target = ' rel="noopener noreferrer" target="\xA8E95Eblank"'; | |
| 3086 | - } | |
| 3087 | - return st + '<a href="' + lnk + '"' + target + ">" + mentions + "</a>"; | |
| 3088 | - }); | |
| 3089 | - } | |
| 3090 | - text2 = globals.converter._dispatch("anchors.after", text2, options, globals); | |
| 3091 | - return text2; | |
| 3092 | - }); | |
| 3093 | - var simpleURLRegex = /([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi, simpleURLRegex2 = /([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi, delimUrlRegex = /()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi, simpleMailRegex = /(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gmi, delimMailRegex = /<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi, replaceLink = function(options) { | |
| 3094 | - "use strict"; | |
| 3095 | - return function(wm, leadingMagicChars, link, m2, m3, trailingPunctuation, trailingMagicChars) { | |
| 3096 | - link = link.replace(showdown2.helper.regexes.asteriskDashAndColon, showdown2.helper.escapeCharactersCallback); | |
| 3097 | - var lnkTxt = link, append = "", target = "", lmc = leadingMagicChars || "", tmc = trailingMagicChars || ""; | |
| 3098 | - if (/^www\./i.test(link)) { | |
| 3099 | - link = link.replace(/^www\./i, "http://www."); | |
| 3100 | - } | |
| 3101 | - if (options.excludeTrailingPunctuationFromURLs && trailingPunctuation) { | |
| 3102 | - append = trailingPunctuation; | |
| 3103 | - } | |
| 3104 | - if (options.openLinksInNewWindow) { | |
| 3105 | - target = ' rel="noopener noreferrer" target="\xA8E95Eblank"'; | |
| 3106 | - } | |
| 3107 | - return lmc + '<a href="' + link + '"' + target + ">" + lnkTxt + "</a>" + append + tmc; | |
| 3108 | - }; | |
| 3109 | - }, replaceMail = function(options, globals) { | |
| 3110 | - "use strict"; | |
| 3111 | - return function(wholeMatch, b2, mail) { | |
| 3112 | - var href = "mailto:"; | |
| 3113 | - b2 = b2 || ""; | |
| 3114 | - mail = showdown2.subParser("unescapeSpecialChars")(mail, options, globals); | |
| 3115 | - if (options.encodeEmails) { | |
| 3116 | - href = showdown2.helper.encodeEmailAddress(href + mail); | |
| 3117 | - mail = showdown2.helper.encodeEmailAddress(mail); | |
| 3118 | - } else { | |
| 3119 | - href = href + mail; | |
| 3120 | - } | |
| 3121 | - return b2 + '<a href="' + href + '">' + mail + "</a>"; | |
| 3122 | - }; | |
| 3123 | - }; | |
| 3124 | - showdown2.subParser("autoLinks", function(text2, options, globals) { | |
| 3125 | - "use strict"; | |
| 3126 | - text2 = globals.converter._dispatch("autoLinks.before", text2, options, globals); | |
| 3127 | - text2 = text2.replace(delimUrlRegex, replaceLink(options)); | |
| 3128 | - text2 = text2.replace(delimMailRegex, replaceMail(options, globals)); | |
| 3129 | - text2 = globals.converter._dispatch("autoLinks.after", text2, options, globals); | |
| 3130 | - return text2; | |
| 3131 | - }); | |
| 3132 | - showdown2.subParser("simplifiedAutoLinks", function(text2, options, globals) { | |
| 3133 | - "use strict"; | |
| 3134 | - if (!options.simplifiedAutoLink) { | |
| 3135 | - return text2; | |
| 3136 | - } | |
| 3137 | - text2 = globals.converter._dispatch("simplifiedAutoLinks.before", text2, options, globals); | |
| 3138 | - if (options.excludeTrailingPunctuationFromURLs) { | |
| 3139 | - text2 = text2.replace(simpleURLRegex2, replaceLink(options)); | |
| 3140 | - } else { | |
| 3141 | - text2 = text2.replace(simpleURLRegex, replaceLink(options)); | |
| 3142 | - } | |
| 3143 | - text2 = text2.replace(simpleMailRegex, replaceMail(options, globals)); | |
| 3144 | - text2 = globals.converter._dispatch("simplifiedAutoLinks.after", text2, options, globals); | |
| 3145 | - return text2; | |
| 3146 | - }); | |
| 3147 | - showdown2.subParser("blockGamut", function(text2, options, globals) { | |
| 3148 | - "use strict"; | |
| 3149 | - text2 = globals.converter._dispatch("blockGamut.before", text2, options, globals); | |
| 3150 | - text2 = showdown2.subParser("blockQuotes")(text2, options, globals); | |
| 3151 | - text2 = showdown2.subParser("headers")(text2, options, globals); | |
| 3152 | - text2 = showdown2.subParser("horizontalRule")(text2, options, globals); | |
| 3153 | - text2 = showdown2.subParser("lists")(text2, options, globals); | |
| 3154 | - text2 = showdown2.subParser("codeBlocks")(text2, options, globals); | |
| 3155 | - text2 = showdown2.subParser("tables")(text2, options, globals); | |
| 3156 | - text2 = showdown2.subParser("hashHTMLBlocks")(text2, options, globals); | |
| 3157 | - text2 = showdown2.subParser("paragraphs")(text2, options, globals); | |
| 3158 | - text2 = globals.converter._dispatch("blockGamut.after", text2, options, globals); | |
| 3159 | - return text2; | |
| 3160 | - }); | |
| 3161 | - showdown2.subParser("blockQuotes", function(text2, options, globals) { | |
| 3162 | - "use strict"; | |
| 3163 | - text2 = globals.converter._dispatch("blockQuotes.before", text2, options, globals); | |
| 3164 | - text2 = text2 + "\n\n"; | |
| 3165 | - var rgx = /(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm; | |
| 3166 | - if (options.splitAdjacentBlockquotes) { | |
| 3167 | - rgx = /^ {0,3}>[\s\S]*?(?:\n\n)/gm; | |
| 3168 | - } | |
| 3169 | - text2 = text2.replace(rgx, function(bq) { | |
| 3170 | - bq = bq.replace(/^[ \t]*>[ \t]?/gm, ""); | |
| 3171 | - bq = bq.replace(/¨0/g, ""); | |
| 3172 | - bq = bq.replace(/^[ \t]+$/gm, ""); | |
| 3173 | - bq = showdown2.subParser("githubCodeBlocks")(bq, options, globals); | |
| 3174 | - bq = showdown2.subParser("blockGamut")(bq, options, globals); | |
| 3175 | - bq = bq.replace(/(^|\n)/g, "$1 "); | |
| 3176 | - bq = bq.replace(/(\s*<pre>[^\r]+?<\/pre>)/gm, function(wholeMatch, m1) { | |
| 3177 | - var pre = m1; | |
| 3178 | - pre = pre.replace(/^ /mg, "\xA80"); | |
| 3179 | - pre = pre.replace(/¨0/g, ""); | |
| 3180 | - return pre; | |
| 3181 | - }); | |
| 3182 | - return showdown2.subParser("hashBlock")("<blockquote>\n" + bq + "\n</blockquote>", options, globals); | |
| 3183 | - }); | |
| 3184 | - text2 = globals.converter._dispatch("blockQuotes.after", text2, options, globals); | |
| 3185 | - return text2; | |
| 3186 | - }); | |
| 3187 | - showdown2.subParser("codeBlocks", function(text2, options, globals) { | |
| 3188 | - "use strict"; | |
| 3189 | - text2 = globals.converter._dispatch("codeBlocks.before", text2, options, globals); | |
| 3190 | - text2 += "\xA80"; | |
| 3191 | - var pattern = /(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g; | |
| 3192 | - text2 = text2.replace(pattern, function(wholeMatch, m1, m2) { | |
| 3193 | - var codeblock = m1, nextChar = m2, end = "\n"; | |
| 3194 | - codeblock = showdown2.subParser("outdent")(codeblock, options, globals); | |
| 3195 | - codeblock = showdown2.subParser("encodeCode")(codeblock, options, globals); | |
| 3196 | - codeblock = showdown2.subParser("detab")(codeblock, options, globals); | |
| 3197 | - codeblock = codeblock.replace(/^\n+/g, ""); | |
| 3198 | - codeblock = codeblock.replace(/\n+$/g, ""); | |
| 3199 | - if (options.omitExtraWLInCodeBlocks) { | |
| 3200 | - end = ""; | |
| 3201 | - } | |
| 3202 | - codeblock = "<pre><code>" + codeblock + end + "</code></pre>"; | |
| 3203 | - return showdown2.subParser("hashBlock")(codeblock, options, globals) + nextChar; | |
| 3204 | - }); | |
| 3205 | - text2 = text2.replace(/¨0/, ""); | |
| 3206 | - text2 = globals.converter._dispatch("codeBlocks.after", text2, options, globals); | |
| 3207 | - return text2; | |
| 3208 | - }); | |
| 3209 | - showdown2.subParser("codeSpans", function(text2, options, globals) { | |
| 3210 | - "use strict"; | |
| 3211 | - text2 = globals.converter._dispatch("codeSpans.before", text2, options, globals); | |
| 3212 | - if (typeof text2 === "undefined") { | |
| 3213 | - text2 = ""; | |
| 3214 | - } | |
| 3215 | - text2 = text2.replace( | |
| 3216 | - /(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm, | |
| 3217 | - function(wholeMatch, m1, m2, m3) { | |
| 3218 | - var c2 = m3; | |
| 3219 | - c2 = c2.replace(/^([ \t]*)/g, ""); | |
| 3220 | - c2 = c2.replace(/[ \t]*$/g, ""); | |
| 3221 | - c2 = showdown2.subParser("encodeCode")(c2, options, globals); | |
| 3222 | - c2 = m1 + "<code>" + c2 + "</code>"; | |
| 3223 | - c2 = showdown2.subParser("hashHTMLSpans")(c2, options, globals); | |
| 3224 | - return c2; | |
| 3225 | - } | |
| 3226 | - ); | |
| 3227 | - text2 = globals.converter._dispatch("codeSpans.after", text2, options, globals); | |
| 3228 | - return text2; | |
| 3229 | - }); | |
| 3230 | - showdown2.subParser("completeHTMLDocument", function(text2, options, globals) { | |
| 3231 | - "use strict"; | |
| 3232 | - if (!options.completeHTMLDocument) { | |
| 3233 | - return text2; | |
| 3234 | - } | |
| 3235 | - text2 = globals.converter._dispatch("completeHTMLDocument.before", text2, options, globals); | |
| 3236 | - var doctype = "html", doctypeParsed = "<!DOCTYPE HTML>\n", title = "", charset = '<meta charset="utf-8">\n', lang = "", metadata = ""; | |
| 3237 | - if (typeof globals.metadata.parsed.doctype !== "undefined") { | |
| 3238 | - doctypeParsed = "<!DOCTYPE " + globals.metadata.parsed.doctype + ">\n"; | |
| 3239 | - doctype = globals.metadata.parsed.doctype.toString().toLowerCase(); | |
| 3240 | - if (doctype === "html" || doctype === "html5") { | |
| 3241 | - charset = '<meta charset="utf-8">'; | |
| 3242 | - } | |
| 3243 | - } | |
| 3244 | - for (var meta in globals.metadata.parsed) { | |
| 3245 | - if (globals.metadata.parsed.hasOwnProperty(meta)) { | |
| 3246 | - switch (meta.toLowerCase()) { | |
| 3247 | - case "doctype": | |
| 3248 | - break; | |
| 3249 | - case "title": | |
| 3250 | - title = "<title>" + globals.metadata.parsed.title + "</title>\n"; | |
| 3251 | - break; | |
| 3252 | - case "charset": | |
| 3253 | - if (doctype === "html" || doctype === "html5") { | |
| 3254 | - charset = '<meta charset="' + globals.metadata.parsed.charset + '">\n'; | |
| 3255 | - } else { | |
| 3256 | - charset = '<meta name="charset" content="' + globals.metadata.parsed.charset + '">\n'; | |
| 3257 | - } | |
| 3258 | - break; | |
| 3259 | - case "language": | |
| 3260 | - case "lang": | |
| 3261 | - lang = ' lang="' + globals.metadata.parsed[meta] + '"'; | |
| 3262 | - metadata += '<meta name="' + meta + '" content="' + globals.metadata.parsed[meta] + '">\n'; | |
| 3263 | - break; | |
| 3264 | - default: | |
| 3265 | - metadata += '<meta name="' + meta + '" content="' + globals.metadata.parsed[meta] + '">\n'; | |
| 3266 | - } | |
| 3267 | - } | |
| 3268 | - } | |
| 3269 | - text2 = doctypeParsed + "<html" + lang + ">\n<head>\n" + title + charset + metadata + "</head>\n<body>\n" + text2.trim() + "\n</body>\n</html>"; | |
| 3270 | - text2 = globals.converter._dispatch("completeHTMLDocument.after", text2, options, globals); | |
| 3271 | - return text2; | |
| 3272 | - }); | |
| 3273 | - showdown2.subParser("detab", function(text2, options, globals) { | |
| 3274 | - "use strict"; | |
| 3275 | - text2 = globals.converter._dispatch("detab.before", text2, options, globals); | |
| 3276 | - text2 = text2.replace(/\t(?=\t)/g, " "); | |
| 3277 | - text2 = text2.replace(/\t/g, "\xA8A\xA8B"); | |
| 3278 | - text2 = text2.replace(/¨B(.+?)¨A/g, function(wholeMatch, m1) { | |
| 3279 | - var leadingText = m1, numSpaces = 4 - leadingText.length % 4; | |
| 3280 | - for (var i2 = 0; i2 < numSpaces; i2++) { | |
| 3281 | - leadingText += " "; | |
| 3282 | - } | |
| 3283 | - return leadingText; | |
| 3284 | - }); | |
| 3285 | - text2 = text2.replace(/¨A/g, " "); | |
| 3286 | - text2 = text2.replace(/¨B/g, ""); | |
| 3287 | - text2 = globals.converter._dispatch("detab.after", text2, options, globals); | |
| 3288 | - return text2; | |
| 3289 | - }); | |
| 3290 | - showdown2.subParser("ellipsis", function(text2, options, globals) { | |
| 3291 | - "use strict"; | |
| 3292 | - text2 = globals.converter._dispatch("ellipsis.before", text2, options, globals); | |
| 3293 | - text2 = text2.replace(/\.\.\./g, "\u2026"); | |
| 3294 | - text2 = globals.converter._dispatch("ellipsis.after", text2, options, globals); | |
| 3295 | - return text2; | |
| 3296 | - }); | |
| 3297 | - showdown2.subParser("emoji", function(text2, options, globals) { | |
| 3298 | - "use strict"; | |
| 3299 | - if (!options.emoji) { | |
| 3300 | - return text2; | |
| 3301 | - } | |
| 3302 | - text2 = globals.converter._dispatch("emoji.before", text2, options, globals); | |
| 3303 | - var emojiRgx = /:([\S]+?):/g; | |
| 3304 | - text2 = text2.replace(emojiRgx, function(wm, emojiCode) { | |
| 3305 | - if (showdown2.helper.emojis.hasOwnProperty(emojiCode)) { | |
| 3306 | - return showdown2.helper.emojis[emojiCode]; | |
| 3307 | - } | |
| 3308 | - return wm; | |
| 3309 | - }); | |
| 3310 | - text2 = globals.converter._dispatch("emoji.after", text2, options, globals); | |
| 3311 | - return text2; | |
| 3312 | - }); | |
| 3313 | - showdown2.subParser("encodeAmpsAndAngles", function(text2, options, globals) { | |
| 3314 | - "use strict"; | |
| 3315 | - text2 = globals.converter._dispatch("encodeAmpsAndAngles.before", text2, options, globals); | |
| 3316 | - text2 = text2.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g, "&"); | |
| 3317 | - text2 = text2.replace(/<(?![a-z\/?$!])/gi, "<"); | |
| 3318 | - text2 = text2.replace(/</g, "<"); | |
| 3319 | - text2 = text2.replace(/>/g, ">"); | |
| 3320 | - text2 = globals.converter._dispatch("encodeAmpsAndAngles.after", text2, options, globals); | |
| 3321 | - return text2; | |
| 3322 | - }); | |
| 3323 | - showdown2.subParser("encodeBackslashEscapes", function(text2, options, globals) { | |
| 3324 | - "use strict"; | |
| 3325 | - text2 = globals.converter._dispatch("encodeBackslashEscapes.before", text2, options, globals); | |
| 3326 | - text2 = text2.replace(/\\(\\)/g, showdown2.helper.escapeCharactersCallback); | |
| 3327 | - text2 = text2.replace(/\\([`*_{}\[\]()>#+.!~=|-])/g, showdown2.helper.escapeCharactersCallback); | |
| 3328 | - text2 = globals.converter._dispatch("encodeBackslashEscapes.after", text2, options, globals); | |
| 3329 | - return text2; | |
| 3330 | - }); | |
| 3331 | - showdown2.subParser("encodeCode", function(text2, options, globals) { | |
| 3332 | - "use strict"; | |
| 3333 | - text2 = globals.converter._dispatch("encodeCode.before", text2, options, globals); | |
| 3334 | - text2 = text2.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/([*_{}\[\]\\=~-])/g, showdown2.helper.escapeCharactersCallback); | |
| 3335 | - text2 = globals.converter._dispatch("encodeCode.after", text2, options, globals); | |
| 3336 | - return text2; | |
| 3337 | - }); | |
| 3338 | - showdown2.subParser("escapeSpecialCharsWithinTagAttributes", function(text2, options, globals) { | |
| 3339 | - "use strict"; | |
| 3340 | - text2 = globals.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before", text2, options, globals); | |
| 3341 | - var tags = /<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi, comments = /<!(--(?:(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>/gi; | |
| 3342 | - text2 = text2.replace(tags, function(wholeMatch) { | |
| 3343 | - return wholeMatch.replace(/(.)<\/?code>(?=.)/g, "$1`").replace(/([\\`*_~=|])/g, showdown2.helper.escapeCharactersCallback); | |
| 3344 | - }); | |
| 3345 | - text2 = text2.replace(comments, function(wholeMatch) { | |
| 3346 | - return wholeMatch.replace(/([\\`*_~=|])/g, showdown2.helper.escapeCharactersCallback); | |
| 3347 | - }); | |
| 3348 | - text2 = globals.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after", text2, options, globals); | |
| 3349 | - return text2; | |
| 3350 | - }); | |
| 3351 | - showdown2.subParser("githubCodeBlocks", function(text2, options, globals) { | |
| 3352 | - "use strict"; | |
| 3353 | - if (!options.ghCodeBlocks) { | |
| 3354 | - return text2; | |
| 3355 | - } | |
| 3356 | - text2 = globals.converter._dispatch("githubCodeBlocks.before", text2, options, globals); | |
| 3357 | - text2 += "\xA80"; | |
| 3358 | - text2 = text2.replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g, function(wholeMatch, delim, language, codeblock) { | |
| 3359 | - var end = options.omitExtraWLInCodeBlocks ? "" : "\n"; | |
| 3360 | - codeblock = showdown2.subParser("encodeCode")(codeblock, options, globals); | |
| 3361 | - codeblock = showdown2.subParser("detab")(codeblock, options, globals); | |
| 3362 | - codeblock = codeblock.replace(/^\n+/g, ""); | |
| 3363 | - codeblock = codeblock.replace(/\n+$/g, ""); | |
| 3364 | - codeblock = "<pre><code" + (language ? ' class="' + language + " language-" + language + '"' : "") + ">" + codeblock + end + "</code></pre>"; | |
| 3365 | - codeblock = showdown2.subParser("hashBlock")(codeblock, options, globals); | |
| 3366 | - return "\n\n\xA8G" + (globals.ghCodeBlocks.push({ text: wholeMatch, codeblock }) - 1) + "G\n\n"; | |
| 3367 | - }); | |
| 3368 | - text2 = text2.replace(/¨0/, ""); | |
| 3369 | - return globals.converter._dispatch("githubCodeBlocks.after", text2, options, globals); | |
| 3370 | - }); | |
| 3371 | - showdown2.subParser("hashBlock", function(text2, options, globals) { | |
| 3372 | - "use strict"; | |
| 3373 | - text2 = globals.converter._dispatch("hashBlock.before", text2, options, globals); | |
| 3374 | - text2 = text2.replace(/(^\n+|\n+$)/g, ""); | |
| 3375 | - text2 = "\n\n\xA8K" + (globals.gHtmlBlocks.push(text2) - 1) + "K\n\n"; | |
| 3376 | - text2 = globals.converter._dispatch("hashBlock.after", text2, options, globals); | |
| 3377 | - return text2; | |
| 3378 | - }); | |
| 3379 | - showdown2.subParser("hashCodeTags", function(text2, options, globals) { | |
| 3380 | - "use strict"; | |
| 3381 | - text2 = globals.converter._dispatch("hashCodeTags.before", text2, options, globals); | |
| 3382 | - var repFunc = function(wholeMatch, match, left, right) { | |
| 3383 | - var codeblock = left + showdown2.subParser("encodeCode")(match, options, globals) + right; | |
| 3384 | - return "\xA8C" + (globals.gHtmlSpans.push(codeblock) - 1) + "C"; | |
| 3385 | - }; | |
| 3386 | - text2 = showdown2.helper.replaceRecursiveRegExp(text2, repFunc, "<code\\b[^>]*>", "</code>", "gim"); | |
| 3387 | - text2 = globals.converter._dispatch("hashCodeTags.after", text2, options, globals); | |
| 3388 | - return text2; | |
| 3389 | - }); | |
| 3390 | - showdown2.subParser("hashElement", function(text2, options, globals) { | |
| 3391 | - "use strict"; | |
| 3392 | - return function(wholeMatch, m1) { | |
| 3393 | - var blockText = m1; | |
| 3394 | - blockText = blockText.replace(/\n\n/g, "\n"); | |
| 3395 | - blockText = blockText.replace(/^\n/, ""); | |
| 3396 | - blockText = blockText.replace(/\n+$/g, ""); | |
| 3397 | - blockText = "\n\n\xA8K" + (globals.gHtmlBlocks.push(blockText) - 1) + "K\n\n"; | |
| 3398 | - return blockText; | |
| 3399 | - }; | |
| 3400 | - }); | |
| 3401 | - showdown2.subParser("hashHTMLBlocks", function(text2, options, globals) { | |
| 3402 | - "use strict"; | |
| 3403 | - text2 = globals.converter._dispatch("hashHTMLBlocks.before", text2, options, globals); | |
| 3404 | - var blockTags = [ | |
| 3405 | - "pre", | |
| 3406 | - "div", | |
| 3407 | - "h1", | |
| 3408 | - "h2", | |
| 3409 | - "h3", | |
| 3410 | - "h4", | |
| 3411 | - "h5", | |
| 3412 | - "h6", | |
| 3413 | - "blockquote", | |
| 3414 | - "table", | |
| 3415 | - "dl", | |
| 3416 | - "ol", | |
| 3417 | - "ul", | |
| 3418 | - "script", | |
| 3419 | - "noscript", | |
| 3420 | - "form", | |
| 3421 | - "fieldset", | |
| 3422 | - "iframe", | |
| 3423 | - "math", | |
| 3424 | - "style", | |
| 3425 | - "section", | |
| 3426 | - "header", | |
| 3427 | - "footer", | |
| 3428 | - "nav", | |
| 3429 | - "article", | |
| 3430 | - "aside", | |
| 3431 | - "address", | |
| 3432 | - "audio", | |
| 3433 | - "canvas", | |
| 3434 | - "figure", | |
| 3435 | - "hgroup", | |
| 3436 | - "output", | |
| 3437 | - "video", | |
| 3438 | - "p" | |
| 3439 | - ], repFunc = function(wholeMatch, match, left, right) { | |
| 3440 | - var txt = wholeMatch; | |
| 3441 | - if (left.search(/\bmarkdown\b/) !== -1) { | |
| 3442 | - txt = left + globals.converter.makeHtml(match) + right; | |
| 3443 | - } | |
| 3444 | - return "\n\n\xA8K" + (globals.gHtmlBlocks.push(txt) - 1) + "K\n\n"; | |
| 3445 | - }; | |
| 3446 | - if (options.backslashEscapesHTMLTags) { | |
| 3447 | - text2 = text2.replace(/\\<(\/?[^>]+?)>/g, function(wm, inside) { | |
| 3448 | - return "<" + inside + ">"; | |
| 3449 | - }); | |
| 3450 | - } | |
| 3451 | - for (var i2 = 0; i2 < blockTags.length; ++i2) { | |
| 3452 | - var opTagPos, rgx1 = new RegExp("^ {0,3}(<" + blockTags[i2] + "\\b[^>]*>)", "im"), patLeft = "<" + blockTags[i2] + "\\b[^>]*>", patRight = "</" + blockTags[i2] + ">"; | |
| 3453 | - while ((opTagPos = showdown2.helper.regexIndexOf(text2, rgx1)) !== -1) { | |
| 3454 | - var subTexts = showdown2.helper.splitAtIndex(text2, opTagPos), newSubText1 = showdown2.helper.replaceRecursiveRegExp(subTexts[1], repFunc, patLeft, patRight, "im"); | |
| 3455 | - if (newSubText1 === subTexts[1]) { | |
| 3456 | - break; | |
| 3457 | - } | |
| 3458 | - text2 = subTexts[0].concat(newSubText1); | |
| 3459 | - } | |
| 3460 | - } | |
| 3461 | - text2 = text2.replace( | |
| 3462 | - /(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g, | |
| 3463 | - showdown2.subParser("hashElement")(text2, options, globals) | |
| 3464 | - ); | |
| 3465 | - text2 = showdown2.helper.replaceRecursiveRegExp(text2, function(txt) { | |
| 3466 | - return "\n\n\xA8K" + (globals.gHtmlBlocks.push(txt) - 1) + "K\n\n"; | |
| 3467 | - }, "^ {0,3}<!--", "-->", "gm"); | |
| 3468 | - text2 = text2.replace( | |
| 3469 | - /(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g, | |
| 3470 | - showdown2.subParser("hashElement")(text2, options, globals) | |
| 3471 | - ); | |
| 3472 | - text2 = globals.converter._dispatch("hashHTMLBlocks.after", text2, options, globals); | |
| 3473 | - return text2; | |
| 3474 | - }); | |
| 3475 | - showdown2.subParser("hashHTMLSpans", function(text2, options, globals) { | |
| 3476 | - "use strict"; | |
| 3477 | - text2 = globals.converter._dispatch("hashHTMLSpans.before", text2, options, globals); | |
| 3478 | - function hashHTMLSpan(html2) { | |
| 3479 | - return "\xA8C" + (globals.gHtmlSpans.push(html2) - 1) + "C"; | |
| 3480 | - } | |
| 3481 | - text2 = text2.replace(/<[^>]+?\/>/gi, function(wm) { | |
| 3482 | - return hashHTMLSpan(wm); | |
| 3483 | - }); | |
| 3484 | - text2 = text2.replace(/<([^>]+?)>[\s\S]*?<\/\1>/g, function(wm) { | |
| 3485 | - return hashHTMLSpan(wm); | |
| 3486 | - }); | |
| 3487 | - text2 = text2.replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g, function(wm) { | |
| 3488 | - return hashHTMLSpan(wm); | |
| 3489 | - }); | |
| 3490 | - text2 = text2.replace(/<[^>]+?>/gi, function(wm) { | |
| 3491 | - return hashHTMLSpan(wm); | |
| 3492 | - }); | |
| 3493 | - text2 = globals.converter._dispatch("hashHTMLSpans.after", text2, options, globals); | |
| 3494 | - return text2; | |
| 3495 | - }); | |
| 3496 | - showdown2.subParser("unhashHTMLSpans", function(text2, options, globals) { | |
| 3497 | - "use strict"; | |
| 3498 | - text2 = globals.converter._dispatch("unhashHTMLSpans.before", text2, options, globals); | |
| 3499 | - for (var i2 = 0; i2 < globals.gHtmlSpans.length; ++i2) { | |
| 3500 | - var repText = globals.gHtmlSpans[i2], limit = 0; | |
| 3501 | - while (/¨C(\d+)C/.test(repText)) { | |
| 3502 | - var num = RegExp.$1; | |
| 3503 | - repText = repText.replace("\xA8C" + num + "C", globals.gHtmlSpans[num]); | |
| 3504 | - if (limit === 10) { | |
| 3505 | - console.error("maximum nesting of 10 spans reached!!!"); | |
| 3506 | - break; | |
| 3507 | - } | |
| 3508 | - ++limit; | |
| 3509 | - } | |
| 3510 | - text2 = text2.replace("\xA8C" + i2 + "C", repText); | |
| 3511 | - } | |
| 3512 | - text2 = globals.converter._dispatch("unhashHTMLSpans.after", text2, options, globals); | |
| 3513 | - return text2; | |
| 3514 | - }); | |
| 3515 | - showdown2.subParser("hashPreCodeTags", function(text2, options, globals) { | |
| 3516 | - "use strict"; | |
| 3517 | - text2 = globals.converter._dispatch("hashPreCodeTags.before", text2, options, globals); | |
| 3518 | - var repFunc = function(wholeMatch, match, left, right) { | |
| 3519 | - var codeblock = left + showdown2.subParser("encodeCode")(match, options, globals) + right; | |
| 3520 | - return "\n\n\xA8G" + (globals.ghCodeBlocks.push({ text: wholeMatch, codeblock }) - 1) + "G\n\n"; | |
| 3521 | - }; | |
| 3522 | - text2 = showdown2.helper.replaceRecursiveRegExp(text2, repFunc, "^ {0,3}<pre\\b[^>]*>\\s*<code\\b[^>]*>", "^ {0,3}</code>\\s*</pre>", "gim"); | |
| 3523 | - text2 = globals.converter._dispatch("hashPreCodeTags.after", text2, options, globals); | |
| 3524 | - return text2; | |
| 3525 | - }); | |
| 3526 | - showdown2.subParser("headers", function(text2, options, globals) { | |
| 3527 | - "use strict"; | |
| 3528 | - text2 = globals.converter._dispatch("headers.before", text2, options, globals); | |
| 3529 | - var headerLevelStart = isNaN(parseInt(options.headerLevelStart)) ? 1 : parseInt(options.headerLevelStart), setextRegexH1 = options.smoothLivePreview ? /^(.+)[ \t]*\n={2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n=+[ \t]*\n+/gm, setextRegexH2 = options.smoothLivePreview ? /^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n-+[ \t]*\n+/gm; | |
| 3530 | - text2 = text2.replace(setextRegexH1, function(wholeMatch, m1) { | |
| 3531 | - var spanGamut = showdown2.subParser("spanGamut")(m1, options, globals), hID = options.noHeaderId ? "" : ' id="' + headerId(m1) + '"', hLevel = headerLevelStart, hashBlock = "<h" + hLevel + hID + ">" + spanGamut + "</h" + hLevel + ">"; | |
| 3532 | - return showdown2.subParser("hashBlock")(hashBlock, options, globals); | |
| 3533 | - }); | |
| 3534 | - text2 = text2.replace(setextRegexH2, function(matchFound, m1) { | |
| 3535 | - var spanGamut = showdown2.subParser("spanGamut")(m1, options, globals), hID = options.noHeaderId ? "" : ' id="' + headerId(m1) + '"', hLevel = headerLevelStart + 1, hashBlock = "<h" + hLevel + hID + ">" + spanGamut + "</h" + hLevel + ">"; | |
| 3536 | - return showdown2.subParser("hashBlock")(hashBlock, options, globals); | |
| 3537 | - }); | |
| 3538 | - var atxStyle = options.requireSpaceBeforeHeadingText ? /^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm : /^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm; | |
| 3539 | - text2 = text2.replace(atxStyle, function(wholeMatch, m1, m2) { | |
| 3540 | - var hText = m2; | |
| 3541 | - if (options.customizedHeaderId) { | |
| 3542 | - hText = m2.replace(/\s?\{([^{]+?)}\s*$/, ""); | |
| 3543 | - } | |
| 3544 | - var span = showdown2.subParser("spanGamut")(hText, options, globals), hID = options.noHeaderId ? "" : ' id="' + headerId(m2) + '"', hLevel = headerLevelStart - 1 + m1.length, header = "<h" + hLevel + hID + ">" + span + "</h" + hLevel + ">"; | |
| 3545 | - return showdown2.subParser("hashBlock")(header, options, globals); | |
| 3546 | - }); | |
| 3547 | - function headerId(m2) { | |
| 3548 | - var title, prefix; | |
| 3549 | - if (options.customizedHeaderId) { | |
| 3550 | - var match = m2.match(/\{([^{]+?)}\s*$/); | |
| 3551 | - if (match && match[1]) { | |
| 3552 | - m2 = match[1]; | |
| 3553 | - } | |
| 3554 | - } | |
| 3555 | - title = m2; | |
| 3556 | - if (showdown2.helper.isString(options.prefixHeaderId)) { | |
| 3557 | - prefix = options.prefixHeaderId; | |
| 3558 | - } else if (options.prefixHeaderId === true) { | |
| 3559 | - prefix = "section-"; | |
| 3560 | - } else { | |
| 3561 | - prefix = ""; | |
| 3562 | - } | |
| 3563 | - if (!options.rawPrefixHeaderId) { | |
| 3564 | - title = prefix + title; | |
| 3565 | - } | |
| 3566 | - if (options.ghCompatibleHeaderId) { | |
| 3567 | - title = title.replace(/ /g, "-").replace(/&/g, "").replace(/¨T/g, "").replace(/¨D/g, "").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g, "").toLowerCase(); | |
| 3568 | - } else if (options.rawHeaderId) { | |
| 3569 | - title = title.replace(/ /g, "-").replace(/&/g, "&").replace(/¨T/g, "\xA8").replace(/¨D/g, "$").replace(/["']/g, "-").toLowerCase(); | |
| 3570 | - } else { | |
| 3571 | - title = title.replace(/[^\w]/g, "").toLowerCase(); | |
| 3572 | - } | |
| 3573 | - if (options.rawPrefixHeaderId) { | |
| 3574 | - title = prefix + title; | |
| 3575 | - } | |
| 3576 | - if (globals.hashLinkCounts[title]) { | |
| 3577 | - title = title + "-" + globals.hashLinkCounts[title]++; | |
| 3578 | - } else { | |
| 3579 | - globals.hashLinkCounts[title] = 1; | |
| 3580 | - } | |
| 3581 | - return title; | |
| 3582 | - } | |
| 3583 | - text2 = globals.converter._dispatch("headers.after", text2, options, globals); | |
| 3584 | - return text2; | |
| 3585 | - }); | |
| 3586 | - showdown2.subParser("horizontalRule", function(text2, options, globals) { | |
| 3587 | - "use strict"; | |
| 3588 | - text2 = globals.converter._dispatch("horizontalRule.before", text2, options, globals); | |
| 3589 | - var key = showdown2.subParser("hashBlock")("<hr />", options, globals); | |
| 3590 | - text2 = text2.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm, key); | |
| 3591 | - text2 = text2.replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm, key); | |
| 3592 | - text2 = text2.replace(/^ {0,2}( ?_){3,}[ \t]*$/gm, key); | |
| 3593 | - text2 = globals.converter._dispatch("horizontalRule.after", text2, options, globals); | |
| 3594 | - return text2; | |
| 3595 | - }); | |
| 3596 | - showdown2.subParser("images", function(text2, options, globals) { | |
| 3597 | - "use strict"; | |
| 3598 | - text2 = globals.converter._dispatch("images.before", text2, options, globals); | |
| 3599 | - var inlineRegExp = /!\[([^\]]*?)][ \t]*()\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g, crazyRegExp = /!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g, base64RegExp = /!\[([^\]]*?)][ \t]*()\([ \t]?<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g, referenceRegExp = /!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g, refShortcutRegExp = /!\[([^\[\]]+)]()()()()()/g; | |
| 3600 | - function writeImageTagBase64(wholeMatch, altText, linkId, url, width, height, m5, title) { | |
| 3601 | - url = url.replace(/\s/g, ""); | |
| 3602 | - return writeImageTag(wholeMatch, altText, linkId, url, width, height, m5, title); | |
| 3603 | - } | |
| 3604 | - function writeImageTag(wholeMatch, altText, linkId, url, width, height, m5, title) { | |
| 3605 | - var gUrls = globals.gUrls, gTitles = globals.gTitles, gDims = globals.gDimensions; | |
| 3606 | - linkId = linkId.toLowerCase(); | |
| 3607 | - if (!title) { | |
| 3608 | - title = ""; | |
| 3609 | - } | |
| 3610 | - if (wholeMatch.search(/\(<?\s*>? ?(['"].*['"])?\)$/m) > -1) { | |
| 3611 | - url = ""; | |
| 3612 | - } else if (url === "" || url === null) { | |
| 3613 | - if (linkId === "" || linkId === null) { | |
| 3614 | - linkId = altText.toLowerCase().replace(/ ?\n/g, " "); | |
| 3615 | - } | |
| 3616 | - url = "#" + linkId; | |
| 3617 | - if (!showdown2.helper.isUndefined(gUrls[linkId])) { | |
| 3618 | - url = gUrls[linkId]; | |
| 3619 | - if (!showdown2.helper.isUndefined(gTitles[linkId])) { | |
| 3620 | - title = gTitles[linkId]; | |
| 3621 | - } | |
| 3622 | - if (!showdown2.helper.isUndefined(gDims[linkId])) { | |
| 3623 | - width = gDims[linkId].width; | |
| 3624 | - height = gDims[linkId].height; | |
| 3625 | - } | |
| 3626 | - } else { | |
| 3627 | - return wholeMatch; | |
| 3628 | - } | |
| 3629 | - } | |
| 3630 | - altText = altText.replace(/"/g, """).replace(showdown2.helper.regexes.asteriskDashAndColon, showdown2.helper.escapeCharactersCallback); | |
| 3631 | - url = url.replace(showdown2.helper.regexes.asteriskDashAndColon, showdown2.helper.escapeCharactersCallback); | |
| 3632 | - var result = '<img src="' + url + '" alt="' + altText + '"'; | |
| 3633 | - if (title && showdown2.helper.isString(title)) { | |
| 3634 | - title = title.replace(/"/g, """).replace(showdown2.helper.regexes.asteriskDashAndColon, showdown2.helper.escapeCharactersCallback); | |
| 3635 | - result += ' title="' + title + '"'; | |
| 3636 | - } | |
| 3637 | - if (width && height) { | |
| 3638 | - width = width === "*" ? "auto" : width; | |
| 3639 | - height = height === "*" ? "auto" : height; | |
| 3640 | - result += ' width="' + width + '"'; | |
| 3641 | - result += ' height="' + height + '"'; | |
| 3642 | - } | |
| 3643 | - result += " />"; | |
| 3644 | - return result; | |
| 3645 | - } | |
| 3646 | - text2 = text2.replace(referenceRegExp, writeImageTag); | |
| 3647 | - text2 = text2.replace(base64RegExp, writeImageTagBase64); | |
| 3648 | - text2 = text2.replace(crazyRegExp, writeImageTag); | |
| 3649 | - text2 = text2.replace(inlineRegExp, writeImageTag); | |
| 3650 | - text2 = text2.replace(refShortcutRegExp, writeImageTag); | |
| 3651 | - text2 = globals.converter._dispatch("images.after", text2, options, globals); | |
| 3652 | - return text2; | |
| 3653 | - }); | |
| 3654 | - showdown2.subParser("italicsAndBold", function(text2, options, globals) { | |
| 3655 | - "use strict"; | |
| 3656 | - text2 = globals.converter._dispatch("italicsAndBold.before", text2, options, globals); | |
| 3657 | - function parseInside(txt, left, right) { | |
| 3658 | - return left + txt + right; | |
| 3659 | - } | |
| 3660 | - if (options.literalMidWordUnderscores) { | |
| 3661 | - text2 = text2.replace(/\b___(\S[\s\S]*?)___\b/g, function(wm, txt) { | |
| 3662 | - return parseInside(txt, "<strong><em>", "</em></strong>"); | |
| 3663 | - }); | |
| 3664 | - text2 = text2.replace(/\b__(\S[\s\S]*?)__\b/g, function(wm, txt) { | |
| 3665 | - return parseInside(txt, "<strong>", "</strong>"); | |
| 3666 | - }); | |
| 3667 | - text2 = text2.replace(/\b_(\S[\s\S]*?)_\b/g, function(wm, txt) { | |
| 3668 | - return parseInside(txt, "<em>", "</em>"); | |
| 3669 | - }); | |
| 3670 | - } else { | |
| 3671 | - text2 = text2.replace(/___(\S[\s\S]*?)___/g, function(wm, m2) { | |
| 3672 | - return /\S$/.test(m2) ? parseInside(m2, "<strong><em>", "</em></strong>") : wm; | |
| 3673 | - }); | |
| 3674 | - text2 = text2.replace(/__(\S[\s\S]*?)__/g, function(wm, m2) { | |
| 3675 | - return /\S$/.test(m2) ? parseInside(m2, "<strong>", "</strong>") : wm; | |
| 3676 | - }); | |
| 3677 | - text2 = text2.replace(/_([^\s_][\s\S]*?)_/g, function(wm, m2) { | |
| 3678 | - return /\S$/.test(m2) ? parseInside(m2, "<em>", "</em>") : wm; | |
| 3679 | - }); | |
| 3680 | - } | |
| 3681 | - if (options.literalMidWordAsterisks) { | |
| 3682 | - text2 = text2.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g, function(wm, lead, txt) { | |
| 3683 | - return parseInside(txt, lead + "<strong><em>", "</em></strong>"); | |
| 3684 | - }); | |
| 3685 | - text2 = text2.replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g, function(wm, lead, txt) { | |
| 3686 | - return parseInside(txt, lead + "<strong>", "</strong>"); | |
| 3687 | - }); | |
| 3688 | - text2 = text2.replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g, function(wm, lead, txt) { | |
| 3689 | - return parseInside(txt, lead + "<em>", "</em>"); | |
| 3690 | - }); | |
| 3691 | - } else { | |
| 3692 | - text2 = text2.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g, function(wm, m2) { | |
| 3693 | - return /\S$/.test(m2) ? parseInside(m2, "<strong><em>", "</em></strong>") : wm; | |
| 3694 | - }); | |
| 3695 | - text2 = text2.replace(/\*\*(\S[\s\S]*?)\*\*/g, function(wm, m2) { | |
| 3696 | - return /\S$/.test(m2) ? parseInside(m2, "<strong>", "</strong>") : wm; | |
| 3697 | - }); | |
| 3698 | - text2 = text2.replace(/\*([^\s*][\s\S]*?)\*/g, function(wm, m2) { | |
| 3699 | - return /\S$/.test(m2) ? parseInside(m2, "<em>", "</em>") : wm; | |
| 3700 | - }); | |
| 3701 | - } | |
| 3702 | - text2 = globals.converter._dispatch("italicsAndBold.after", text2, options, globals); | |
| 3703 | - return text2; | |
| 3704 | - }); | |
| 3705 | - showdown2.subParser("lists", function(text2, options, globals) { | |
| 3706 | - "use strict"; | |
| 3707 | - function processListItems(listStr, trimTrailing) { | |
| 3708 | - globals.gListLevel++; | |
| 3709 | - listStr = listStr.replace(/\n{2,}$/, "\n"); | |
| 3710 | - listStr += "\xA80"; | |
| 3711 | - var rgx = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm, isParagraphed = /\n[ \t]*\n(?!¨0)/.test(listStr); | |
| 3712 | - if (options.disableForced4SpacesIndentedSublists) { | |
| 3713 | - rgx = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm; | |
| 3714 | - } | |
| 3715 | - listStr = listStr.replace(rgx, function(wholeMatch, m1, m2, m3, m4, taskbtn, checked) { | |
| 3716 | - checked = checked && checked.trim() !== ""; | |
| 3717 | - var item = showdown2.subParser("outdent")(m4, options, globals), bulletStyle = ""; | |
| 3718 | - if (taskbtn && options.tasklists) { | |
| 3719 | - bulletStyle = ' class="task-list-item" style="list-style-type: none;"'; | |
| 3720 | - item = item.replace(/^[ \t]*\[(x|X| )?]/m, function() { | |
| 3721 | - var otp = '<input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"'; | |
| 3722 | - if (checked) { | |
| 3723 | - otp += " checked"; | |
| 3724 | - } | |
| 3725 | - otp += ">"; | |
| 3726 | - return otp; | |
| 3727 | - }); | |
| 3728 | - } | |
| 3729 | - item = item.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g, function(wm2) { | |
| 3730 | - return "\xA8A" + wm2; | |
| 3731 | - }); | |
| 3732 | - if (m1 || item.search(/\n{2,}/) > -1) { | |
| 3733 | - item = showdown2.subParser("githubCodeBlocks")(item, options, globals); | |
| 3734 | - item = showdown2.subParser("blockGamut")(item, options, globals); | |
| 3735 | - } else { | |
| 3736 | - item = showdown2.subParser("lists")(item, options, globals); | |
| 3737 | - item = item.replace(/\n$/, ""); | |
| 3738 | - item = showdown2.subParser("hashHTMLBlocks")(item, options, globals); | |
| 3739 | - item = item.replace(/\n\n+/g, "\n\n"); | |
| 3740 | - if (isParagraphed) { | |
| 3741 | - item = showdown2.subParser("paragraphs")(item, options, globals); | |
| 3742 | - } else { | |
| 3743 | - item = showdown2.subParser("spanGamut")(item, options, globals); | |
| 3744 | - } | |
| 3745 | - } | |
| 3746 | - item = item.replace("\xA8A", ""); | |
| 3747 | - item = "<li" + bulletStyle + ">" + item + "</li>\n"; | |
| 3748 | - return item; | |
| 3749 | - }); | |
| 3750 | - listStr = listStr.replace(/¨0/g, ""); | |
| 3751 | - globals.gListLevel--; | |
| 3752 | - if (trimTrailing) { | |
| 3753 | - listStr = listStr.replace(/\s+$/, ""); | |
| 3754 | - } | |
| 3755 | - return listStr; | |
| 3756 | - } | |
| 3757 | - function styleStartNumber(list, listType) { | |
| 3758 | - if (listType === "ol") { | |
| 3759 | - var res = list.match(/^ *(\d+)\./); | |
| 3760 | - if (res && res[1] !== "1") { | |
| 3761 | - return ' start="' + res[1] + '"'; | |
| 3762 | - } | |
| 3763 | - } | |
| 3764 | - return ""; | |
| 3765 | - } | |
| 3766 | - function parseConsecutiveLists(list, listType, trimTrailing) { | |
| 3767 | - var olRgx = options.disableForced4SpacesIndentedSublists ? /^ ?\d+\.[ \t]/gm : /^ {0,3}\d+\.[ \t]/gm, ulRgx = options.disableForced4SpacesIndentedSublists ? /^ ?[*+-][ \t]/gm : /^ {0,3}[*+-][ \t]/gm, counterRxg = listType === "ul" ? olRgx : ulRgx, result = ""; | |
| 3768 | - if (list.search(counterRxg) !== -1) { | |
| 3769 | - (function parseCL(txt) { | |
| 3770 | - var pos = txt.search(counterRxg), style2 = styleStartNumber(list, listType); | |
| 3771 | - if (pos !== -1) { | |
| 3772 | - result += "\n\n<" + listType + style2 + ">\n" + processListItems(txt.slice(0, pos), !!trimTrailing) + "</" + listType + ">\n"; | |
| 3773 | - listType = listType === "ul" ? "ol" : "ul"; | |
| 3774 | - counterRxg = listType === "ul" ? olRgx : ulRgx; | |
| 3775 | - parseCL(txt.slice(pos)); | |
| 3776 | - } else { | |
| 3777 | - result += "\n\n<" + listType + style2 + ">\n" + processListItems(txt, !!trimTrailing) + "</" + listType + ">\n"; | |
| 3778 | - } | |
| 3779 | - })(list); | |
| 3780 | - } else { | |
| 3781 | - var style = styleStartNumber(list, listType); | |
| 3782 | - result = "\n\n<" + listType + style + ">\n" + processListItems(list, !!trimTrailing) + "</" + listType + ">\n"; | |
| 3783 | - } | |
| 3784 | - return result; | |
| 3785 | - } | |
| 3786 | - text2 = globals.converter._dispatch("lists.before", text2, options, globals); | |
| 3787 | - text2 += "\xA80"; | |
| 3788 | - if (globals.gListLevel) { | |
| 3789 | - text2 = text2.replace( | |
| 3790 | - /^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm, | |
| 3791 | - function(wholeMatch, list, m2) { | |
| 3792 | - var listType = m2.search(/[*+-]/g) > -1 ? "ul" : "ol"; | |
| 3793 | - return parseConsecutiveLists(list, listType, true); | |
| 3794 | - } | |
| 3795 | - ); | |
| 3796 | - } else { | |
| 3797 | - text2 = text2.replace( | |
| 3798 | - /(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm, | |
| 3799 | - function(wholeMatch, m1, list, m3) { | |
| 3800 | - var listType = m3.search(/[*+-]/g) > -1 ? "ul" : "ol"; | |
| 3801 | - return parseConsecutiveLists(list, listType, false); | |
| 3802 | - } | |
| 3803 | - ); | |
| 3804 | - } | |
| 3805 | - text2 = text2.replace(/¨0/, ""); | |
| 3806 | - text2 = globals.converter._dispatch("lists.after", text2, options, globals); | |
| 3807 | - return text2; | |
| 3808 | - }); | |
| 3809 | - showdown2.subParser("metadata", function(text2, options, globals) { | |
| 3810 | - "use strict"; | |
| 3811 | - if (!options.metadata) { | |
| 3812 | - return text2; | |
| 3813 | - } | |
| 3814 | - text2 = globals.converter._dispatch("metadata.before", text2, options, globals); | |
| 3815 | - function parseMetadataContents(content) { | |
| 3816 | - globals.metadata.raw = content; | |
| 3817 | - content = content.replace(/&/g, "&").replace(/"/g, """); | |
| 3818 | - content = content.replace(/\n {4}/g, " "); | |
| 3819 | - content.replace(/^([\S ]+): +([\s\S]+?)$/gm, function(wm, key, value) { | |
| 3820 | - globals.metadata.parsed[key] = value; | |
| 3821 | - return ""; | |
| 3822 | - }); | |
| 3823 | - } | |
| 3824 | - text2 = text2.replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/, function(wholematch, format, content) { | |
| 3825 | - parseMetadataContents(content); | |
| 3826 | - return "\xA8M"; | |
| 3827 | - }); | |
| 3828 | - text2 = text2.replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/, function(wholematch, format, content) { | |
| 3829 | - if (format) { | |
| 3830 | - globals.metadata.format = format; | |
| 3831 | - } | |
| 3832 | - parseMetadataContents(content); | |
| 3833 | - return "\xA8M"; | |
| 3834 | - }); | |
| 3835 | - text2 = text2.replace(/¨M/g, ""); | |
| 3836 | - text2 = globals.converter._dispatch("metadata.after", text2, options, globals); | |
| 3837 | - return text2; | |
| 3838 | - }); | |
| 3839 | - showdown2.subParser("outdent", function(text2, options, globals) { | |
| 3840 | - "use strict"; | |
| 3841 | - text2 = globals.converter._dispatch("outdent.before", text2, options, globals); | |
| 3842 | - text2 = text2.replace(/^(\t|[ ]{1,4})/gm, "\xA80"); | |
| 3843 | - text2 = text2.replace(/¨0/g, ""); | |
| 3844 | - text2 = globals.converter._dispatch("outdent.after", text2, options, globals); | |
| 3845 | - return text2; | |
| 3846 | - }); | |
| 3847 | - showdown2.subParser("paragraphs", function(text2, options, globals) { | |
| 3848 | - "use strict"; | |
| 3849 | - text2 = globals.converter._dispatch("paragraphs.before", text2, options, globals); | |
| 3850 | - text2 = text2.replace(/^\n+/g, ""); | |
| 3851 | - text2 = text2.replace(/\n+$/g, ""); | |
| 3852 | - var grafs = text2.split(/\n{2,}/g), grafsOut = [], end = grafs.length; | |
| 3853 | - for (var i2 = 0; i2 < end; i2++) { | |
| 3854 | - var str = grafs[i2]; | |
| 3855 | - if (str.search(/¨(K|G)(\d+)\1/g) >= 0) { | |
| 3856 | - grafsOut.push(str); | |
| 3857 | - } else if (str.search(/\S/) >= 0) { | |
| 3858 | - str = showdown2.subParser("spanGamut")(str, options, globals); | |
| 3859 | - str = str.replace(/^([ \t]*)/g, "<p>"); | |
| 3860 | - str += "</p>"; | |
| 3861 | - grafsOut.push(str); | |
| 3862 | - } | |
| 3863 | - } | |
| 3864 | - end = grafsOut.length; | |
| 3865 | - for (i2 = 0; i2 < end; i2++) { | |
| 3866 | - var blockText = "", grafsOutIt = grafsOut[i2], codeFlag = false; | |
| 3867 | - while (/¨(K|G)(\d+)\1/.test(grafsOutIt)) { | |
| 3868 | - var delim = RegExp.$1, num = RegExp.$2; | |
| 3869 | - if (delim === "K") { | |
| 3870 | - blockText = globals.gHtmlBlocks[num]; | |
| 3871 | - } else { | |
| 3872 | - if (codeFlag) { | |
| 3873 | - blockText = showdown2.subParser("encodeCode")(globals.ghCodeBlocks[num].text, options, globals); | |
| 3874 | - } else { | |
| 3875 | - blockText = globals.ghCodeBlocks[num].codeblock; | |
| 3876 | - } | |
| 3877 | - } | |
| 3878 | - blockText = blockText.replace(/\$/g, "$$$$"); | |
| 3879 | - grafsOutIt = grafsOutIt.replace(/(\n\n)?¨(K|G)\d+\2(\n\n)?/, blockText); | |
| 3880 | - if (/^<pre\b[^>]*>\s*<code\b[^>]*>/.test(grafsOutIt)) { | |
| 3881 | - codeFlag = true; | |
| 3882 | - } | |
| 3883 | - } | |
| 3884 | - grafsOut[i2] = grafsOutIt; | |
| 3885 | - } | |
| 3886 | - text2 = grafsOut.join("\n"); | |
| 3887 | - text2 = text2.replace(/^\n+/g, ""); | |
| 3888 | - text2 = text2.replace(/\n+$/g, ""); | |
| 3889 | - return globals.converter._dispatch("paragraphs.after", text2, options, globals); | |
| 3890 | - }); | |
| 3891 | - showdown2.subParser("runExtension", function(ext, text2, options, globals) { | |
| 3892 | - "use strict"; | |
| 3893 | - if (ext.filter) { | |
| 3894 | - text2 = ext.filter(text2, globals.converter, options); | |
| 3895 | - } else if (ext.regex) { | |
| 3896 | - var re = ext.regex; | |
| 3897 | - if (!(re instanceof RegExp)) { | |
| 3898 | - re = new RegExp(re, "g"); | |
| 3899 | - } | |
| 3900 | - text2 = text2.replace(re, ext.replace); | |
| 3901 | - } | |
| 3902 | - return text2; | |
| 3903 | - }); | |
| 3904 | - showdown2.subParser("spanGamut", function(text2, options, globals) { | |
| 3905 | - "use strict"; | |
| 3906 | - text2 = globals.converter._dispatch("spanGamut.before", text2, options, globals); | |
| 3907 | - text2 = showdown2.subParser("codeSpans")(text2, options, globals); | |
| 3908 | - text2 = showdown2.subParser("escapeSpecialCharsWithinTagAttributes")(text2, options, globals); | |
| 3909 | - text2 = showdown2.subParser("encodeBackslashEscapes")(text2, options, globals); | |
| 3910 | - text2 = showdown2.subParser("images")(text2, options, globals); | |
| 3911 | - text2 = showdown2.subParser("anchors")(text2, options, globals); | |
| 3912 | - text2 = showdown2.subParser("autoLinks")(text2, options, globals); | |
| 3913 | - text2 = showdown2.subParser("simplifiedAutoLinks")(text2, options, globals); | |
| 3914 | - text2 = showdown2.subParser("emoji")(text2, options, globals); | |
| 3915 | - text2 = showdown2.subParser("underline")(text2, options, globals); | |
| 3916 | - text2 = showdown2.subParser("italicsAndBold")(text2, options, globals); | |
| 3917 | - text2 = showdown2.subParser("strikethrough")(text2, options, globals); | |
| 3918 | - text2 = showdown2.subParser("ellipsis")(text2, options, globals); | |
| 3919 | - text2 = showdown2.subParser("hashHTMLSpans")(text2, options, globals); | |
| 3920 | - text2 = showdown2.subParser("encodeAmpsAndAngles")(text2, options, globals); | |
| 3921 | - if (options.simpleLineBreaks) { | |
| 3922 | - if (!/\n\n¨K/.test(text2)) { | |
| 3923 | - text2 = text2.replace(/\n+/g, "<br />\n"); | |
| 3924 | - } | |
| 3925 | - } else { | |
| 3926 | - text2 = text2.replace(/ +\n/g, "<br />\n"); | |
| 3927 | - } | |
| 3928 | - text2 = globals.converter._dispatch("spanGamut.after", text2, options, globals); | |
| 3929 | - return text2; | |
| 3930 | - }); | |
| 3931 | - showdown2.subParser("strikethrough", function(text2, options, globals) { | |
| 3932 | - "use strict"; | |
| 3933 | - function parseInside(txt) { | |
| 3934 | - if (options.simplifiedAutoLink) { | |
| 3935 | - txt = showdown2.subParser("simplifiedAutoLinks")(txt, options, globals); | |
| 3936 | - } | |
| 3937 | - return "<del>" + txt + "</del>"; | |
| 3938 | - } | |
| 3939 | - if (options.strikethrough) { | |
| 3940 | - text2 = globals.converter._dispatch("strikethrough.before", text2, options, globals); | |
| 3941 | - text2 = text2.replace(/(?:~){2}([\s\S]+?)(?:~){2}/g, function(wm, txt) { | |
| 3942 | - return parseInside(txt); | |
| 3943 | - }); | |
| 3944 | - text2 = globals.converter._dispatch("strikethrough.after", text2, options, globals); | |
| 3945 | - } | |
| 3946 | - return text2; | |
| 3947 | - }); | |
| 3948 | - showdown2.subParser("stripLinkDefinitions", function(text2, options, globals) { | |
| 3949 | - "use strict"; | |
| 3950 | - var regex = /^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*<?([^>\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm, base64Regex = /^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm; | |
| 3951 | - text2 += "\xA80"; | |
| 3952 | - var replaceFunc = function(wholeMatch, linkId, url, width, height, blankLines, title) { | |
| 3953 | - linkId = linkId.toLowerCase(); | |
| 3954 | - if (url.match(/^data:.+?\/.+?;base64,/)) { | |
| 3955 | - globals.gUrls[linkId] = url.replace(/\s/g, ""); | |
| 3956 | - } else { | |
| 3957 | - globals.gUrls[linkId] = showdown2.subParser("encodeAmpsAndAngles")(url, options, globals); | |
| 3958 | - } | |
| 3959 | - if (blankLines) { | |
| 3960 | - return blankLines + title; | |
| 3961 | - } else { | |
| 3962 | - if (title) { | |
| 3963 | - globals.gTitles[linkId] = title.replace(/"|'/g, """); | |
| 3964 | - } | |
| 3965 | - if (options.parseImgDimensions && width && height) { | |
| 3966 | - globals.gDimensions[linkId] = { | |
| 3967 | - width, | |
| 3968 | - height | |
| 3969 | - }; | |
| 3970 | - } | |
| 3971 | - } | |
| 3972 | - return ""; | |
| 3973 | - }; | |
| 3974 | - text2 = text2.replace(base64Regex, replaceFunc); | |
| 3975 | - text2 = text2.replace(regex, replaceFunc); | |
| 3976 | - text2 = text2.replace(/¨0/, ""); | |
| 3977 | - return text2; | |
| 3978 | - }); | |
| 3979 | - showdown2.subParser("tables", function(text2, options, globals) { | |
| 3980 | - "use strict"; | |
| 3981 | - if (!options.tables) { | |
| 3982 | - return text2; | |
| 3983 | - } | |
| 3984 | - var tableRgx = /^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm, singeColTblRgx = /^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm; | |
| 3985 | - function parseStyles(sLine) { | |
| 3986 | - if (/^:[ \t]*--*$/.test(sLine)) { | |
| 3987 | - return ' style="text-align:left;"'; | |
| 3988 | - } else if (/^--*[ \t]*:[ \t]*$/.test(sLine)) { | |
| 3989 | - return ' style="text-align:right;"'; | |
| 3990 | - } else if (/^:[ \t]*--*[ \t]*:$/.test(sLine)) { | |
| 3991 | - return ' style="text-align:center;"'; | |
| 3992 | - } else { | |
| 3993 | - return ""; | |
| 3994 | - } | |
| 3995 | - } | |
| 3996 | - function parseHeaders(header, style) { | |
| 3997 | - var id = ""; | |
| 3998 | - header = header.trim(); | |
| 3999 | - if (options.tablesHeaderId || options.tableHeaderId) { | |
| 4000 | - id = ' id="' + header.replace(/ /g, "_").toLowerCase() + '"'; | |
| 4001 | - } | |
| 4002 | - header = showdown2.subParser("spanGamut")(header, options, globals); | |
| 4003 | - return "<th" + id + style + ">" + header + "</th>\n"; | |
| 4004 | - } | |
| 4005 | - function parseCells(cell, style) { | |
| 4006 | - var subText = showdown2.subParser("spanGamut")(cell, options, globals); | |
| 4007 | - return "<td" + style + ">" + subText + "</td>\n"; | |
| 4008 | - } | |
| 4009 | - function buildTable(headers, cells) { | |
| 4010 | - var tb = "<table>\n<thead>\n<tr>\n", tblLgn = headers.length; | |
| 4011 | - for (var i2 = 0; i2 < tblLgn; ++i2) { | |
| 4012 | - tb += headers[i2]; | |
| 4013 | - } | |
| 4014 | - tb += "</tr>\n</thead>\n<tbody>\n"; | |
| 4015 | - for (i2 = 0; i2 < cells.length; ++i2) { | |
| 4016 | - tb += "<tr>\n"; | |
| 4017 | - for (var ii = 0; ii < tblLgn; ++ii) { | |
| 4018 | - tb += cells[i2][ii]; | |
| 4019 | - } | |
| 4020 | - tb += "</tr>\n"; | |
| 4021 | - } | |
| 4022 | - tb += "</tbody>\n</table>\n"; | |
| 4023 | - return tb; | |
| 4024 | - } | |
| 4025 | - function parseTable(rawTable) { | |
| 4026 | - var i2, tableLines = rawTable.split("\n"); | |
| 4027 | - for (i2 = 0; i2 < tableLines.length; ++i2) { | |
| 4028 | - if (/^ {0,3}\|/.test(tableLines[i2])) { | |
| 4029 | - tableLines[i2] = tableLines[i2].replace(/^ {0,3}\|/, ""); | |
| 4030 | - } | |
| 4031 | - if (/\|[ \t]*$/.test(tableLines[i2])) { | |
| 4032 | - tableLines[i2] = tableLines[i2].replace(/\|[ \t]*$/, ""); | |
| 4033 | - } | |
| 4034 | - tableLines[i2] = showdown2.subParser("codeSpans")(tableLines[i2], options, globals); | |
| 4035 | - } | |
| 4036 | - var rawHeaders = tableLines[0].split("|").map(function(s2) { | |
| 4037 | - return s2.trim(); | |
| 4038 | - }), rawStyles = tableLines[1].split("|").map(function(s2) { | |
| 4039 | - return s2.trim(); | |
| 4040 | - }), rawCells = [], headers = [], styles = [], cells = []; | |
| 4041 | - tableLines.shift(); | |
| 4042 | - tableLines.shift(); | |
| 4043 | - for (i2 = 0; i2 < tableLines.length; ++i2) { | |
| 4044 | - if (tableLines[i2].trim() === "") { | |
| 4045 | - continue; | |
| 4046 | - } | |
| 4047 | - rawCells.push( | |
| 4048 | - tableLines[i2].split("|").map(function(s2) { | |
| 4049 | - return s2.trim(); | |
| 4050 | - }) | |
| 4051 | - ); | |
| 4052 | - } | |
| 4053 | - if (rawHeaders.length < rawStyles.length) { | |
| 4054 | - return rawTable; | |
| 4055 | - } | |
| 4056 | - for (i2 = 0; i2 < rawStyles.length; ++i2) { | |
| 4057 | - styles.push(parseStyles(rawStyles[i2])); | |
| 4058 | - } | |
| 4059 | - for (i2 = 0; i2 < rawHeaders.length; ++i2) { | |
| 4060 | - if (showdown2.helper.isUndefined(styles[i2])) { | |
| 4061 | - styles[i2] = ""; | |
| 4062 | - } | |
| 4063 | - headers.push(parseHeaders(rawHeaders[i2], styles[i2])); | |
| 4064 | - } | |
| 4065 | - for (i2 = 0; i2 < rawCells.length; ++i2) { | |
| 4066 | - var row = []; | |
| 4067 | - for (var ii = 0; ii < headers.length; ++ii) { | |
| 4068 | - if (showdown2.helper.isUndefined(rawCells[i2][ii])) { | |
| 4069 | - } | |
| 4070 | - row.push(parseCells(rawCells[i2][ii], styles[ii])); | |
| 4071 | - } | |
| 4072 | - cells.push(row); | |
| 4073 | - } | |
| 4074 | - return buildTable(headers, cells); | |
| 4075 | - } | |
| 4076 | - text2 = globals.converter._dispatch("tables.before", text2, options, globals); | |
| 4077 | - text2 = text2.replace(/\\(\|)/g, showdown2.helper.escapeCharactersCallback); | |
| 4078 | - text2 = text2.replace(tableRgx, parseTable); | |
| 4079 | - text2 = text2.replace(singeColTblRgx, parseTable); | |
| 4080 | - text2 = globals.converter._dispatch("tables.after", text2, options, globals); | |
| 4081 | - return text2; | |
| 4082 | - }); | |
| 4083 | - showdown2.subParser("underline", function(text2, options, globals) { | |
| 4084 | - "use strict"; | |
| 4085 | - if (!options.underline) { | |
| 4086 | - return text2; | |
| 4087 | - } | |
| 4088 | - text2 = globals.converter._dispatch("underline.before", text2, options, globals); | |
| 4089 | - if (options.literalMidWordUnderscores) { | |
| 4090 | - text2 = text2.replace(/\b___(\S[\s\S]*?)___\b/g, function(wm, txt) { | |
| 4091 | - return "<u>" + txt + "</u>"; | |
| 4092 | - }); | |
| 4093 | - text2 = text2.replace(/\b__(\S[\s\S]*?)__\b/g, function(wm, txt) { | |
| 4094 | - return "<u>" + txt + "</u>"; | |
| 4095 | - }); | |
| 4096 | - } else { | |
| 4097 | - text2 = text2.replace(/___(\S[\s\S]*?)___/g, function(wm, m2) { | |
| 4098 | - return /\S$/.test(m2) ? "<u>" + m2 + "</u>" : wm; | |
| 4099 | - }); | |
| 4100 | - text2 = text2.replace(/__(\S[\s\S]*?)__/g, function(wm, m2) { | |
| 4101 | - return /\S$/.test(m2) ? "<u>" + m2 + "</u>" : wm; | |
| 4102 | - }); | |
| 4103 | - } | |
| 4104 | - text2 = text2.replace(/(_)/g, showdown2.helper.escapeCharactersCallback); | |
| 4105 | - text2 = globals.converter._dispatch("underline.after", text2, options, globals); | |
| 4106 | - return text2; | |
| 4107 | - }); | |
| 4108 | - showdown2.subParser("unescapeSpecialChars", function(text2, options, globals) { | |
| 4109 | - "use strict"; | |
| 4110 | - text2 = globals.converter._dispatch("unescapeSpecialChars.before", text2, options, globals); | |
| 4111 | - text2 = text2.replace(/¨E(\d+)E/g, function(wholeMatch, m1) { | |
| 4112 | - var charCodeToReplace = parseInt(m1); | |
| 4113 | - return String.fromCharCode(charCodeToReplace); | |
| 4114 | - }); | |
| 4115 | - text2 = globals.converter._dispatch("unescapeSpecialChars.after", text2, options, globals); | |
| 4116 | - return text2; | |
| 4117 | - }); | |
| 4118 | - showdown2.subParser("makeMarkdown.blockquote", function(node, globals) { | |
| 4119 | - "use strict"; | |
| 4120 | - var txt = ""; | |
| 4121 | - if (node.hasChildNodes()) { | |
| 4122 | - var children = node.childNodes, childrenLength = children.length; | |
| 4123 | - for (var i2 = 0; i2 < childrenLength; ++i2) { | |
| 4124 | - var innerTxt = showdown2.subParser("makeMarkdown.node")(children[i2], globals); | |
| 4125 | - if (innerTxt === "") { | |
| 4126 | - continue; | |
| 4127 | - } | |
| 4128 | - txt += innerTxt; | |
| 4129 | - } | |
| 4130 | - } | |
| 4131 | - txt = txt.trim(); | |
| 4132 | - txt = "> " + txt.split("\n").join("\n> "); | |
| 4133 | - return txt; | |
| 4134 | - }); | |
| 4135 | - showdown2.subParser("makeMarkdown.codeBlock", function(node, globals) { | |
| 4136 | - "use strict"; | |
| 4137 | - var lang = node.getAttribute("language"), num = node.getAttribute("precodenum"); | |
| 4138 | - return "```" + lang + "\n" + globals.preList[num] + "\n```"; | |
| 4139 | - }); | |
| 4140 | - showdown2.subParser("makeMarkdown.codeSpan", function(node) { | |
| 4141 | - "use strict"; | |
| 4142 | - return "`" + node.innerHTML + "`"; | |
| 4143 | - }); | |
| 4144 | - showdown2.subParser("makeMarkdown.emphasis", function(node, globals) { | |
| 4145 | - "use strict"; | |
| 4146 | - var txt = ""; | |
| 4147 | - if (node.hasChildNodes()) { | |
| 4148 | - txt += "*"; | |
| 4149 | - var children = node.childNodes, childrenLength = children.length; | |
| 4150 | - for (var i2 = 0; i2 < childrenLength; ++i2) { | |
| 4151 | - txt += showdown2.subParser("makeMarkdown.node")(children[i2], globals); | |
| 4152 | - } | |
| 4153 | - txt += "*"; | |
| 4154 | - } | |
| 4155 | - return txt; | |
| 4156 | - }); | |
| 4157 | - showdown2.subParser("makeMarkdown.header", function(node, globals, headerLevel) { | |
| 4158 | - "use strict"; | |
| 4159 | - var headerMark = new Array(headerLevel + 1).join("#"), txt = ""; | |
| 4160 | - if (node.hasChildNodes()) { | |
| 4161 | - txt = headerMark + " "; | |
| 4162 | - var children = node.childNodes, childrenLength = children.length; | |
| 4163 | - for (var i2 = 0; i2 < childrenLength; ++i2) { | |
| 4164 | - txt += showdown2.subParser("makeMarkdown.node")(children[i2], globals); | |
| 4165 | - } | |
| 4166 | - } | |
| 4167 | - return txt; | |
| 4168 | - }); | |
| 4169 | - showdown2.subParser("makeMarkdown.hr", function() { | |
| 4170 | - "use strict"; | |
| 4171 | - return "---"; | |
| 4172 | - }); | |
| 4173 | - showdown2.subParser("makeMarkdown.image", function(node) { | |
| 4174 | - "use strict"; | |
| 4175 | - var txt = ""; | |
| 4176 | - if (node.hasAttribute("src")) { | |
| 4177 | - txt += " + ">"; | |
| 4179 | - if (node.hasAttribute("width") && node.hasAttribute("height")) { | |
| 4180 | - txt += " =" + node.getAttribute("width") + "x" + node.getAttribute("height"); | |
| 4181 | - } | |
| 4182 | - if (node.hasAttribute("title")) { | |
| 4183 | - txt += ' "' + node.getAttribute("title") + '"'; | |
| 4184 | - } | |
| 4185 | - txt += ")"; | |
| 4186 | - } | |
| 4187 | - return txt; | |
| 4188 | - }); | |
| 4189 | - showdown2.subParser("makeMarkdown.links", function(node, globals) { | |
| 4190 | - "use strict"; | |
| 4191 | - var txt = ""; | |
| 4192 | - if (node.hasChildNodes() && node.hasAttribute("href")) { | |
| 4193 | - var children = node.childNodes, childrenLength = children.length; | |
| 4194 | - txt = "["; | |
| 4195 | - for (var i2 = 0; i2 < childrenLength; ++i2) { | |
| 4196 | - txt += showdown2.subParser("makeMarkdown.node")(children[i2], globals); | |
| 4197 | - } | |
| 4198 | - txt += "]("; | |
| 4199 | - txt += "<" + node.getAttribute("href") + ">"; | |
| 4200 | - if (node.hasAttribute("title")) { | |
| 4201 | - txt += ' "' + node.getAttribute("title") + '"'; | |
| 4202 | - } | |
| 4203 | - txt += ")"; | |
| 4204 | - } | |
| 4205 | - return txt; | |
| 4206 | - }); | |
| 4207 | - showdown2.subParser("makeMarkdown.list", function(node, globals, type) { | |
| 4208 | - "use strict"; | |
| 4209 | - var txt = ""; | |
| 4210 | - if (!node.hasChildNodes()) { | |
| 4211 | - return ""; | |
| 4212 | - } | |
| 4213 | - var listItems = node.childNodes, listItemsLenght = listItems.length, listNum = node.getAttribute("start") || 1; | |
| 4214 | - for (var i2 = 0; i2 < listItemsLenght; ++i2) { | |
| 4215 | - if (typeof listItems[i2].tagName === "undefined" || listItems[i2].tagName.toLowerCase() !== "li") { | |
| 4216 | - continue; | |
| 4217 | - } | |
| 4218 | - var bullet = ""; | |
| 4219 | - if (type === "ol") { | |
| 4220 | - bullet = listNum.toString() + ". "; | |
| 4221 | - } else { | |
| 4222 | - bullet = "- "; | |
| 4223 | - } | |
| 4224 | - txt += bullet + showdown2.subParser("makeMarkdown.listItem")(listItems[i2], globals); | |
| 4225 | - ++listNum; | |
| 4226 | - } | |
| 4227 | - txt += "\n<!-- -->\n"; | |
| 4228 | - return txt.trim(); | |
| 4229 | - }); | |
| 4230 | - showdown2.subParser("makeMarkdown.listItem", function(node, globals) { | |
| 4231 | - "use strict"; | |
| 4232 | - var listItemTxt = ""; | |
| 4233 | - var children = node.childNodes, childrenLenght = children.length; | |
| 4234 | - for (var i2 = 0; i2 < childrenLenght; ++i2) { | |
| 4235 | - listItemTxt += showdown2.subParser("makeMarkdown.node")(children[i2], globals); | |
| 4236 | - } | |
| 4237 | - if (!/\n$/.test(listItemTxt)) { | |
| 4238 | - listItemTxt += "\n"; | |
| 4239 | - } else { | |
| 4240 | - listItemTxt = listItemTxt.split("\n").join("\n ").replace(/^ {4}$/gm, "").replace(/\n\n+/g, "\n\n"); | |
| 4241 | - } | |
| 4242 | - return listItemTxt; | |
| 4243 | - }); | |
| 4244 | - showdown2.subParser("makeMarkdown.node", function(node, globals, spansOnly) { | |
| 4245 | - "use strict"; | |
| 4246 | - spansOnly = spansOnly || false; | |
| 4247 | - var txt = ""; | |
| 4248 | - if (node.nodeType === 3) { | |
| 4249 | - return showdown2.subParser("makeMarkdown.txt")(node, globals); | |
| 4250 | - } | |
| 4251 | - if (node.nodeType === 8) { | |
| 4252 | - return "<!--" + node.data + "-->\n\n"; | |
| 4253 | - } | |
| 4254 | - if (node.nodeType !== 1) { | |
| 4255 | - return ""; | |
| 4256 | - } | |
| 4257 | - var tagName = node.tagName.toLowerCase(); | |
| 4258 | - switch (tagName) { | |
| 4259 | - // | |
| 4260 | - // BLOCKS | |
| 4261 | - // | |
| 4262 | - case "h1": | |
| 4263 | - if (!spansOnly) { | |
| 4264 | - txt = showdown2.subParser("makeMarkdown.header")(node, globals, 1) + "\n\n"; | |
| 4265 | - } | |
| 4266 | - break; | |
| 4267 | - case "h2": | |
| 4268 | - if (!spansOnly) { | |
| 4269 | - txt = showdown2.subParser("makeMarkdown.header")(node, globals, 2) + "\n\n"; | |
| 4270 | - } | |
| 4271 | - break; | |
| 4272 | - case "h3": | |
| 4273 | - if (!spansOnly) { | |
| 4274 | - txt = showdown2.subParser("makeMarkdown.header")(node, globals, 3) + "\n\n"; | |
| 4275 | - } | |
| 4276 | - break; | |
| 4277 | - case "h4": | |
| 4278 | - if (!spansOnly) { | |
| 4279 | - txt = showdown2.subParser("makeMarkdown.header")(node, globals, 4) + "\n\n"; | |
| 4280 | - } | |
| 4281 | - break; | |
| 4282 | - case "h5": | |
| 4283 | - if (!spansOnly) { | |
| 4284 | - txt = showdown2.subParser("makeMarkdown.header")(node, globals, 5) + "\n\n"; | |
| 4285 | - } | |
| 4286 | - break; | |
| 4287 | - case "h6": | |
| 4288 | - if (!spansOnly) { | |
| 4289 | - txt = showdown2.subParser("makeMarkdown.header")(node, globals, 6) + "\n\n"; | |
| 4290 | - } | |
| 4291 | - break; | |
| 4292 | - case "p": | |
| 4293 | - if (!spansOnly) { | |
| 4294 | - txt = showdown2.subParser("makeMarkdown.paragraph")(node, globals) + "\n\n"; | |
| 4295 | - } | |
| 4296 | - break; | |
| 4297 | - case "blockquote": | |
| 4298 | - if (!spansOnly) { | |
| 4299 | - txt = showdown2.subParser("makeMarkdown.blockquote")(node, globals) + "\n\n"; | |
| 4300 | - } | |
| 4301 | - break; | |
| 4302 | - case "hr": | |
| 4303 | - if (!spansOnly) { | |
| 4304 | - txt = showdown2.subParser("makeMarkdown.hr")(node, globals) + "\n\n"; | |
| 4305 | - } | |
| 4306 | - break; | |
| 4307 | - case "ol": | |
| 4308 | - if (!spansOnly) { | |
| 4309 | - txt = showdown2.subParser("makeMarkdown.list")(node, globals, "ol") + "\n\n"; | |
| 4310 | - } | |
| 4311 | - break; | |
| 4312 | - case "ul": | |
| 4313 | - if (!spansOnly) { | |
| 4314 | - txt = showdown2.subParser("makeMarkdown.list")(node, globals, "ul") + "\n\n"; | |
| 4315 | - } | |
| 4316 | - break; | |
| 4317 | - case "precode": | |
| 4318 | - if (!spansOnly) { | |
| 4319 | - txt = showdown2.subParser("makeMarkdown.codeBlock")(node, globals) + "\n\n"; | |
| 4320 | - } | |
| 4321 | - break; | |
| 4322 | - case "pre": | |
| 4323 | - if (!spansOnly) { | |
| 4324 | - txt = showdown2.subParser("makeMarkdown.pre")(node, globals) + "\n\n"; | |
| 4325 | - } | |
| 4326 | - break; | |
| 4327 | - case "table": | |
| 4328 | - if (!spansOnly) { | |
| 4329 | - txt = showdown2.subParser("makeMarkdown.table")(node, globals) + "\n\n"; | |
| 4330 | - } | |
| 4331 | - break; | |
| 4332 | - // | |
| 4333 | - // SPANS | |
| 4334 | - // | |
| 4335 | - case "code": | |
| 4336 | - txt = showdown2.subParser("makeMarkdown.codeSpan")(node, globals); | |
| 4337 | - break; | |
| 4338 | - case "em": | |
| 4339 | - case "i": | |
| 4340 | - txt = showdown2.subParser("makeMarkdown.emphasis")(node, globals); | |
| 4341 | - break; | |
| 4342 | - case "strong": | |
| 4343 | - case "b": | |
| 4344 | - txt = showdown2.subParser("makeMarkdown.strong")(node, globals); | |
| 4345 | - break; | |
| 4346 | - case "del": | |
| 4347 | - txt = showdown2.subParser("makeMarkdown.strikethrough")(node, globals); | |
| 4348 | - break; | |
| 4349 | - case "a": | |
| 4350 | - txt = showdown2.subParser("makeMarkdown.links")(node, globals); | |
| 4351 | - break; | |
| 4352 | - case "img": | |
| 4353 | - txt = showdown2.subParser("makeMarkdown.image")(node, globals); | |
| 4354 | - break; | |
| 4355 | - default: | |
| 4356 | - txt = node.outerHTML + "\n\n"; | |
| 4357 | - } | |
| 4358 | - return txt; | |
| 4359 | - }); | |
| 4360 | - showdown2.subParser("makeMarkdown.paragraph", function(node, globals) { | |
| 4361 | - "use strict"; | |
| 4362 | - var txt = ""; | |
| 4363 | - if (node.hasChildNodes()) { | |
| 4364 | - var children = node.childNodes, childrenLength = children.length; | |
| 4365 | - for (var i2 = 0; i2 < childrenLength; ++i2) { | |
| 4366 | - txt += showdown2.subParser("makeMarkdown.node")(children[i2], globals); | |
| 4367 | - } | |
| 4368 | - } | |
| 4369 | - txt = txt.trim(); | |
| 4370 | - return txt; | |
| 4371 | - }); | |
| 4372 | - showdown2.subParser("makeMarkdown.pre", function(node, globals) { | |
| 4373 | - "use strict"; | |
| 4374 | - var num = node.getAttribute("prenum"); | |
| 4375 | - return "<pre>" + globals.preList[num] + "</pre>"; | |
| 4376 | - }); | |
| 4377 | - showdown2.subParser("makeMarkdown.strikethrough", function(node, globals) { | |
| 4378 | - "use strict"; | |
| 4379 | - var txt = ""; | |
| 4380 | - if (node.hasChildNodes()) { | |
| 4381 | - txt += "~~"; | |
| 4382 | - var children = node.childNodes, childrenLength = children.length; | |
| 4383 | - for (var i2 = 0; i2 < childrenLength; ++i2) { | |
| 4384 | - txt += showdown2.subParser("makeMarkdown.node")(children[i2], globals); | |
| 4385 | - } | |
| 4386 | - txt += "~~"; | |
| 4387 | - } | |
| 4388 | - return txt; | |
| 4389 | - }); | |
| 4390 | - showdown2.subParser("makeMarkdown.strong", function(node, globals) { | |
| 4391 | - "use strict"; | |
| 4392 | - var txt = ""; | |
| 4393 | - if (node.hasChildNodes()) { | |
| 4394 | - txt += "**"; | |
| 4395 | - var children = node.childNodes, childrenLength = children.length; | |
| 4396 | - for (var i2 = 0; i2 < childrenLength; ++i2) { | |
| 4397 | - txt += showdown2.subParser("makeMarkdown.node")(children[i2], globals); | |
| 4398 | - } | |
| 4399 | - txt += "**"; | |
| 4400 | - } | |
| 4401 | - return txt; | |
| 4402 | - }); | |
| 4403 | - showdown2.subParser("makeMarkdown.table", function(node, globals) { | |
| 4404 | - "use strict"; | |
| 4405 | - var txt = "", tableArray = [[], []], headings = node.querySelectorAll("thead>tr>th"), rows = node.querySelectorAll("tbody>tr"), i2, ii; | |
| 4406 | - for (i2 = 0; i2 < headings.length; ++i2) { | |
| 4407 | - var headContent = showdown2.subParser("makeMarkdown.tableCell")(headings[i2], globals), allign = "---"; | |
| 4408 | - if (headings[i2].hasAttribute("style")) { | |
| 4409 | - var style = headings[i2].getAttribute("style").toLowerCase().replace(/\s/g, ""); | |
| 4410 | - switch (style) { | |
| 4411 | - case "text-align:left;": | |
| 4412 | - allign = ":---"; | |
| 4413 | - break; | |
| 4414 | - case "text-align:right;": | |
| 4415 | - allign = "---:"; | |
| 4416 | - break; | |
| 4417 | - case "text-align:center;": | |
| 4418 | - allign = ":---:"; | |
| 4419 | - break; | |
| 4420 | - } | |
| 4421 | - } | |
| 4422 | - tableArray[0][i2] = headContent.trim(); | |
| 4423 | - tableArray[1][i2] = allign; | |
| 4424 | - } | |
| 4425 | - for (i2 = 0; i2 < rows.length; ++i2) { | |
| 4426 | - var r2 = tableArray.push([]) - 1, cols = rows[i2].getElementsByTagName("td"); | |
| 4427 | - for (ii = 0; ii < headings.length; ++ii) { | |
| 4428 | - var cellContent = " "; | |
| 4429 | - if (typeof cols[ii] !== "undefined") { | |
| 4430 | - cellContent = showdown2.subParser("makeMarkdown.tableCell")(cols[ii], globals); | |
| 4431 | - } | |
| 4432 | - tableArray[r2].push(cellContent); | |
| 4433 | - } | |
| 4434 | - } | |
| 4435 | - var cellSpacesCount = 3; | |
| 4436 | - for (i2 = 0; i2 < tableArray.length; ++i2) { | |
| 4437 | - for (ii = 0; ii < tableArray[i2].length; ++ii) { | |
| 4438 | - var strLen = tableArray[i2][ii].length; | |
| 4439 | - if (strLen > cellSpacesCount) { | |
| 4440 | - cellSpacesCount = strLen; | |
| 4441 | - } | |
| 4442 | - } | |
| 4443 | - } | |
| 4444 | - for (i2 = 0; i2 < tableArray.length; ++i2) { | |
| 4445 | - for (ii = 0; ii < tableArray[i2].length; ++ii) { | |
| 4446 | - if (i2 === 1) { | |
| 4447 | - if (tableArray[i2][ii].slice(-1) === ":") { | |
| 4448 | - tableArray[i2][ii] = showdown2.helper.padEnd(tableArray[i2][ii].slice(-1), cellSpacesCount - 1, "-") + ":"; | |
| 4449 | - } else { | |
| 4450 | - tableArray[i2][ii] = showdown2.helper.padEnd(tableArray[i2][ii], cellSpacesCount, "-"); | |
| 4451 | - } | |
| 4452 | - } else { | |
| 4453 | - tableArray[i2][ii] = showdown2.helper.padEnd(tableArray[i2][ii], cellSpacesCount); | |
| 4454 | - } | |
| 4455 | - } | |
| 4456 | - txt += "| " + tableArray[i2].join(" | ") + " |\n"; | |
| 4457 | - } | |
| 4458 | - return txt.trim(); | |
| 4459 | - }); | |
| 4460 | - showdown2.subParser("makeMarkdown.tableCell", function(node, globals) { | |
| 4461 | - "use strict"; | |
| 4462 | - var txt = ""; | |
| 4463 | - if (!node.hasChildNodes()) { | |
| 4464 | - return ""; | |
| 4465 | - } | |
| 4466 | - var children = node.childNodes, childrenLength = children.length; | |
| 4467 | - for (var i2 = 0; i2 < childrenLength; ++i2) { | |
| 4468 | - txt += showdown2.subParser("makeMarkdown.node")(children[i2], globals, true); | |
| 4469 | - } | |
| 4470 | - return txt.trim(); | |
| 4471 | - }); | |
| 4472 | - showdown2.subParser("makeMarkdown.txt", function(node) { | |
| 4473 | - "use strict"; | |
| 4474 | - var txt = node.nodeValue; | |
| 4475 | - txt = txt.replace(/ +/g, " "); | |
| 4476 | - txt = txt.replace(/¨NBSP;/g, " "); | |
| 4477 | - txt = showdown2.helper.unescapeHTMLEntities(txt); | |
| 4478 | - txt = txt.replace(/([*_~|`])/g, "\\$1"); | |
| 4479 | - txt = txt.replace(/^(\s*)>/g, "\\$1>"); | |
| 4480 | - txt = txt.replace(/^#/gm, "\\#"); | |
| 4481 | - txt = txt.replace(/^(\s*)([-=]{3,})(\s*)$/, "$1\\$2$3"); | |
| 4482 | - txt = txt.replace(/^( {0,3}\d+)\./gm, "$1\\."); | |
| 4483 | - txt = txt.replace(/^( {0,3})([+-])/gm, "$1\\$2"); | |
| 4484 | - txt = txt.replace(/]([\s]*)\(/g, "\\]$1\\("); | |
| 4485 | - txt = txt.replace(/^ {0,3}\[([\S \t]*?)]:/gm, "\\[$1]:"); | |
| 4486 | - return txt; | |
| 4487 | - }); | |
| 4488 | - var root = this; | |
| 4489 | - if (typeof define === "function" && define.amd) { | |
| 4490 | - define(function() { | |
| 4491 | - "use strict"; | |
| 4492 | - return showdown2; | |
| 4493 | - }); | |
| 4494 | - } else if (typeof module !== "undefined" && module.exports) { | |
| 4495 | - module.exports = showdown2; | |
| 4496 | - } else { | |
| 4497 | - root.showdown = showdown2; | |
| 4498 | - } | |
| 4499 | - }).call(exports); | |
| 4500 | - } | |
| 4501 | - }); | |
| 4502 | - | |
| 4503 | 880 | // packages/blocks/build-module/index.mjs |
| 4504 | 881 | var index_exports = {}; |
| 4505 | 882 | __export(index_exports, { |
| 4506 | 883 | __EXPERIMENTAL_ELEMENTS: () => __EXPERIMENTAL_ELEMENTS, |
| @@ -4515,8 +892,9 @@ | ||
| 4515 | 892 | __unstableGetInnerBlocksProps: () => getInnerBlocksProps, |
| 4516 | 893 | __unstableSerializeAndClean: () => __unstableSerializeAndClean, |
| 4517 | 894 | children: () => children_default, |
| 4518 | 895 | cloneBlock: () => cloneBlock, |
| 896 | + cloneSanitizedBlock: () => cloneSanitizedBlock, | |
| 4519 | 897 | createBlock: () => createBlock, |
| 4520 | 898 | createBlocksFromInnerBlocksTemplate: () => createBlocksFromInnerBlocksTemplate, |
| 4521 | 899 | doBlocksMatchTemplate: () => doBlocksMatchTemplate, |
| 4522 | 900 | findTransform: () => findTransform, |
| @@ -4563,8 +941,9 @@ | ||
| 4563 | 941 | registerBlockCollection: () => registerBlockCollection, |
| 4564 | 942 | registerBlockStyle: () => registerBlockStyle, |
| 4565 | 943 | registerBlockType: () => registerBlockType, |
| 4566 | 944 | registerBlockVariation: () => registerBlockVariation, |
| 945 | + sanitizeBlockAttributes: () => sanitizeBlockAttributes, | |
| 4567 | 946 | serialize: () => serialize, |
| 4568 | 947 | serializeRawBlock: () => serializeRawBlock, |
| 4569 | 948 | setCategories: () => setCategories2, |
| 4570 | 949 | setDefaultBlockName: () => setDefaultBlockName, |
| @@ -4588,14 +967,14 @@ | ||
| 4588 | 967 | var import_data5 = __toESM(require_data(), 1); |
| 4589 | 968 | |
| 4590 | 969 | // node_modules/tslib/tslib.es6.mjs |
| 4591 | 970 | var __assign = function() { |
| 4592 | - __assign = Object.assign || function __assign2(t3) { | |
| 4593 | - for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) { | |
| 4594 | - s2 = arguments[i2]; | |
| 4595 | - for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2)) t3[p2] = s2[p2]; | |
| 971 | + __assign = Object.assign || function __assign2(t2) { | |
| 972 | + for (var s, i = 1, n = arguments.length; i < n; i++) { | |
| 973 | + s = arguments[i]; | |
| 974 | + for (var p2 in s) if (Object.prototype.hasOwnProperty.call(s, p2)) t2[p2] = s[p2]; | |
| 4596 | 975 | } |
| 4597 | - return t3; | |
| 976 | + return t2; | |
| 4598 | 977 | }; |
| 4599 | 978 | return __assign.apply(this, arguments); |
| 4600 | 979 | }; |
| 4601 | 980 | |
| @@ -4662,217 +1041,230 @@ | ||
| 4662 | 1041 | var import_data2 = __toESM(require_data(), 1); |
| 4663 | 1042 | var import_i18n3 = __toESM(require_i18n(), 1); |
| 4664 | 1043 | |
| 4665 | 1044 | // node_modules/colord/index.mjs |
| 4666 | - var r = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }; | |
| 4667 | - var t = function(r2) { | |
| 4668 | - return "string" == typeof r2 ? r2.length > 0 : "number" == typeof r2; | |
| 1045 | + for (r2 = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, t2 = function(r3) { | |
| 1046 | + return "string" == typeof r3 ? r3.length > 0 : "number" == typeof r3; | |
| 1047 | + }, n = function(r3, t3, n2) { | |
| 1048 | + return void 0 === t3 && (t3 = 0), void 0 === n2 && (n2 = Math.pow(10, t3)), Math.round(n2 * r3) / n2 + 0; | |
| 1049 | + }, u = function(r3, t3, n2) { | |
| 1050 | + return void 0 === t3 && (t3 = 0), void 0 === n2 && (n2 = 1), r3 > n2 ? n2 : r3 > t3 ? r3 : t3; | |
| 1051 | + }, e2 = function(r3) { | |
| 1052 | + return (r3 = isFinite(r3) ? r3 % 360 : 0) < 0 ? r3 + 360 : r3; | |
| 1053 | + }, o2 = function(r3, t3) { | |
| 1054 | + return void 0 === t3 && (t3 = 0), n(r3, t3) % 360; | |
| 1055 | + }, a = function(r3) { | |
| 1056 | + return { r: u(r3.r, 0, 255), g: u(r3.g, 0, 255), b: u(r3.b, 0, 255), a: u(r3.a) }; | |
| 1057 | + }, i = function(r3) { | |
| 1058 | + return { r: n(r3.r), g: n(r3.g), b: n(r3.b), a: n(r3.a, 3) }; | |
| 1059 | + }, s = /^#([0-9a-f]{3,8})$/i, d2 = function(r3, t3) { | |
| 1060 | + var n2 = r3.charCodeAt(t3); | |
| 1061 | + return (15 & n2) + 9 * (n2 >> 6); | |
| 1062 | + }, h = function(r3, t3) { | |
| 1063 | + return d2(r3, t3) << 4 | d2(r3, t3 + 1); | |
| 1064 | + }, b2 = [], f2 = 0; f2 < 256; f2++) b2.push((f2 < 16 ? "0" : "") + f2.toString(16)); | |
| 1065 | + var r2; | |
| 1066 | + var t2; | |
| 1067 | + var n; | |
| 1068 | + var u; | |
| 1069 | + var e2; | |
| 1070 | + var o2; | |
| 1071 | + var a; | |
| 1072 | + var i; | |
| 1073 | + var s; | |
| 1074 | + var d2; | |
| 1075 | + var h; | |
| 1076 | + var b2; | |
| 1077 | + var f2; | |
| 1078 | + var g = function(r2) { | |
| 1079 | + return b2[u(r2, 0, 255)]; | |
| 4669 | 1080 | }; |
| 4670 | - var n = function(r2, t3, n2) { | |
| 4671 | - return void 0 === t3 && (t3 = 0), void 0 === n2 && (n2 = Math.pow(10, t3)), Math.round(n2 * r2) / n2 + 0; | |
| 1081 | + var c = function(r2) { | |
| 1082 | + var t2 = r2.r, n = r2.g, u = r2.b, e2 = r2.a, o2 = Math.max(t2, n, u), a = o2 - Math.min(t2, n, u), i = a ? o2 === t2 ? (n - u) / a : o2 === n ? 2 + (u - t2) / a : 4 + (t2 - n) / a : 0; | |
| 1083 | + return { h: 60 * (i < 0 ? i + 6 : i), s: o2 ? a / o2 * 100 : 0, v: o2 / 255 * 100, a: e2 }; | |
| 4672 | 1084 | }; |
| 4673 | - var e = function(r2, t3, n2) { | |
| 4674 | - return void 0 === t3 && (t3 = 0), void 0 === n2 && (n2 = 1), r2 > n2 ? n2 : r2 > t3 ? r2 : t3; | |
| 1085 | + var v = function(r2) { | |
| 1086 | + var t2 = r2.h, n = r2.s, u = r2.v, e2 = r2.a; | |
| 1087 | + t2 = t2 / 360 * 6, n /= 100, u /= 100; | |
| 1088 | + var o2 = Math.floor(t2), a = u * (1 - n), i = u * (1 - (t2 - o2) * n), s = u * (1 - (1 - t2 + o2) * n), d2 = o2 % 6; | |
| 1089 | + return { r: 255 * [u, i, a, a, s, u][d2], g: 255 * [s, u, u, i, a, a][d2], b: 255 * [a, a, s, u, u, i][d2], a: e2 }; | |
| 4675 | 1090 | }; |
| 4676 | - var u = function(r2) { | |
| 4677 | - return (r2 = isFinite(r2) ? r2 % 360 : 0) > 0 ? r2 : r2 + 360; | |
| 1091 | + var l = function(r2) { | |
| 1092 | + return { h: e2(r2.h), s: u(r2.s, 0, 100), l: u(r2.l, 0, 100), a: u(r2.a) }; | |
| 4678 | 1093 | }; |
| 4679 | - var a = function(r2) { | |
| 4680 | - return { r: e(r2.r, 0, 255), g: e(r2.g, 0, 255), b: e(r2.b, 0, 255), a: e(r2.a) }; | |
| 1094 | + var p = function(r2) { | |
| 1095 | + return { h: o2(r2.h), s: n(r2.s), l: n(r2.l), a: n(r2.a, 3) }; | |
| 4681 | 1096 | }; |
| 4682 | - var o = function(r2) { | |
| 4683 | - return { r: n(r2.r), g: n(r2.g), b: n(r2.b), a: n(r2.a, 3) }; | |
| 1097 | + var m = function(r2) { | |
| 1098 | + return v((n = (t2 = r2).s, { h: t2.h, s: (n *= ((u = t2.l) < 50 ? u : 100 - u) / 100) > 0 ? 2 * n / (u + n) * 100 : 0, v: u + n, a: t2.a })); | |
| 1099 | + var t2, n, u; | |
| 4684 | 1100 | }; |
| 4685 | - var i = /^#([0-9a-f]{3,8})$/i; | |
| 4686 | - var s = function(r2) { | |
| 4687 | - var t3 = r2.toString(16); | |
| 4688 | - return t3.length < 2 ? "0" + t3 : t3; | |
| 1101 | + var y = function(r2) { | |
| 1102 | + return { h: (t2 = c(r2)).h, s: (e2 = (200 - (n = t2.s)) * (u = t2.v) / 100) > 0 && e2 < 200 ? n * u / 100 / (e2 <= 100 ? e2 : 200 - e2) * 100 : 0, l: e2 / 2, a: t2.a }; | |
| 1103 | + var t2, n, u, e2; | |
| 4689 | 1104 | }; |
| 4690 | - var h = function(r2) { | |
| 4691 | - var t3 = r2.r, n2 = r2.g, e2 = r2.b, u2 = r2.a, a2 = Math.max(t3, n2, e2), o3 = a2 - Math.min(t3, n2, e2), i2 = o3 ? a2 === t3 ? (n2 - e2) / o3 : a2 === n2 ? 2 + (e2 - t3) / o3 : 4 + (t3 - n2) / o3 : 0; | |
| 4692 | - return { h: 60 * (i2 < 0 ? i2 + 6 : i2), s: a2 ? o3 / a2 * 100 : 0, v: a2 / 255 * 100, a: u2 }; | |
| 4693 | - }; | |
| 4694 | - var b = function(r2) { | |
| 4695 | - var t3 = r2.h, n2 = r2.s, e2 = r2.v, u2 = r2.a; | |
| 4696 | - t3 = t3 / 360 * 6, n2 /= 100, e2 /= 100; | |
| 4697 | - var a2 = Math.floor(t3), o3 = e2 * (1 - n2), i2 = e2 * (1 - (t3 - a2) * n2), s2 = e2 * (1 - (1 - t3 + a2) * n2), h2 = a2 % 6; | |
| 4698 | - return { r: 255 * [e2, i2, o3, o3, s2, e2][h2], g: 255 * [s2, e2, e2, i2, o3, o3][h2], b: 255 * [o3, o3, s2, e2, e2, i2][h2], a: u2 }; | |
| 4699 | - }; | |
| 4700 | - var g = function(r2) { | |
| 4701 | - return { h: u(r2.h), s: e(r2.s, 0, 100), l: e(r2.l, 0, 100), a: e(r2.a) }; | |
| 4702 | - }; | |
| 4703 | - var d = function(r2) { | |
| 4704 | - return { h: n(r2.h), s: n(r2.s), l: n(r2.l), a: n(r2.a, 3) }; | |
| 4705 | - }; | |
| 4706 | - var f = function(r2) { | |
| 4707 | - return b((n2 = (t3 = r2).s, { h: t3.h, s: (n2 *= ((e2 = t3.l) < 50 ? e2 : 100 - e2) / 100) > 0 ? 2 * n2 / (e2 + n2) * 100 : 0, v: e2 + n2, a: t3.a })); | |
| 4708 | - var t3, n2, e2; | |
| 4709 | - }; | |
| 4710 | - var c = function(r2) { | |
| 4711 | - return { h: (t3 = h(r2)).h, s: (u2 = (200 - (n2 = t3.s)) * (e2 = t3.v) / 100) > 0 && u2 < 200 ? n2 * e2 / 100 / (u2 <= 100 ? u2 : 200 - u2) * 100 : 0, l: u2 / 2, a: t3.a }; | |
| 4712 | - var t3, n2, e2, u2; | |
| 4713 | - }; | |
| 4714 | - var l = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; | |
| 4715 | - var p = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; | |
| 4716 | - var v = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; | |
| 4717 | - var m = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; | |
| 4718 | - var y = { string: [[function(r2) { | |
| 4719 | - var t3 = i.exec(r2); | |
| 4720 | - return t3 ? (r2 = t3[1]).length <= 4 ? { r: parseInt(r2[0] + r2[0], 16), g: parseInt(r2[1] + r2[1], 16), b: parseInt(r2[2] + r2[2], 16), a: 4 === r2.length ? n(parseInt(r2[3] + r2[3], 16) / 255, 2) : 1 } : 6 === r2.length || 8 === r2.length ? { r: parseInt(r2.substr(0, 2), 16), g: parseInt(r2.substr(2, 2), 16), b: parseInt(r2.substr(4, 2), 16), a: 8 === r2.length ? n(parseInt(r2.substr(6, 2), 16) / 255, 2) : 1 } : null : null; | |
| 1105 | + var N = /^hsla?\(\s*([+-]?(?:\d*\.\d+|\d+))(deg|rad|grad|turn)?\s*,\s*([+-]?(?:\d*\.\d+|\d+))%\s*,\s*([+-]?(?:\d*\.\d+|\d+))%\s*(?:,\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*)?\)$/i; | |
| 1106 | + var x = /^hsla?\(\s*([+-]?(?:\d*\.\d+|\d+))(deg|rad|grad|turn)?\s+([+-]?(?:\d*\.\d+|\d+))%\s+([+-]?(?:\d*\.\d+|\d+))%\s*(?:\/\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*)?\)$/i; | |
| 1107 | + var M = /^rgba?\(\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*,\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*,\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*(?:,\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*)?\)$/i; | |
| 1108 | + var H = /^rgba?\(\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s+([+-]?(?:\d*\.\d+|\d+))(%)?\s+([+-]?(?:\d*\.\d+|\d+))(%)?\s*(?:\/\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*)?\)$/i; | |
| 1109 | + var $ = { string: [[function(r2) { | |
| 1110 | + if (!s.test(r2)) return null; | |
| 1111 | + var t2 = r2.length; | |
| 1112 | + return t2 <= 5 ? { r: 17 * d2(r2, 1), g: 17 * d2(r2, 2), b: 17 * d2(r2, 3), a: 5 === t2 ? n(17 * d2(r2, 4) / 255, 2) : 1 } : 7 === t2 || 9 === t2 ? { r: h(r2, 1), g: h(r2, 3), b: h(r2, 5), a: 9 === t2 ? n(h(r2, 7) / 255, 2) : 1 } : null; | |
| 4721 | 1113 | }, "hex"], [function(r2) { |
| 4722 | - var t3 = v.exec(r2) || m.exec(r2); | |
| 4723 | - return t3 ? t3[2] !== t3[4] || t3[4] !== t3[6] ? null : a({ r: Number(t3[1]) / (t3[2] ? 100 / 255 : 1), g: Number(t3[3]) / (t3[4] ? 100 / 255 : 1), b: Number(t3[5]) / (t3[6] ? 100 / 255 : 1), a: void 0 === t3[7] ? 1 : Number(t3[7]) / (t3[8] ? 100 : 1) }) : null; | |
| 4724 | - }, "rgb"], [function(t3) { | |
| 4725 | - var n2 = l.exec(t3) || p.exec(t3); | |
| 4726 | - if (!n2) return null; | |
| 4727 | - var e2, u2, a2 = g({ h: (e2 = n2[1], u2 = n2[2], void 0 === u2 && (u2 = "deg"), Number(e2) * (r[u2] || 1)), s: Number(n2[3]), l: Number(n2[4]), a: void 0 === n2[5] ? 1 : Number(n2[5]) / (n2[6] ? 100 : 1) }); | |
| 4728 | - return f(a2); | |
| 1114 | + var t2 = M.exec(r2) || H.exec(r2); | |
| 1115 | + return t2 ? t2[2] !== t2[4] || t2[4] !== t2[6] ? null : a({ r: Number(t2[1]) / (t2[2] ? 100 / 255 : 1), g: Number(t2[3]) / (t2[4] ? 100 / 255 : 1), b: Number(t2[5]) / (t2[6] ? 100 / 255 : 1), a: void 0 === t2[7] ? 1 : Number(t2[7]) / (t2[8] ? 100 : 1) }) : null; | |
| 1116 | + }, "rgb"], [function(t2) { | |
| 1117 | + var n = N.exec(t2) || x.exec(t2); | |
| 1118 | + if (!n) return null; | |
| 1119 | + var u, e2, o2 = l({ h: (u = n[1], e2 = n[2], void 0 === e2 && (e2 = "deg"), Number(u) * (r2[e2] || 1)), s: Number(n[3]), l: Number(n[4]), a: void 0 === n[5] ? 1 : Number(n[5]) / (n[6] ? 100 : 1) }); | |
| 1120 | + return m(o2); | |
| 4729 | 1121 | }, "hsl"]], object: [[function(r2) { |
| 4730 | - var n2 = r2.r, e2 = r2.g, u2 = r2.b, o3 = r2.a, i2 = void 0 === o3 ? 1 : o3; | |
| 4731 | - return t(n2) && t(e2) && t(u2) ? a({ r: Number(n2), g: Number(e2), b: Number(u2), a: Number(i2) }) : null; | |
| 1122 | + var n = r2.r, u = r2.g, e2 = r2.b, o2 = r2.a, i = void 0 === o2 ? 1 : o2; | |
| 1123 | + return t2(n) && t2(u) && t2(e2) ? a({ r: Number(n), g: Number(u), b: Number(e2), a: Number(i) }) : null; | |
| 4732 | 1124 | }, "rgb"], [function(r2) { |
| 4733 | - var n2 = r2.h, e2 = r2.s, u2 = r2.l, a2 = r2.a, o3 = void 0 === a2 ? 1 : a2; | |
| 4734 | - if (!t(n2) || !t(e2) || !t(u2)) return null; | |
| 4735 | - var i2 = g({ h: Number(n2), s: Number(e2), l: Number(u2), a: Number(o3) }); | |
| 4736 | - return f(i2); | |
| 1125 | + var n = r2.h, u = r2.s, e2 = r2.l, o2 = r2.a, a = void 0 === o2 ? 1 : o2; | |
| 1126 | + if (!t2(n) || !t2(u) || !t2(e2)) return null; | |
| 1127 | + var i = l({ h: Number(n), s: Number(u), l: Number(e2), a: Number(a) }); | |
| 1128 | + return m(i); | |
| 4737 | 1129 | }, "hsl"], [function(r2) { |
| 4738 | - var n2 = r2.h, a2 = r2.s, o3 = r2.v, i2 = r2.a, s2 = void 0 === i2 ? 1 : i2; | |
| 4739 | - if (!t(n2) || !t(a2) || !t(o3)) return null; | |
| 4740 | - var h2 = (function(r3) { | |
| 4741 | - return { h: u(r3.h), s: e(r3.s, 0, 100), v: e(r3.v, 0, 100), a: e(r3.a) }; | |
| 4742 | - })({ h: Number(n2), s: Number(a2), v: Number(o3), a: Number(s2) }); | |
| 4743 | - return b(h2); | |
| 1130 | + var n = r2.h, o2 = r2.s, a = r2.v, i = r2.a, s = void 0 === i ? 1 : i; | |
| 1131 | + if (!t2(n) || !t2(o2) || !t2(a)) return null; | |
| 1132 | + var d2 = (function(r3) { | |
| 1133 | + return { h: e2(r3.h), s: u(r3.s, 0, 100), v: u(r3.v, 0, 100), a: u(r3.a) }; | |
| 1134 | + })({ h: Number(n), s: Number(o2), v: Number(a), a: Number(s) }); | |
| 1135 | + return v(d2); | |
| 4744 | 1136 | }, "hsv"]] }; |
| 4745 | - var N = function(r2, t3) { | |
| 4746 | - for (var n2 = 0; n2 < t3.length; n2++) { | |
| 4747 | - var e2 = t3[n2][0](r2); | |
| 4748 | - if (e2) return [e2, t3[n2][1]]; | |
| 1137 | + var j = function(r2, t2) { | |
| 1138 | + for (var n = 0; n < t2.length; n++) { | |
| 1139 | + var u = t2[n][0](r2); | |
| 1140 | + if (u) return [u, t2[n][1]]; | |
| 4749 | 1141 | } |
| 4750 | 1142 | return [null, void 0]; |
| 4751 | 1143 | }; |
| 4752 | - var x = function(r2) { | |
| 4753 | - return "string" == typeof r2 ? N(r2.trim(), y.string) : "object" == typeof r2 && null !== r2 ? N(r2, y.object) : [null, void 0]; | |
| 1144 | + var w = function(r2) { | |
| 1145 | + return "string" == typeof r2 ? j(r2.trim(), $.string) : "object" == typeof r2 && null !== r2 ? j(r2, $.object) : [null, void 0]; | |
| 4754 | 1146 | }; |
| 4755 | - var M = function(r2, t3) { | |
| 4756 | - var n2 = c(r2); | |
| 4757 | - return { h: n2.h, s: e(n2.s + 100 * t3, 0, 100), l: n2.l, a: n2.a }; | |
| 1147 | + var k = function(r2, t2) { | |
| 1148 | + var n = y(r2); | |
| 1149 | + return { h: n.h, s: u(n.s + 100 * t2, 0, 100), l: n.l, a: n.a }; | |
| 4758 | 1150 | }; |
| 4759 | - var H = function(r2) { | |
| 1151 | + var E = function(r2) { | |
| 4760 | 1152 | return (299 * r2.r + 587 * r2.g + 114 * r2.b) / 1e3 / 255; |
| 4761 | 1153 | }; |
| 4762 | - var $ = function(r2, t3) { | |
| 4763 | - var n2 = c(r2); | |
| 4764 | - return { h: n2.h, s: n2.s, l: e(n2.l + 100 * t3, 0, 100), a: n2.a }; | |
| 1154 | + var R = function(r2, t2) { | |
| 1155 | + var n = y(r2); | |
| 1156 | + return { h: n.h, s: n.s, l: u(n.l + 100 * t2, 0, 100), a: n.a }; | |
| 4765 | 1157 | }; |
| 4766 | - var j = (function() { | |
| 1158 | + var q = (function() { | |
| 4767 | 1159 | function r2(r3) { |
| 4768 | - this.parsed = x(r3)[0], this.rgba = this.parsed || { r: 0, g: 0, b: 0, a: 1 }; | |
| 1160 | + this.parsed = w(r3)[0], this.rgba = this.parsed || { r: 0, g: 0, b: 0, a: 1 }; | |
| 4769 | 1161 | } |
| 4770 | 1162 | return r2.prototype.isValid = function() { |
| 4771 | 1163 | return null !== this.parsed; |
| 4772 | 1164 | }, r2.prototype.brightness = function() { |
| 4773 | - return n(H(this.rgba), 2); | |
| 1165 | + return n(E(this.rgba), 2); | |
| 4774 | 1166 | }, r2.prototype.isDark = function() { |
| 4775 | - return H(this.rgba) < 0.5; | |
| 1167 | + return E(this.rgba) < 0.5; | |
| 4776 | 1168 | }, r2.prototype.isLight = function() { |
| 4777 | - return H(this.rgba) >= 0.5; | |
| 1169 | + return E(this.rgba) >= 0.5; | |
| 4778 | 1170 | }, r2.prototype.toHex = function() { |
| 4779 | - return r3 = o(this.rgba), t3 = r3.r, e2 = r3.g, u2 = r3.b, i2 = (a2 = r3.a) < 1 ? s(n(255 * a2)) : "", "#" + s(t3) + s(e2) + s(u2) + i2; | |
| 4780 | - var r3, t3, e2, u2, a2, i2; | |
| 1171 | + return r3 = i(this.rgba), t2 = r3.r, u = r3.g, e2 = r3.b, a = (o2 = r3.a) < 1 ? g(n(255 * o2)) : "", "#" + g(t2) + g(u) + g(e2) + a; | |
| 1172 | + var r3, t2, u, e2, o2, a; | |
| 4781 | 1173 | }, r2.prototype.toRgb = function() { |
| 4782 | - return o(this.rgba); | |
| 1174 | + return i(this.rgba); | |
| 4783 | 1175 | }, r2.prototype.toRgbString = function() { |
| 4784 | - return r3 = o(this.rgba), t3 = r3.r, n2 = r3.g, e2 = r3.b, (u2 = r3.a) < 1 ? "rgba(" + t3 + ", " + n2 + ", " + e2 + ", " + u2 + ")" : "rgb(" + t3 + ", " + n2 + ", " + e2 + ")"; | |
| 4785 | - var r3, t3, n2, e2, u2; | |
| 1176 | + return r3 = i(this.rgba), t2 = r3.r, n = r3.g, u = r3.b, (e2 = r3.a) < 1 ? "rgba(" + t2 + ", " + n + ", " + u + ", " + e2 + ")" : "rgb(" + t2 + ", " + n + ", " + u + ")"; | |
| 1177 | + var r3, t2, n, u, e2; | |
| 4786 | 1178 | }, r2.prototype.toHsl = function() { |
| 4787 | - return d(c(this.rgba)); | |
| 1179 | + return p(y(this.rgba)); | |
| 4788 | 1180 | }, r2.prototype.toHslString = function() { |
| 4789 | - return r3 = d(c(this.rgba)), t3 = r3.h, n2 = r3.s, e2 = r3.l, (u2 = r3.a) < 1 ? "hsla(" + t3 + ", " + n2 + "%, " + e2 + "%, " + u2 + ")" : "hsl(" + t3 + ", " + n2 + "%, " + e2 + "%)"; | |
| 4790 | - var r3, t3, n2, e2, u2; | |
| 1181 | + return r3 = p(y(this.rgba)), t2 = r3.h, n = r3.s, u = r3.l, (e2 = r3.a) < 1 ? "hsla(" + t2 + ", " + n + "%, " + u + "%, " + e2 + ")" : "hsl(" + t2 + ", " + n + "%, " + u + "%)"; | |
| 1182 | + var r3, t2, n, u, e2; | |
| 4791 | 1183 | }, r2.prototype.toHsv = function() { |
| 4792 | - return r3 = h(this.rgba), { h: n(r3.h), s: n(r3.s), v: n(r3.v), a: n(r3.a, 3) }; | |
| 1184 | + return r3 = c(this.rgba), { h: o2(r3.h), s: n(r3.s), v: n(r3.v), a: n(r3.a, 3) }; | |
| 4793 | 1185 | var r3; |
| 4794 | 1186 | }, r2.prototype.invert = function() { |
| 4795 | - return w({ r: 255 - (r3 = this.rgba).r, g: 255 - r3.g, b: 255 - r3.b, a: r3.a }); | |
| 1187 | + return A({ r: 255 - (r3 = this.rgba).r, g: 255 - r3.g, b: 255 - r3.b, a: r3.a }); | |
| 4796 | 1188 | var r3; |
| 4797 | 1189 | }, r2.prototype.saturate = function(r3) { |
| 4798 | - return void 0 === r3 && (r3 = 0.1), w(M(this.rgba, r3)); | |
| 1190 | + return void 0 === r3 && (r3 = 0.1), A(k(this.rgba, r3)); | |
| 4799 | 1191 | }, r2.prototype.desaturate = function(r3) { |
| 4800 | - return void 0 === r3 && (r3 = 0.1), w(M(this.rgba, -r3)); | |
| 1192 | + return void 0 === r3 && (r3 = 0.1), A(k(this.rgba, -r3)); | |
| 4801 | 1193 | }, r2.prototype.grayscale = function() { |
| 4802 | - return w(M(this.rgba, -1)); | |
| 1194 | + return A(k(this.rgba, -1)); | |
| 4803 | 1195 | }, r2.prototype.lighten = function(r3) { |
| 4804 | - return void 0 === r3 && (r3 = 0.1), w($(this.rgba, r3)); | |
| 1196 | + return void 0 === r3 && (r3 = 0.1), A(R(this.rgba, r3)); | |
| 4805 | 1197 | }, r2.prototype.darken = function(r3) { |
| 4806 | - return void 0 === r3 && (r3 = 0.1), w($(this.rgba, -r3)); | |
| 1198 | + return void 0 === r3 && (r3 = 0.1), A(R(this.rgba, -r3)); | |
| 4807 | 1199 | }, r2.prototype.rotate = function(r3) { |
| 4808 | - return void 0 === r3 && (r3 = 15), this.hue(this.hue() + r3); | |
| 1200 | + return void 0 === r3 && (r3 = 15), this.hue(y(this.rgba).h + r3); | |
| 4809 | 1201 | }, r2.prototype.alpha = function(r3) { |
| 4810 | - return "number" == typeof r3 ? w({ r: (t3 = this.rgba).r, g: t3.g, b: t3.b, a: r3 }) : n(this.rgba.a, 3); | |
| 4811 | - var t3; | |
| 1202 | + return "number" == typeof r3 ? A({ r: (t2 = this.rgba).r, g: t2.g, b: t2.b, a: r3 }) : n(this.rgba.a, 3); | |
| 1203 | + var t2; | |
| 4812 | 1204 | }, r2.prototype.hue = function(r3) { |
| 4813 | - var t3 = c(this.rgba); | |
| 4814 | - return "number" == typeof r3 ? w({ h: r3, s: t3.s, l: t3.l, a: t3.a }) : n(t3.h); | |
| 1205 | + var t2 = y(this.rgba); | |
| 1206 | + return "number" == typeof r3 ? A({ h: r3, s: t2.s, l: t2.l, a: t2.a }) : o2(t2.h); | |
| 4815 | 1207 | }, r2.prototype.isEqual = function(r3) { |
| 4816 | - return this.toHex() === w(r3).toHex(); | |
| 1208 | + return this.toHex() === A(r3).toHex(); | |
| 4817 | 1209 | }, r2; |
| 4818 | 1210 | })(); |
| 4819 | - var w = function(r2) { | |
| 4820 | - return r2 instanceof j ? r2 : new j(r2); | |
| 1211 | + var A = function(r2) { | |
| 1212 | + return r2 instanceof q ? r2 : new q(r2); | |
| 4821 | 1213 | }; |
| 4822 | - var S = []; | |
| 4823 | - var k = function(r2) { | |
| 1214 | + var C = []; | |
| 1215 | + var D = function(r2) { | |
| 4824 | 1216 | r2.forEach(function(r3) { |
| 4825 | - S.indexOf(r3) < 0 && (r3(j, y), S.push(r3)); | |
| 1217 | + C.indexOf(r3) < 0 && (r3(q, $), C.push(r3)); | |
| 4826 | 1218 | }); |
| 4827 | 1219 | }; |
| 4828 | 1220 | |
| 4829 | 1221 | // node_modules/colord/plugins/names.mjs |
| 4830 | - function names_default(e2, f2) { | |
| 4831 | - var a2 = { white: "#ffffff", bisque: "#ffe4c4", blue: "#0000ff", cadetblue: "#5f9ea0", chartreuse: "#7fff00", chocolate: "#d2691e", coral: "#ff7f50", antiquewhite: "#faebd7", aqua: "#00ffff", azure: "#f0ffff", whitesmoke: "#f5f5f5", papayawhip: "#ffefd5", plum: "#dda0dd", blanchedalmond: "#ffebcd", black: "#000000", gold: "#ffd700", goldenrod: "#daa520", gainsboro: "#dcdcdc", cornsilk: "#fff8dc", cornflowerblue: "#6495ed", burlywood: "#deb887", aquamarine: "#7fffd4", beige: "#f5f5dc", crimson: "#dc143c", cyan: "#00ffff", darkblue: "#00008b", darkcyan: "#008b8b", darkgoldenrod: "#b8860b", darkkhaki: "#bdb76b", darkgray: "#a9a9a9", darkgreen: "#006400", darkgrey: "#a9a9a9", peachpuff: "#ffdab9", darkmagenta: "#8b008b", darkred: "#8b0000", darkorchid: "#9932cc", darkorange: "#ff8c00", darkslateblue: "#483d8b", gray: "#808080", darkslategray: "#2f4f4f", darkslategrey: "#2f4f4f", deeppink: "#ff1493", deepskyblue: "#00bfff", wheat: "#f5deb3", firebrick: "#b22222", floralwhite: "#fffaf0", ghostwhite: "#f8f8ff", darkviolet: "#9400d3", magenta: "#ff00ff", green: "#008000", dodgerblue: "#1e90ff", grey: "#808080", honeydew: "#f0fff0", hotpink: "#ff69b4", blueviolet: "#8a2be2", forestgreen: "#228b22", lawngreen: "#7cfc00", indianred: "#cd5c5c", indigo: "#4b0082", fuchsia: "#ff00ff", brown: "#a52a2a", maroon: "#800000", mediumblue: "#0000cd", lightcoral: "#f08080", darkturquoise: "#00ced1", lightcyan: "#e0ffff", ivory: "#fffff0", lightyellow: "#ffffe0", lightsalmon: "#ffa07a", lightseagreen: "#20b2aa", linen: "#faf0e6", mediumaquamarine: "#66cdaa", lemonchiffon: "#fffacd", lime: "#00ff00", khaki: "#f0e68c", mediumseagreen: "#3cb371", limegreen: "#32cd32", mediumspringgreen: "#00fa9a", lightskyblue: "#87cefa", lightblue: "#add8e6", midnightblue: "#191970", lightpink: "#ffb6c1", mistyrose: "#ffe4e1", moccasin: "#ffe4b5", mintcream: "#f5fffa", lightslategray: "#778899", lightslategrey: "#778899", navajowhite: "#ffdead", navy: "#000080", mediumvioletred: "#c71585", powderblue: "#b0e0e6", palegoldenrod: "#eee8aa", oldlace: "#fdf5e6", paleturquoise: "#afeeee", mediumturquoise: "#48d1cc", mediumorchid: "#ba55d3", rebeccapurple: "#663399", lightsteelblue: "#b0c4de", mediumslateblue: "#7b68ee", thistle: "#d8bfd8", tan: "#d2b48c", orchid: "#da70d6", mediumpurple: "#9370db", purple: "#800080", pink: "#ffc0cb", skyblue: "#87ceeb", springgreen: "#00ff7f", palegreen: "#98fb98", red: "#ff0000", yellow: "#ffff00", slateblue: "#6a5acd", lavenderblush: "#fff0f5", peru: "#cd853f", palevioletred: "#db7093", violet: "#ee82ee", teal: "#008080", slategray: "#708090", slategrey: "#708090", aliceblue: "#f0f8ff", darkseagreen: "#8fbc8f", darkolivegreen: "#556b2f", greenyellow: "#adff2f", seagreen: "#2e8b57", seashell: "#fff5ee", tomato: "#ff6347", silver: "#c0c0c0", sienna: "#a0522d", lavender: "#e6e6fa", lightgreen: "#90ee90", orange: "#ffa500", orangered: "#ff4500", steelblue: "#4682b4", royalblue: "#4169e1", turquoise: "#40e0d0", yellowgreen: "#9acd32", salmon: "#fa8072", saddlebrown: "#8b4513", sandybrown: "#f4a460", rosybrown: "#bc8f8f", darksalmon: "#e9967a", lightgoldenrodyellow: "#fafad2", snow: "#fffafa", lightgrey: "#d3d3d3", lightgray: "#d3d3d3", dimgray: "#696969", dimgrey: "#696969", olivedrab: "#6b8e23", olive: "#808000" }, r2 = {}; | |
| 4832 | - for (var d2 in a2) r2[a2[d2]] = d2; | |
| 4833 | - var l2 = {}; | |
| 1222 | + var e = function(e2, f2) { | |
| 1223 | + var a = { white: "#ffffff", bisque: "#ffe4c4", blue: "#0000ff", cadetblue: "#5f9ea0", chartreuse: "#7fff00", chocolate: "#d2691e", coral: "#ff7f50", antiquewhite: "#faebd7", aqua: "#00ffff", azure: "#f0ffff", whitesmoke: "#f5f5f5", papayawhip: "#ffefd5", plum: "#dda0dd", blanchedalmond: "#ffebcd", black: "#000000", gold: "#ffd700", goldenrod: "#daa520", gainsboro: "#dcdcdc", cornsilk: "#fff8dc", cornflowerblue: "#6495ed", burlywood: "#deb887", aquamarine: "#7fffd4", beige: "#f5f5dc", crimson: "#dc143c", cyan: "#00ffff", darkblue: "#00008b", darkcyan: "#008b8b", darkgoldenrod: "#b8860b", darkkhaki: "#bdb76b", darkgray: "#a9a9a9", darkgreen: "#006400", darkgrey: "#a9a9a9", peachpuff: "#ffdab9", darkmagenta: "#8b008b", darkred: "#8b0000", darkorchid: "#9932cc", darkorange: "#ff8c00", darkslateblue: "#483d8b", gray: "#808080", darkslategray: "#2f4f4f", darkslategrey: "#2f4f4f", deeppink: "#ff1493", deepskyblue: "#00bfff", wheat: "#f5deb3", firebrick: "#b22222", floralwhite: "#fffaf0", ghostwhite: "#f8f8ff", darkviolet: "#9400d3", magenta: "#ff00ff", green: "#008000", dodgerblue: "#1e90ff", grey: "#808080", honeydew: "#f0fff0", hotpink: "#ff69b4", blueviolet: "#8a2be2", forestgreen: "#228b22", lawngreen: "#7cfc00", indianred: "#cd5c5c", indigo: "#4b0082", fuchsia: "#ff00ff", brown: "#a52a2a", maroon: "#800000", mediumblue: "#0000cd", lightcoral: "#f08080", darkturquoise: "#00ced1", lightcyan: "#e0ffff", ivory: "#fffff0", lightyellow: "#ffffe0", lightsalmon: "#ffa07a", lightseagreen: "#20b2aa", linen: "#faf0e6", mediumaquamarine: "#66cdaa", lemonchiffon: "#fffacd", lime: "#00ff00", khaki: "#f0e68c", mediumseagreen: "#3cb371", limegreen: "#32cd32", mediumspringgreen: "#00fa9a", lightskyblue: "#87cefa", lightblue: "#add8e6", midnightblue: "#191970", lightpink: "#ffb6c1", mistyrose: "#ffe4e1", moccasin: "#ffe4b5", mintcream: "#f5fffa", lightslategray: "#778899", lightslategrey: "#778899", navajowhite: "#ffdead", navy: "#000080", mediumvioletred: "#c71585", powderblue: "#b0e0e6", palegoldenrod: "#eee8aa", oldlace: "#fdf5e6", paleturquoise: "#afeeee", mediumturquoise: "#48d1cc", mediumorchid: "#ba55d3", rebeccapurple: "#663399", lightsteelblue: "#b0c4de", mediumslateblue: "#7b68ee", thistle: "#d8bfd8", tan: "#d2b48c", orchid: "#da70d6", mediumpurple: "#9370db", purple: "#800080", pink: "#ffc0cb", skyblue: "#87ceeb", springgreen: "#00ff7f", palegreen: "#98fb98", red: "#ff0000", yellow: "#ffff00", slateblue: "#6a5acd", lavenderblush: "#fff0f5", peru: "#cd853f", palevioletred: "#db7093", violet: "#ee82ee", teal: "#008080", slategray: "#708090", slategrey: "#708090", aliceblue: "#f0f8ff", darkseagreen: "#8fbc8f", darkolivegreen: "#556b2f", greenyellow: "#adff2f", seagreen: "#2e8b57", seashell: "#fff5ee", tomato: "#ff6347", silver: "#c0c0c0", sienna: "#a0522d", lavender: "#e6e6fa", lightgreen: "#90ee90", orange: "#ffa500", orangered: "#ff4500", steelblue: "#4682b4", royalblue: "#4169e1", turquoise: "#40e0d0", yellowgreen: "#9acd32", salmon: "#fa8072", saddlebrown: "#8b4513", sandybrown: "#f4a460", rosybrown: "#bc8f8f", darksalmon: "#e9967a", lightgoldenrodyellow: "#fafad2", snow: "#fffafa", lightgrey: "#d3d3d3", lightgray: "#d3d3d3", dimgray: "#696969", dimgrey: "#696969", olivedrab: "#6b8e23", olive: "#808000" }, r2 = {}; | |
| 1224 | + for (var d2 in a) r2[a[d2]] = d2; | |
| 1225 | + var l4 = {}; | |
| 4834 | 1226 | e2.prototype.toName = function(f3) { |
| 4835 | 1227 | if (!(this.rgba.a || this.rgba.r || this.rgba.g || this.rgba.b)) return "transparent"; |
| 4836 | - var d3, i2, n2 = r2[this.toHex()]; | |
| 4837 | - if (n2) return n2; | |
| 1228 | + var d3, i, n = r2[this.toHex()]; | |
| 1229 | + if (n) return n; | |
| 4838 | 1230 | if (null == f3 ? void 0 : f3.closest) { |
| 4839 | - var o3 = this.toRgb(), t3 = 1 / 0, b2 = "black"; | |
| 4840 | - if (!l2.length) for (var c2 in a2) l2[c2] = new e2(a2[c2]).toRgb(); | |
| 4841 | - for (var g2 in a2) { | |
| 4842 | - var u2 = (d3 = o3, i2 = l2[g2], Math.pow(d3.r - i2.r, 2) + Math.pow(d3.g - i2.g, 2) + Math.pow(d3.b - i2.b, 2)); | |
| 4843 | - u2 < t3 && (t3 = u2, b2 = g2); | |
| 1231 | + var o2 = this.toRgb(), t2 = 1 / 0, b2 = "black"; | |
| 1232 | + if (!l4.length) for (var c2 in a) l4[c2] = new e2(a[c2]).toRgb(); | |
| 1233 | + for (var g2 in a) { | |
| 1234 | + var u = (d3 = o2, i = l4[g2], Math.pow(d3.r - i.r, 2) + Math.pow(d3.g - i.g, 2) + Math.pow(d3.b - i.b, 2)); | |
| 1235 | + u < t2 && (t2 = u, b2 = g2); | |
| 4844 | 1236 | } |
| 4845 | 1237 | return b2; |
| 4846 | 1238 | } |
| 4847 | 1239 | }; |
| 4848 | 1240 | f2.string.push([function(f3) { |
| 4849 | - var r3 = f3.toLowerCase(), d3 = "transparent" === r3 ? "#0000" : a2[r3]; | |
| 1241 | + var r3 = f3.toLowerCase(), d3 = "transparent" === r3 ? "#0000" : a[r3]; | |
| 4850 | 1242 | return d3 ? new e2(d3).toRgb() : null; |
| 4851 | 1243 | }, "name"]); |
| 4852 | - } | |
| 1244 | + }; | |
| 4853 | 1245 | |
| 4854 | 1246 | // node_modules/colord/plugins/a11y.mjs |
| 4855 | - var o2 = function(o3) { | |
| 4856 | - var t3 = o3 / 255; | |
| 4857 | - return t3 < 0.04045 ? t3 / 12.92 : Math.pow((t3 + 0.055) / 1.055, 2.4); | |
| 1247 | + var o = function(o2) { | |
| 1248 | + var t2 = o2 / 255; | |
| 1249 | + return t2 < 0.04045 ? t2 / 12.92 : Math.pow((t2 + 0.055) / 1.055, 2.4); | |
| 4858 | 1250 | }; |
| 4859 | - var t2 = function(t3) { | |
| 4860 | - return 0.2126 * o2(t3.r) + 0.7152 * o2(t3.g) + 0.0722 * o2(t3.b); | |
| 1251 | + var t = function(t2) { | |
| 1252 | + return 0.2126 * o(t2.r) + 0.7152 * o(t2.g) + 0.0722 * o(t2.b); | |
| 4861 | 1253 | }; |
| 4862 | - function a11y_default(o3) { | |
| 4863 | - o3.prototype.luminance = function() { | |
| 4864 | - return o4 = t2(this.rgba), void 0 === (r2 = 2) && (r2 = 0), void 0 === n2 && (n2 = Math.pow(10, r2)), Math.round(n2 * o4) / n2 + 0; | |
| 4865 | - var o4, r2, n2; | |
| 4866 | - }, o3.prototype.contrast = function(r2) { | |
| 1254 | + var r = function(o2) { | |
| 1255 | + o2.prototype.luminance = function() { | |
| 1256 | + return o3 = t(this.rgba), void 0 === (r2 = 2) && (r2 = 0), void 0 === n && (n = Math.pow(10, r2)), Math.round(n * o3) / n + 0; | |
| 1257 | + var o3, r2, n; | |
| 1258 | + }, o2.prototype.contrast = function(r2) { | |
| 4867 | 1259 | void 0 === r2 && (r2 = "#FFF"); |
| 4868 | - var n2, a2, i2, e2, v2, u2, d2, c2 = r2 instanceof o3 ? r2 : new o3(r2); | |
| 4869 | - return e2 = this.rgba, v2 = c2.toRgb(), u2 = t2(e2), d2 = t2(v2), n2 = u2 > d2 ? (u2 + 0.05) / (d2 + 0.05) : (d2 + 0.05) / (u2 + 0.05), void 0 === (a2 = 2) && (a2 = 0), void 0 === i2 && (i2 = Math.pow(10, a2)), Math.floor(i2 * n2) / i2 + 0; | |
| 4870 | - }, o3.prototype.isReadable = function(o4, t3) { | |
| 4871 | - return void 0 === o4 && (o4 = "#FFF"), void 0 === t3 && (t3 = {}), this.contrast(o4) >= (e2 = void 0 === (i2 = (r2 = t3).size) ? "normal" : i2, "AAA" === (a2 = void 0 === (n2 = r2.level) ? "AA" : n2) && "normal" === e2 ? 7 : "AA" === a2 && "large" === e2 ? 3 : 4.5); | |
| 4872 | - var r2, n2, a2, i2, e2; | |
| 1260 | + var n, a, i, e2, v3, u, d2, c2 = r2 instanceof o2 ? r2 : new o2(r2); | |
| 1261 | + return e2 = this.rgba, v3 = c2.toRgb(), u = t(e2), d2 = t(v3), n = u > d2 ? (u + 0.05) / (d2 + 0.05) : (d2 + 0.05) / (u + 0.05), void 0 === (a = 2) && (a = 0), void 0 === i && (i = Math.pow(10, a)), Math.floor(i * n) / i + 0; | |
| 1262 | + }, o2.prototype.isReadable = function(o3, t2) { | |
| 1263 | + return void 0 === o3 && (o3 = "#FFF"), void 0 === t2 && (t2 = {}), this.contrast(o3) >= (e2 = void 0 === (i = (r2 = t2).size) ? "normal" : i, "AAA" === (a = void 0 === (n = r2.level) ? "AA" : n) && "normal" === e2 ? 7 : "AA" === a && "large" === e2 ? 3 : 4.5); | |
| 1264 | + var r2, n, a, i, e2; | |
| 4873 | 1265 | }; |
| 4874 | - } | |
| 1266 | + }; | |
| 4875 | 1267 | |
| 4876 | 1268 | // packages/blocks/build-module/api/utils.mjs |
| 4877 | 1269 | var import_element = __toESM(require_element(), 1); |
| 4878 | 1270 | var import_i18n2 = __toESM(require_i18n(), 1); |
| @@ -5153,8 +1545,13 @@ | ||
| 5153 | 1545 | value: ["typography", "textIndent"], |
| 5154 | 1546 | support: ["typography", "textIndent"], |
| 5155 | 1547 | useEngine: true |
| 5156 | 1548 | }, |
| 1549 | + textShadow: { | |
| 1550 | + value: ["typography", "textShadow"], | |
| 1551 | + support: ["typography", "textShadow"], | |
| 1552 | + useEngine: true | |
| 1553 | + }, | |
| 5157 | 1554 | writingMode: { |
| 5158 | 1555 | value: ["typography", "writingMode"], |
| 5159 | 1556 | support: ["typography", "__experimentalWritingMode"], |
| 5160 | 1557 | useEngine: true |
| @@ -5182,8 +1579,9 @@ | ||
| 5182 | 1579 | h6: "h6", |
| 5183 | 1580 | button: ".wp-element-button, .wp-block-button__link", |
| 5184 | 1581 | caption: ".wp-element-caption, .wp-block-audio figcaption, .wp-block-embed figcaption, .wp-block-gallery figcaption, .wp-block-image figcaption, .wp-block-table figcaption, .wp-block-video figcaption", |
| 5185 | 1582 | cite: "cite", |
| 1583 | + label: "label", | |
| 5186 | 1584 | select: "select", |
| 5187 | 1585 | textInput: "textarea, input:where([type=email],[type=number],[type=password],[type=search],[type=tel],[type=text],[type=url])" |
| 5188 | 1586 | }; |
| 5189 | 1587 | var __EXPERIMENTAL_PATHS_WITH_OVERRIDE = { |
| @@ -5418,10 +1816,10 @@ | ||
| 5418 | 1816 | return (0, import_data.select)(store).getBlockVariations(blockName, scope); |
| 5419 | 1817 | }; |
| 5420 | 1818 | var registerBlockVariation = (blockName, variation) => { |
| 5421 | 1819 | if (Array.isArray(variation)) { |
| 5422 | - for (const v2 of variation) { | |
| 5423 | - if (typeof v2.name !== "string") { | |
| 1820 | + for (const v3 of variation) { | |
| 1821 | + if (typeof v3.name !== "string") { | |
| 5424 | 1822 | (0, import_warning.default)("Variation names must be unique strings."); |
| 5425 | 1823 | } |
| 5426 | 1824 | } |
| 5427 | 1825 | } else if (typeof variation.name !== "string") { |
| @@ -5528,9 +1926,9 @@ | ||
| 5528 | 1926 | return unlock((0, import_data.select)(store)).getAllBlockBindingsSources(); |
| 5529 | 1927 | } |
| 5530 | 1928 | |
| 5531 | 1929 | // packages/blocks/build-module/api/utils.mjs |
| 5532 | - k([names_default, a11y_default]); | |
| 1930 | + D([e, r]); | |
| 5533 | 1931 | var ICON_COLORS = ["#191e23", "#f8f9f9"]; |
| 5534 | 1932 | function isUnmodifiedBlock(block, role) { |
| 5535 | 1933 | const blockAttributes = getBlockType(block.name)?.attributes ?? {}; |
| 5536 | 1934 | const attributesByRole = role ? Object.entries(blockAttributes).filter(([key, definition]) => { |
| @@ -5565,9 +1963,9 @@ | ||
| 5565 | 1963 | return { src: resolvedIcon }; |
| 5566 | 1964 | } |
| 5567 | 1965 | const iconDescriptor = resolvedIcon; |
| 5568 | 1966 | if ("background" in iconDescriptor) { |
| 5569 | - const colordBgColor = w(iconDescriptor.background); | |
| 1967 | + const colordBgColor = A(iconDescriptor.background); | |
| 5570 | 1968 | const getColorContrast = (iconColor) => colordBgColor.contrast(iconColor); |
| 5571 | 1969 | const maxContrast = Math.max(...ICON_COLORS.map(getColorContrast)); |
| 5572 | 1970 | return { |
| 5573 | 1971 | ...iconDescriptor, |
| @@ -5659,9 +2057,9 @@ | ||
| 5659 | 2057 | } |
| 5660 | 2058 | function isBlockRegistered(name) { |
| 5661 | 2059 | return getBlockType(name) !== void 0; |
| 5662 | 2060 | } |
| 5663 | - function __experimentalSanitizeBlockAttributes(name, attributes) { | |
| 2061 | + function sanitizeBlockAttributes(name, attributes) { | |
| 5664 | 2062 | const blockType = getBlockType(name); |
| 5665 | 2063 | if (void 0 === blockType) { |
| 5666 | 2064 | throw new Error(`Block type '${name}' is not registered.`); |
| 5667 | 2065 | } |
| @@ -5697,8 +2095,15 @@ | ||
| 5697 | 2095 | }, |
| 5698 | 2096 | {} |
| 5699 | 2097 | ); |
| 5700 | 2098 | } |
| 2099 | + function __experimentalSanitizeBlockAttributes(name, attributes) { | |
| 2100 | + (0, import_deprecated.default)("__experimentalSanitizeBlockAttributes", { | |
| 2101 | + since: "7.1", | |
| 2102 | + alternative: "sanitizeBlockAttributes" | |
| 2103 | + }); | |
| 2104 | + return sanitizeBlockAttributes(name, attributes); | |
| 2105 | + } | |
| 5701 | 2106 | function getBlockAttributesNamesByRole(name, role) { |
| 5702 | 2107 | const attributes = getBlockType(name)?.attributes; |
| 5703 | 2108 | if (!attributes) { |
| 5704 | 2109 | return []; |
| @@ -6053,8 +2458,9 @@ | ||
| 6053 | 2458 | hasChildBlocksWithInserterSupport: () => hasChildBlocksWithInserterSupport2, |
| 6054 | 2459 | isMatchingSearchTerm: () => isMatchingSearchTerm |
| 6055 | 2460 | }); |
| 6056 | 2461 | var import_remove_accents = __toESM(require_remove_accents(), 1); |
| 2462 | + var import_es6 = __toESM(require_es6(), 1); | |
| 6057 | 2463 | var import_data4 = __toESM(require_data(), 1); |
| 6058 | 2464 | var import_rich_text2 = __toESM(require_rich_text(), 1); |
| 6059 | 2465 | var import_deprecated3 = __toESM(require_deprecated(), 1); |
| 6060 | 2466 | |
| @@ -6084,8 +2490,9 @@ | ||
| 6084 | 2490 | __export(private_selectors_exports, { |
| 6085 | 2491 | getAllBlockBindingsSources: () => getAllBlockBindingsSources, |
| 6086 | 2492 | getBlockBindingsSource: () => getBlockBindingsSource2, |
| 6087 | 2493 | getBlockBindingsSourceFieldsList: () => getBlockBindingsSourceFieldsList, |
| 2494 | + getBlockKeyboardShortcuts: () => getBlockKeyboardShortcuts, | |
| 6088 | 2495 | getBootstrappedBlockType: () => getBootstrappedBlockType, |
| 6089 | 2496 | getSupportedStyles: () => getSupportedStyles, |
| 6090 | 2497 | getUnprocessedBlockTypes: () => getUnprocessedBlockTypes, |
| 6091 | 2498 | hasContentRoleAttribute: () => hasContentRoleAttribute |
| @@ -6112,8 +2519,9 @@ | ||
| 6112 | 2519 | "textAlign", |
| 6113 | 2520 | "textDecoration", |
| 6114 | 2521 | "textIndent", |
| 6115 | 2522 | "textTransform", |
| 2523 | + "textShadow", | |
| 6116 | 2524 | "letterSpacing" |
| 6117 | 2525 | ]; |
| 6118 | 2526 | function filterElementBlockSupports(blockSupports, name, element) { |
| 6119 | 2527 | return blockSupports.filter((support) => { |
| @@ -6219,8 +2627,59 @@ | ||
| 6219 | 2627 | }, |
| 6220 | 2628 | (state, source, blockContext) => [source.getFieldsList, source.usesContext, blockContext] |
| 6221 | 2629 | ) |
| 6222 | 2630 | ); |
| 2631 | + var getBlockKeyboardShortcuts = (0, import_data3.createSelector)( | |
| 2632 | + (state) => { | |
| 2633 | + const shortcuts = []; | |
| 2634 | + for (const blockName of Object.keys(state.blockTypes)) { | |
| 2635 | + for (const variation of state.blockVariations[blockName] ?? []) { | |
| 2636 | + if (!variation.shortcut) { | |
| 2637 | + continue; | |
| 2638 | + } | |
| 2639 | + shortcuts.push({ | |
| 2640 | + ...variation.shortcut, | |
| 2641 | + targetBlockName: blockName, | |
| 2642 | + blockNames: [blockName], | |
| 2643 | + variationName: variation.name | |
| 2644 | + }); | |
| 2645 | + } | |
| 2646 | + const transforms = state.blockTypes[blockName]?.transforms; | |
| 2647 | + for (const transform of transforms?.to ?? []) { | |
| 2648 | + if (transform.type !== "block") { | |
| 2649 | + continue; | |
| 2650 | + } | |
| 2651 | + const targetBlockName = transform.blocks?.[0]; | |
| 2652 | + if (!targetBlockName) { | |
| 2653 | + continue; | |
| 2654 | + } | |
| 2655 | + for (const shortcut of transform.shortcuts ?? []) { | |
| 2656 | + shortcuts.push({ | |
| 2657 | + ...shortcut, | |
| 2658 | + targetBlockName, | |
| 2659 | + blockNames: [blockName], | |
| 2660 | + variationName: shortcut.variationName ?? transform.variationName | |
| 2661 | + }); | |
| 2662 | + } | |
| 2663 | + } | |
| 2664 | + for (const transform of transforms?.from ?? []) { | |
| 2665 | + if (transform.type !== "block" || !transform.blocks?.length) { | |
| 2666 | + continue; | |
| 2667 | + } | |
| 2668 | + for (const shortcut of transform.shortcuts ?? []) { | |
| 2669 | + shortcuts.push({ | |
| 2670 | + ...shortcut, | |
| 2671 | + targetBlockName: blockName, | |
| 2672 | + blockNames: transform.blocks, | |
| 2673 | + variationName: shortcut.variationName ?? transform.variationName | |
| 2674 | + }); | |
| 2675 | + } | |
| 2676 | + } | |
| 2677 | + } | |
| 2678 | + return shortcuts; | |
| 2679 | + }, | |
| 2680 | + (state) => [state.blockTypes, state.blockVariations] | |
| 2681 | + ); | |
| 6223 | 2682 | var hasContentRoleAttribute = (state, blockTypeName) => { |
| 6224 | 2683 | const blockType = getBlockType2(state, blockTypeName); |
| 6225 | 2684 | if (!blockType) { |
| 6226 | 2685 | return false; |
| @@ -6271,18 +2730,29 @@ | ||
| 6271 | 2730 | (state, blockName) => [ |
| 6272 | 2731 | state.blockVariations[blockName] |
| 6273 | 2732 | ] |
| 6274 | 2733 | ); |
| 6275 | - function getActiveBlockVariation(state, blockName, attributes, scope) { | |
| 2734 | + function getActiveBlockVariation(state, blockName, attributes, scope, innerContent) { | |
| 6276 | 2735 | const variations = getBlockVariations2(state, blockName, scope); |
| 6277 | 2736 | if (!variations) { |
| 6278 | 2737 | return variations; |
| 6279 | 2738 | } |
| 2739 | + if (innerContent) { | |
| 2740 | + const innerContentMatch = variations.find( | |
| 2741 | + (variation) => variation.innerContent && (0, import_es6.default)(variation.innerContent, innerContent) | |
| 2742 | + ); | |
| 2743 | + if (innerContentMatch) { | |
| 2744 | + return innerContentMatch; | |
| 2745 | + } | |
| 2746 | + } | |
| 6280 | 2747 | const blockType = getBlockType2(state, blockName); |
| 6281 | 2748 | const attributeKeys = Object.keys(blockType?.attributes || {}); |
| 6282 | 2749 | let match; |
| 6283 | 2750 | let maxMatchedAttributes = 0; |
| 6284 | 2751 | for (const variation of variations) { |
| 2752 | + if (variation.innerContent) { | |
| 2753 | + continue; | |
| 2754 | + } | |
| 6285 | 2755 | if (Array.isArray(variation.isActive)) { |
| 6286 | 2756 | const definedAttributes = variation.isActive.filter( |
| 6287 | 2757 | (attribute) => { |
| 6288 | 2758 | const topLevelAttribute = attribute.split(".")[0]; |
| @@ -6424,15 +2894,15 @@ | ||
| 6424 | 2894 | }); |
| 6425 | 2895 | var import_deprecated5 = __toESM(require_deprecated(), 1); |
| 6426 | 2896 | |
| 6427 | 2897 | // node_modules/is-plain-object/dist/is-plain-object.mjs |
| 6428 | - function isObject3(o3) { | |
| 6429 | - return Object.prototype.toString.call(o3) === "[object Object]"; | |
| 2898 | + function isObject3(o2) { | |
| 2899 | + return Object.prototype.toString.call(o2) === "[object Object]"; | |
| 6430 | 2900 | } |
| 6431 | - function isPlainObject(o3) { | |
| 2901 | + function isPlainObject(o2) { | |
| 6432 | 2902 | var ctor, prot; |
| 6433 | - if (isObject3(o3) === false) return false; | |
| 6434 | - ctor = o3.constructor; | |
| 2903 | + if (isObject3(o2) === false) return false; | |
| 2904 | + ctor = o2.constructor; | |
| 6435 | 2905 | if (ctor === void 0) return true; |
| 6436 | 2906 | prot = ctor.prototype; |
| 6437 | 2907 | if (isObject3(prot) === false) return false; |
| 6438 | 2908 | if (prot.hasOwnProperty("isPrototypeOf") === false) { |
| @@ -6550,9 +3020,9 @@ | ||
| 6550 | 3020 | if ("edit" in settings && !(0, import_react_is.isValidElementType)(settings.edit)) { |
| 6551 | 3021 | (0, import_warning2.default)('The "edit" property must be a valid component.'); |
| 6552 | 3022 | return; |
| 6553 | 3023 | } |
| 6554 | - if (LEGACY_CATEGORY_MAPPING.hasOwnProperty(settings.category)) { | |
| 3024 | + if (typeof settings.category === "string" && LEGACY_CATEGORY_MAPPING.hasOwnProperty(settings.category)) { | |
| 6555 | 3025 | settings.category = LEGACY_CATEGORY_MAPPING[settings.category]; |
| 6556 | 3026 | } |
| 6557 | 3027 | if ("category" in settings && !select3.getCategories().some( |
| 6558 | 3028 | ({ slug }) => slug === settings.category |
| @@ -6569,10 +3039,11 @@ | ||
| 6569 | 3039 | if (typeof settings.title !== "string") { |
| 6570 | 3040 | (0, import_warning2.default)("Block titles must be strings."); |
| 6571 | 3041 | return; |
| 6572 | 3042 | } |
| 6573 | - settings.icon = normalizeIconObject(settings.icon); | |
| 6574 | - if (!isValidIcon(settings.icon.src)) { | |
| 3043 | + const icon = normalizeIconObject(settings.icon); | |
| 3044 | + settings.icon = icon; | |
| 3045 | + if (!isValidIcon(icon.src)) { | |
| 6575 | 3046 | (0, import_warning2.default)( |
| 6576 | 3047 | "The icon passed is invalid. The icon should be a string, an element, a function, or an object following the specifications documented in https://developer.wordpress.org/block-editor/developers/block-api/block-registration/#icon-optional" |
| 6577 | 3048 | ); |
| 6578 | 3049 | return; |
| @@ -6776,50 +3247,46 @@ | ||
| 6776 | 3247 | (0, import_data5.register)(store); |
| 6777 | 3248 | unlock(store).registerPrivateSelectors(private_selectors_exports); |
| 6778 | 3249 | unlock(store).registerPrivateActions(private_actions_exports); |
| 6779 | 3250 | |
| 6780 | - // node_modules/uuid/dist/esm-browser/rng.js | |
| 6781 | - var getRandomValues; | |
| 6782 | - var rnds8 = new Uint8Array(16); | |
| 6783 | - function rng() { | |
| 6784 | - if (!getRandomValues) { | |
| 6785 | - getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto); | |
| 6786 | - if (!getRandomValues) { | |
| 6787 | - throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported"); | |
| 6788 | - } | |
| 6789 | - } | |
| 6790 | - return getRandomValues(rnds8); | |
| 6791 | - } | |
| 6792 | - | |
| 6793 | - // node_modules/uuid/dist/esm-browser/stringify.js | |
| 3251 | + // node_modules/uuid/dist/stringify.js | |
| 6794 | 3252 | var byteToHex = []; |
| 6795 | - for (let i2 = 0; i2 < 256; ++i2) { | |
| 6796 | - byteToHex.push((i2 + 256).toString(16).slice(1)); | |
| 3253 | + for (let i = 0; i < 256; ++i) { | |
| 3254 | + byteToHex.push((i + 256).toString(16).slice(1)); | |
| 6797 | 3255 | } |
| 6798 | 3256 | function unsafeStringify(arr, offset = 0) { |
| 6799 | - return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]; | |
| 3257 | + return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); | |
| 6800 | 3258 | } |
| 6801 | 3259 | |
| 6802 | - // node_modules/uuid/dist/esm-browser/native.js | |
| 6803 | - var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto); | |
| 6804 | - var native_default = { | |
| 6805 | - randomUUID | |
| 6806 | - }; | |
| 3260 | + // node_modules/uuid/dist/rng.js | |
| 3261 | + var rnds8 = new Uint8Array(16); | |
| 3262 | + function rng() { | |
| 3263 | + return crypto.getRandomValues(rnds8); | |
| 3264 | + } | |
| 6807 | 3265 | |
| 6808 | - // node_modules/uuid/dist/esm-browser/v4.js | |
| 3266 | + // node_modules/uuid/dist/v4.js | |
| 6809 | 3267 | function v4(options, buf, offset) { |
| 6810 | - if (native_default.randomUUID && !buf && !options) { | |
| 6811 | - return native_default.randomUUID(); | |
| 3268 | + if (!buf && !options && crypto.randomUUID) { | |
| 3269 | + return crypto.randomUUID(); | |
| 6812 | 3270 | } |
| 3271 | + return _v4(options, buf, offset); | |
| 3272 | + } | |
| 3273 | + function _v4(options, buf, offset) { | |
| 6813 | 3274 | options = options || {}; |
| 6814 | - const rnds = options.random || (options.rng || rng)(); | |
| 3275 | + const rnds = options.random ?? options.rng?.() ?? rng(); | |
| 3276 | + if (rnds.length < 16) { | |
| 3277 | + throw new Error("Random bytes length must be >= 16"); | |
| 3278 | + } | |
| 6815 | 3279 | rnds[6] = rnds[6] & 15 | 64; |
| 6816 | 3280 | rnds[8] = rnds[8] & 63 | 128; |
| 6817 | 3281 | if (buf) { |
| 6818 | 3282 | offset = offset || 0; |
| 6819 | - for (let i2 = 0; i2 < 16; ++i2) { | |
| 6820 | - buf[offset + i2] = rnds[i2]; | |
| 3283 | + if (offset < 0 || offset + 16 > buf.length) { | |
| 3284 | + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); | |
| 6821 | 3285 | } |
| 3286 | + for (let i = 0; i < 16; ++i) { | |
| 3287 | + buf[offset + i] = rnds[i]; | |
| 3288 | + } | |
| 6822 | 3289 | return buf; |
| 6823 | 3290 | } |
| 6824 | 3291 | return unsafeStringify(rnds); |
| 6825 | 3292 | } |
| @@ -6826,9 +3293,13 @@ | ||
| 6826 | 3293 | var v4_default = v4; |
| 6827 | 3294 | |
| 6828 | 3295 | // packages/blocks/build-module/api/factory.mjs |
| 6829 | 3296 | var import_hooks2 = __toESM(require_hooks(), 1); |
| 6830 | - function createBlock(name, attributes = {}, innerBlocks = []) { | |
| 3297 | + var import_deprecated6 = __toESM(require_deprecated(), 1); | |
| 3298 | + var import_warning3 = __toESM(require_warning(), 1); | |
| 3299 | + var isBlockTypeTransform = (transform) => transform?.type === "block"; | |
| 3300 | + var getBlockTypeWithTransformMetadata = (blockType, transform) => transform.variationName ? { ...blockType, variationName: transform.variationName } : blockType; | |
| 3301 | + function createBlock(name, attributes = {}, innerBlocks = [], innerContent) { | |
| 6831 | 3302 | if (!isBlockRegistered(name)) { |
| 6832 | 3303 | return createBlock("core/missing", { |
| 6833 | 3304 | originalName: name, |
| 6834 | 3305 | originalContent: "", |
| @@ -6834,14 +3305,11 @@ | ||
| 6834 | 3305 | originalContent: "", |
| 6835 | 3306 | originalUndelimitedContent: "" |
| 6836 | 3307 | }); |
| 6837 | 3308 | } |
| 6838 | - const sanitizedAttributes = __experimentalSanitizeBlockAttributes( | |
| 6839 | - name, | |
| 6840 | - attributes | |
| 6841 | - ); | |
| 3309 | + const sanitizedAttributes = sanitizeBlockAttributes(name, attributes); | |
| 6842 | 3310 | const clientId = v4_default(); |
| 6843 | - return { | |
| 3311 | + const block = { | |
| 6844 | 3312 | clientId, |
| 6845 | 3313 | name, |
| 6846 | 3314 | isValid: true, |
| 6847 | 3315 | attributes: sanitizedAttributes, |
| @@ -6846,8 +3314,18 @@ | ||
| 6846 | 3314 | isValid: true, |
| 6847 | 3315 | attributes: sanitizedAttributes, |
| 6848 | 3316 | innerBlocks |
| 6849 | 3317 | }; |
| 3318 | + if (innerContent) { | |
| 3319 | + if (name === "core/html") { | |
| 3320 | + block.innerContent = innerContent; | |
| 3321 | + } else { | |
| 3322 | + (0, import_warning3.default)( | |
| 3323 | + `The innerContent argument passed to createBlock for the "${name}" block was ignored. Only the Custom HTML block stores static inner content.` | |
| 3324 | + ); | |
| 3325 | + } | |
| 3326 | + } | |
| 3327 | + return block; | |
| 6850 | 3328 | } |
| 6851 | 3329 | function createBlocksFromInnerBlocksTemplate(innerBlocksOrTemplate = []) { |
| 6852 | 3330 | return innerBlocksOrTemplate.map((innerBlock) => { |
| 6853 | 3331 | const innerBlockTemplate = Array.isArray(innerBlock) ? innerBlock : [ |
| @@ -6852,21 +3330,23 @@ | ||
| 6852 | 3330 | return innerBlocksOrTemplate.map((innerBlock) => { |
| 6853 | 3331 | const innerBlockTemplate = Array.isArray(innerBlock) ? innerBlock : [ |
| 6854 | 3332 | innerBlock.name, |
| 6855 | 3333 | innerBlock.attributes, |
| 6856 | - innerBlock.innerBlocks | |
| 3334 | + innerBlock.innerBlocks, | |
| 3335 | + innerBlock.innerContent | |
| 6857 | 3336 | ]; |
| 6858 | - const [name, attributes, innerBlocks = []] = innerBlockTemplate; | |
| 3337 | + const [name, attributes, innerBlocks = [], innerContent] = innerBlockTemplate; | |
| 6859 | 3338 | return createBlock( |
| 6860 | 3339 | name, |
| 6861 | 3340 | attributes, |
| 6862 | 3341 | createBlocksFromInnerBlocksTemplate( |
| 6863 | 3342 | innerBlocks |
| 6864 | - ) | |
| 3343 | + ), | |
| 3344 | + innerContent | |
| 6865 | 3345 | ); |
| 6866 | 3346 | }); |
| 6867 | 3347 | } |
| 6868 | - function __experimentalCloneSanitizedBlock(block, mergeAttributes = {}, newInnerBlocks) { | |
| 3348 | + function cloneSanitizedBlock(block, mergeAttributes = {}, newInnerBlocks) { | |
| 6869 | 3349 | const { name } = block; |
| 6870 | 3350 | if (!isBlockRegistered(name)) { |
| 6871 | 3351 | return createBlock("core/missing", { |
| 6872 | 3352 | originalName: name, |
| @@ -6874,9 +3354,9 @@ | ||
| 6874 | 3354 | originalUndelimitedContent: "" |
| 6875 | 3355 | }); |
| 6876 | 3356 | } |
| 6877 | 3357 | const clientId = v4_default(); |
| 6878 | - const sanitizedAttributes = __experimentalSanitizeBlockAttributes(name, { | |
| 3358 | + const sanitizedAttributes = sanitizeBlockAttributes(name, { | |
| 6879 | 3359 | ...block.attributes, |
| 6880 | 3360 | ...mergeAttributes |
| 6881 | 3361 | }); |
| 6882 | 3362 | return { |
| @@ -6883,12 +3363,19 @@ | ||
| 6883 | 3363 | ...block, |
| 6884 | 3364 | clientId, |
| 6885 | 3365 | attributes: sanitizedAttributes, |
| 6886 | 3366 | innerBlocks: newInnerBlocks || block.innerBlocks.map( |
| 6887 | - (innerBlock) => __experimentalCloneSanitizedBlock(innerBlock) | |
| 3367 | + (innerBlock) => cloneSanitizedBlock(innerBlock) | |
| 6888 | 3368 | ) |
| 6889 | 3369 | }; |
| 6890 | 3370 | } |
| 3371 | + function __experimentalCloneSanitizedBlock(block, mergeAttributes = {}, newInnerBlocks) { | |
| 3372 | + (0, import_deprecated6.default)("__experimentalCloneSanitizedBlock", { | |
| 3373 | + since: "7.1", | |
| 3374 | + alternative: "cloneSanitizedBlock" | |
| 3375 | + }); | |
| 3376 | + return cloneSanitizedBlock(block, mergeAttributes, newInnerBlocks); | |
| 3377 | + } | |
| 6891 | 3378 | function cloneBlock(block, mergeAttributes = {}, newInnerBlocks) { |
| 6892 | 3379 | const clientId = v4_default(); |
| 6893 | 3380 | return { |
| 6894 | 3381 | ...block, |
| @@ -6912,12 +3399,8 @@ | ||
| 6912 | 3399 | } |
| 6913 | 3400 | if (!isWildcardBlockTransform(transform) && !blocks.every((block) => block.name === firstBlockName)) { |
| 6914 | 3401 | return false; |
| 6915 | 3402 | } |
| 6916 | - const isBlockType = transform.type === "block"; | |
| 6917 | - if (!isBlockType) { | |
| 6918 | - return false; | |
| 6919 | - } | |
| 6920 | 3403 | const sourceBlock = blocks[0]; |
| 6921 | 3404 | const hasMatchingName = direction !== "from" || transform.blocks.indexOf(sourceBlock.name) !== -1 || isWildcardBlockTransform(transform); |
| 6922 | 3405 | if (!hasMatchingName) { |
| 6923 | 3406 | return false; |
| @@ -6934,18 +3417,16 @@ | ||
| 6934 | 3417 | if (!blocks.length) { |
| 6935 | 3418 | return []; |
| 6936 | 3419 | } |
| 6937 | 3420 | const allBlockTypes = getBlockTypes(); |
| 6938 | - const blockTypesWithPossibleFromTransforms = allBlockTypes.filter( | |
| 3421 | + const blockTypesWithPossibleFromTransforms = allBlockTypes.flatMap( | |
| 6939 | 3422 | (blockType) => { |
| 6940 | 3423 | const fromTransforms = getBlockTransforms("from", blockType.name); |
| 6941 | - return !!findTransform(fromTransforms, (transform) => { | |
| 6942 | - return isPossibleTransformForSource( | |
| 6943 | - transform, | |
| 6944 | - "from", | |
| 6945 | - blocks | |
| 6946 | - ); | |
| 6947 | - }); | |
| 3424 | + return fromTransforms.filter(isBlockTypeTransform).filter( | |
| 3425 | + (transform) => isPossibleTransformForSource(transform, "from", blocks) | |
| 3426 | + ).map( | |
| 3427 | + (transform) => getBlockTypeWithTransformMetadata(blockType, transform) | |
| 3428 | + ); | |
| 6948 | 3429 | } |
| 6949 | 3430 | ); |
| 6950 | 3431 | return blockTypesWithPossibleFromTransforms; |
| 6951 | 3432 | }; |
| @@ -6955,15 +3436,22 @@ | ||
| 6955 | 3436 | } |
| 6956 | 3437 | const sourceBlock = blocks[0]; |
| 6957 | 3438 | const blockType = getBlockType(sourceBlock.name); |
| 6958 | 3439 | const transformsTo = blockType ? getBlockTransforms("to", blockType.name) : []; |
| 6959 | - const possibleTransforms = transformsTo.filter((transform) => { | |
| 6960 | - return transform && isPossibleTransformForSource(transform, "to", blocks); | |
| 6961 | - }); | |
| 6962 | - const blockNames = possibleTransforms.map((transformation) => transformation.blocks).flat(); | |
| 6963 | - return blockNames.filter((name) => !!name).map(getBlockType).filter((bt) => !!bt); | |
| 3440 | + const possibleTransforms = transformsTo.filter(isBlockTypeTransform).filter( | |
| 3441 | + (transform) => isPossibleTransformForSource(transform, "to", blocks) | |
| 3442 | + ); | |
| 3443 | + return possibleTransforms.flatMap((transformation) => { | |
| 3444 | + return (transformation.blocks ?? []).map((name) => { | |
| 3445 | + const transformedBlockType = getBlockType(name); | |
| 3446 | + return transformedBlockType ? getBlockTypeWithTransformMetadata( | |
| 3447 | + transformedBlockType, | |
| 3448 | + transformation | |
| 3449 | + ) : void 0; | |
| 3450 | + }); | |
| 3451 | + }).filter((bt2) => !!bt2); | |
| 6964 | 3452 | }; |
| 6965 | - var isWildcardBlockTransform = (t3) => !!t3 && t3.type === "block" && Array.isArray(t3.blocks) && t3.blocks.includes("*"); | |
| 3453 | + var isWildcardBlockTransform = (t2) => isBlockTypeTransform(t2) && Array.isArray(t2.blocks) && t2.blocks.includes("*"); | |
| 6966 | 3454 | var isContainerGroupBlock = (name) => name === getGroupingBlockName(); |
| 6967 | 3455 | function getPossibleBlockTransformations(blocks) { |
| 6968 | 3456 | if (!blocks.length) { |
| 6969 | 3457 | return []; |
| @@ -6969,23 +3457,28 @@ | ||
| 6969 | 3457 | return []; |
| 6970 | 3458 | } |
| 6971 | 3459 | const blockTypesForFromTransforms = getBlockTypesForPossibleFromTransforms(blocks); |
| 6972 | 3460 | const blockTypesForToTransforms = getBlockTypesForPossibleToTransforms(blocks); |
| 6973 | - return [ | |
| 6974 | - .../* @__PURE__ */ new Set([ | |
| 6975 | - ...blockTypesForFromTransforms, | |
| 6976 | - ...blockTypesForToTransforms | |
| 6977 | - ]) | |
| 6978 | - ]; | |
| 3461 | + const blockTypesByNameAndVariation = /* @__PURE__ */ new Map(); | |
| 3462 | + for (const blockType of [ | |
| 3463 | + ...blockTypesForFromTransforms, | |
| 3464 | + ...blockTypesForToTransforms | |
| 3465 | + ]) { | |
| 3466 | + const key = blockType.variationName ? `${blockType.name}/${blockType.variationName}` : blockType.name; | |
| 3467 | + if (!blockTypesByNameAndVariation.has(key)) { | |
| 3468 | + blockTypesByNameAndVariation.set(key, blockType); | |
| 3469 | + } | |
| 3470 | + } | |
| 3471 | + return [...blockTypesByNameAndVariation.values()]; | |
| 6979 | 3472 | } |
| 6980 | 3473 | function findTransform(transforms, predicate) { |
| 6981 | 3474 | const hooks = (0, import_hooks2.createHooks)(); |
| 6982 | - for (let i2 = 0; i2 < transforms.length; i2++) { | |
| 6983 | - const candidate = transforms[i2]; | |
| 3475 | + for (let i = 0; i < transforms.length; i++) { | |
| 3476 | + const candidate = transforms[i]; | |
| 6984 | 3477 | if (predicate(candidate)) { |
| 6985 | 3478 | hooks.addFilter( |
| 6986 | 3479 | "transform", |
| 6987 | - "transform/" + i2.toString(), | |
| 3480 | + "transform/" + i.toString(), | |
| 6988 | 3481 | (result) => result ? result : candidate, |
| 6989 | 3482 | candidate.priority |
| 6990 | 3483 | ); |
| 6991 | 3484 | } |
| @@ -6996,36 +3489,15 @@ | ||
| 6996 | 3489 | if (blockTypeOrName === void 0) { |
| 6997 | 3490 | return getBlockTypes().map(({ name }) => getBlockTransforms(direction, name)).flat(); |
| 6998 | 3491 | } |
| 6999 | 3492 | const blockType = normalizeBlockType(blockTypeOrName); |
| 7000 | - const { name: blockName, transforms } = blockType || {}; | |
| 7001 | - if (!transforms || !Array.isArray(transforms[direction])) { | |
| 3493 | + const directionTransforms = blockType?.transforms?.[direction]; | |
| 3494 | + if (!blockType || !Array.isArray(directionTransforms)) { | |
| 7002 | 3495 | return []; |
| 7003 | 3496 | } |
| 7004 | - const usingMobileTransformations = transforms.supportedMobileTransforms && Array.isArray(transforms.supportedMobileTransforms); | |
| 7005 | - const filteredTransforms = usingMobileTransformations ? transforms[direction].filter((t3) => { | |
| 7006 | - if (t3.type === "raw") { | |
| 7007 | - return true; | |
| 7008 | - } | |
| 7009 | - if (t3.type === "prefix") { | |
| 7010 | - return true; | |
| 7011 | - } | |
| 7012 | - if (!t3.blocks || !t3.blocks.length) { | |
| 7013 | - return false; | |
| 7014 | - } | |
| 7015 | - if (isWildcardBlockTransform(t3)) { | |
| 7016 | - return true; | |
| 7017 | - } | |
| 7018 | - return t3.blocks.every( | |
| 7019 | - (transformBlockName) => transforms.supportedMobileTransforms.includes( | |
| 7020 | - transformBlockName | |
| 7021 | - ) | |
| 7022 | - ); | |
| 7023 | - }) : transforms[direction]; | |
| 7024 | - return filteredTransforms.map((transform) => ({ | |
| 3497 | + return directionTransforms.map((transform) => ({ | |
| 7025 | 3498 | ...transform, |
| 7026 | - blockName, | |
| 7027 | - usingMobileTransformations | |
| 3499 | + blockName: blockType.name | |
| 7028 | 3500 | })); |
| 7029 | 3501 | } |
| 7030 | 3502 | function maybeCheckTransformIsMatch(transform, blocks) { |
| 7031 | 3503 | if (typeof transform.isMatch !== "function") { |
| @@ -7035,21 +3507,26 @@ | ||
| 7035 | 3507 | const attributes = transform.isMultiBlock ? blocks.map((block2) => block2.attributes) : sourceBlock.attributes; |
| 7036 | 3508 | const block = transform.isMultiBlock ? blocks : sourceBlock; |
| 7037 | 3509 | return transform.isMatch(attributes, block); |
| 7038 | 3510 | } |
| 7039 | - function switchToBlockType(blocks, name) { | |
| 3511 | + function switchToBlockType(blocks, name, variationName) { | |
| 7040 | 3512 | const blocksArray = Array.isArray(blocks) ? blocks : [blocks]; |
| 7041 | 3513 | const isMultiBlock = blocksArray.length > 1; |
| 7042 | 3514 | const firstBlock = blocksArray[0]; |
| 7043 | 3515 | const sourceName = firstBlock.name; |
| 7044 | - const transformationsFrom = getBlockTransforms("from", name); | |
| 7045 | - const transformationsTo = getBlockTransforms("to", sourceName); | |
| 3516 | + const transformationsFrom = getBlockTransforms("from", name).filter( | |
| 3517 | + isBlockTypeTransform | |
| 3518 | + ); | |
| 3519 | + const transformationsTo = getBlockTransforms("to", sourceName).filter( | |
| 3520 | + isBlockTypeTransform | |
| 3521 | + ); | |
| 3522 | + const isMatchingVariation = (t2) => variationName ? t2.variationName === variationName : !t2.variationName; | |
| 7046 | 3523 | const transformation = findTransform( |
| 7047 | 3524 | transformationsTo, |
| 7048 | - (t3) => t3.type === "block" && (isWildcardBlockTransform(t3) || t3.blocks.indexOf(name) !== -1) && (!isMultiBlock || !!t3.isMultiBlock) && maybeCheckTransformIsMatch(t3, blocksArray) | |
| 3525 | + (t2) => isMatchingVariation(t2) && (isWildcardBlockTransform(t2) || t2.blocks.indexOf(name) !== -1) && (!isMultiBlock || !!t2.isMultiBlock) && maybeCheckTransformIsMatch(t2, blocksArray) | |
| 7049 | 3526 | ) || findTransform( |
| 7050 | 3527 | transformationsFrom, |
| 7051 | - (t3) => t3.type === "block" && (isWildcardBlockTransform(t3) || t3.blocks.indexOf(sourceName) !== -1) && (!isMultiBlock || !!t3.isMultiBlock) && maybeCheckTransformIsMatch(t3, blocksArray) | |
| 3528 | + (t2) => isMatchingVariation(t2) && (isWildcardBlockTransform(t2) || t2.blocks.indexOf(sourceName) !== -1) && (!isMultiBlock || !!t2.isMultiBlock) && maybeCheckTransformIsMatch(t2, blocksArray) | |
| 7052 | 3529 | ); |
| 7053 | 3530 | if (!transformation) { |
| 7054 | 3531 | return null; |
| 7055 | 3532 | } |
| @@ -7101,9 +3578,10 @@ | ||
| 7101 | 3578 | name, |
| 7102 | 3579 | example.attributes, |
| 7103 | 3580 | (example.innerBlocks ?? []).map( |
| 7104 | 3581 | (innerBlock) => getBlockFromExample(innerBlock.name, innerBlock) |
| 7105 | - ) | |
| 3582 | + ), | |
| 3583 | + example.innerContent | |
| 7106 | 3584 | ); |
| 7107 | 3585 | |
| 7108 | 3586 | // packages/blocks/build-module/api/parser/index.mjs |
| 7109 | 3587 | var import_block_serialization_default_parser = __toESM(require_block_serialization_default_parser(), 1); |
| @@ -7113,9 +3591,9 @@ | ||
| 7113 | 3591 | var import_element2 = __toESM(require_element(), 1); |
| 7114 | 3592 | var import_hooks3 = __toESM(require_hooks(), 1); |
| 7115 | 3593 | var import_is_shallow_equal = __toESM(require_is_shallow_equal(), 1); |
| 7116 | 3594 | var import_autop = __toESM(require_autop(), 1); |
| 7117 | - var import_deprecated6 = __toESM(require_deprecated(), 1); | |
| 3595 | + var import_deprecated7 = __toESM(require_deprecated(), 1); | |
| 7118 | 3596 | |
| 7119 | 3597 | // packages/blocks/build-module/api/parser/serialize-raw-block.mjs |
| 7120 | 3598 | function serializeRawBlock(rawBlock, options = {}) { |
| 7121 | 3599 | const { isCommentDelimited = true } = options; |
| @@ -7236,9 +3714,9 @@ | ||
| 7236 | 3714 | if (attributeSchema.role === "local") { |
| 7237 | 3715 | return accumulator; |
| 7238 | 3716 | } |
| 7239 | 3717 | if (attributeSchema.__experimentalRole === "local") { |
| 7240 | - (0, import_deprecated6.default)("__experimentalRole attribute", { | |
| 3718 | + (0, import_deprecated7.default)("__experimentalRole attribute", { | |
| 7241 | 3719 | since: "6.7", |
| 7242 | 3720 | version: "6.8", |
| 7243 | 3721 | alternative: "role attribute", |
| 7244 | 3722 | hint: `Check the block.json of the ${blockType?.name} block.` |
| @@ -7256,9 +3734,28 @@ | ||
| 7256 | 3734 | } |
| 7257 | 3735 | function serializeAttributes(attributes) { |
| 7258 | 3736 | return JSON.stringify(attributes).replaceAll("\\\\", "\\u005c").replaceAll("--", "\\u002d\\u002d").replaceAll("<", "\\u003c").replaceAll(">", "\\u003e").replaceAll("&", "\\u0026").replaceAll('\\"', "\\u0022"); |
| 7259 | 3737 | } |
| 3738 | + function serializeInnerContent(innerContent, innerBlocks) { | |
| 3739 | + let childIndex = 0; | |
| 3740 | + const parts = innerContent.map((item) => { | |
| 3741 | + if (item !== null) { | |
| 3742 | + return item; | |
| 3743 | + } | |
| 3744 | + const innerBlock = innerBlocks[childIndex++]; | |
| 3745 | + return innerBlock ? serializeBlock(innerBlock, { isInnerBlocks: true }) : ""; | |
| 3746 | + }); | |
| 3747 | + for (; childIndex < innerBlocks.length; childIndex++) { | |
| 3748 | + parts.push( | |
| 3749 | + serializeBlock(innerBlocks[childIndex], { isInnerBlocks: true }) | |
| 3750 | + ); | |
| 3751 | + } | |
| 3752 | + return parts.join("").trim(); | |
| 3753 | + } | |
| 7260 | 3754 | function getBlockInnerHTML(block) { |
| 3755 | + if (block.innerContent && block.name === "core/html") { | |
| 3756 | + return serializeInnerContent(block.innerContent, block.innerBlocks); | |
| 3757 | + } | |
| 7261 | 3758 | let saveContent = block.originalContent ?? ""; |
| 7262 | 3759 | if (block.isValid || block.innerBlocks.length) { |
| 7263 | 3760 | try { |
| 7264 | 3761 | saveContent = getSaveContent( |
| @@ -7953,10 +4450,10 @@ | ||
| 7953 | 4450 | } |
| 7954 | 4451 | if (arguments.length === 0) { |
| 7955 | 4452 | return token; |
| 7956 | 4453 | } |
| 7957 | - for (var i2 = 0; i2 < arguments.length; i2++) { | |
| 7958 | - if (token.type === arguments[i2]) { | |
| 4454 | + for (var i = 0; i < arguments.length; i++) { | |
| 4455 | + if (token.type === arguments[i]) { | |
| 7959 | 4456 | return token; |
| 7960 | 4457 | } |
| 7961 | 4458 | } |
| 7962 | 4459 | throw new Error("token type was unexpectedly " + token.type); |
| @@ -8071,10 +4568,10 @@ | ||
| 8071 | 4568 | })() |
| 8072 | 4569 | ); |
| 8073 | 4570 | |
| 8074 | 4571 | // packages/blocks/build-module/api/validation/index.mjs |
| 8075 | - var import_es6 = __toESM(require_es6(), 1); | |
| 8076 | - var import_deprecated7 = __toESM(require_deprecated(), 1); | |
| 4572 | + var import_es62 = __toESM(require_es6(), 1); | |
| 4573 | + var import_deprecated8 = __toESM(require_deprecated(), 1); | |
| 8077 | 4574 | var import_html_entities = __toESM(require_html_entities(), 1); |
| 8078 | 4575 | |
| 8079 | 4576 | // packages/blocks/build-module/api/validation/logger.mjs |
| 8080 | 4577 | function createLogger() { |
| @@ -8107,9 +4604,9 @@ | ||
| 8107 | 4604 | }; |
| 8108 | 4605 | } |
| 8109 | 4606 | |
| 8110 | 4607 | // packages/blocks/build-module/api/validation/index.mjs |
| 8111 | - var identity = (x2) => x2; | |
| 4608 | + var identity = (x3) => x3; | |
| 8112 | 4609 | var REGEXP_WHITESPACE = /[\t\n\r\v\f ]+/g; |
| 8113 | 4610 | var REGEXP_ONLY_WHITESPACE = /^[\t\n\r\v\f ]*$/; |
| 8114 | 4611 | var REGEXP_STYLE_URL_TYPE = /^url\s*\(['"\s]*(.*?)['"\s]*\)$/; |
| 8115 | 4612 | var BOOLEAN_ATTRIBUTES = [ |
| @@ -8210,10 +4707,10 @@ | ||
| 8210 | 4707 | } |
| 8211 | 4708 | function isEquivalentTextTokens(actual, expected, logger = createLogger()) { |
| 8212 | 4709 | let actualChars = actual.chars; |
| 8213 | 4710 | let expectedChars = expected.chars; |
| 8214 | - for (let i2 = 0; i2 < TEXT_NORMALIZATIONS.length; i2++) { | |
| 8215 | - const normalize = TEXT_NORMALIZATIONS[i2]; | |
| 4711 | + for (let i = 0; i < TEXT_NORMALIZATIONS.length; i++) { | |
| 4712 | + const normalize = TEXT_NORMALIZATIONS[i]; | |
| 8216 | 4713 | actualChars = normalize(actualChars); |
| 8217 | 4714 | expectedChars = normalize(expectedChars); |
| 8218 | 4715 | if (actualChars === expectedChars) { |
| 8219 | 4716 | return true; |
| @@ -8262,9 +4759,9 @@ | ||
| 8262 | 4759 | ); |
| 8263 | 4760 | return actualDiff.length === 0 && expectedDiff.length === 0; |
| 8264 | 4761 | }, |
| 8265 | 4762 | style: (actual, expected) => { |
| 8266 | - return (0, import_es6.default)( | |
| 4763 | + return (0, import_es62.default)( | |
| 8267 | 4764 | ...[actual, expected].map(getStyleProperties) |
| 8268 | 4765 | ); |
| 8269 | 4766 | }, |
| 8270 | 4767 | // For each boolean attribute, mere presence of attribute in both is enough |
| @@ -8282,13 +4779,13 @@ | ||
| 8282 | 4779 | ); |
| 8283 | 4780 | return false; |
| 8284 | 4781 | } |
| 8285 | 4782 | const expectedAttributes = {}; |
| 8286 | - for (let i2 = 0; i2 < expected.length; i2++) { | |
| 8287 | - expectedAttributes[expected[i2][0].toLowerCase()] = expected[i2][1]; | |
| 4783 | + for (let i = 0; i < expected.length; i++) { | |
| 4784 | + expectedAttributes[expected[i][0].toLowerCase()] = expected[i][1]; | |
| 8288 | 4785 | } |
| 8289 | - for (let i2 = 0; i2 < actual.length; i2++) { | |
| 8290 | - const [name, actualValue] = actual[i2]; | |
| 4786 | + for (let i = 0; i < actual.length; i++) { | |
| 4787 | + const [name, actualValue] = actual[i]; | |
| 8291 | 4788 | const nameLower = name.toLowerCase(); |
| 8292 | 4789 | if (!expectedAttributes.hasOwnProperty(nameLower)) { |
| 8293 | 4790 | logger.warning("Encountered unexpected attribute `%s`.", name); |
| 8294 | 4791 | return false; |
| @@ -8451,9 +4948,9 @@ | ||
| 8451 | 4948 | } |
| 8452 | 4949 | return [isValid, logger.getItems()]; |
| 8453 | 4950 | } |
| 8454 | 4951 | function isValidBlockContent(blockTypeOrName, attributes, originalBlockContent) { |
| 8455 | - (0, import_deprecated7.default)("isValidBlockContent introduces opportunity for data loss", { | |
| 4952 | + (0, import_deprecated8.default)("isValidBlockContent introduces opportunity for data loss", { | |
| 8456 | 4953 | since: "12.6", |
| 8457 | 4954 | plugin: "Gutenberg", |
| 8458 | 4955 | alternative: "validateBlock" |
| 8459 | 4956 | }); |
| @@ -8470,8 +4967,34 @@ | ||
| 8470 | 4967 | return isValid; |
| 8471 | 4968 | } |
| 8472 | 4969 | |
| 8473 | 4970 | // packages/blocks/build-module/api/parser/convert-legacy-block.mjs |
| 4971 | + function normalizeStyleStateAliases(style) { | |
| 4972 | + if (false) { | |
| 4973 | + return style; | |
| 4974 | + } | |
| 4975 | + if (!style || typeof style !== "object" || Array.isArray(style)) { | |
| 4976 | + return style; | |
| 4977 | + } | |
| 4978 | + let normalizedStyle = style; | |
| 4979 | + const viewportAliases = { | |
| 4980 | + "@mobile": "mobile", | |
| 4981 | + "@tablet": "tablet" | |
| 4982 | + }; | |
| 4983 | + Object.entries(viewportAliases).forEach(([state, legacyState]) => { | |
| 4984 | + if (!Object.hasOwn(normalizedStyle, legacyState)) { | |
| 4985 | + return; | |
| 4986 | + } | |
| 4987 | + if (normalizedStyle === style) { | |
| 4988 | + normalizedStyle = { ...normalizedStyle }; | |
| 4989 | + } | |
| 4990 | + if (!Object.hasOwn(normalizedStyle, state)) { | |
| 4991 | + normalizedStyle[state] = normalizedStyle[legacyState]; | |
| 4992 | + } | |
| 4993 | + delete normalizedStyle[legacyState]; | |
| 4994 | + }); | |
| 4995 | + return normalizedStyle; | |
| 4996 | + } | |
| 8474 | 4997 | function convertLegacyBlockNameAndAttributes(name, attributes) { |
| 8475 | 4998 | const newAttributes = { ...attributes }; |
| 8476 | 4999 | if ("core/cover-image" === name) { |
| 8477 | 5000 | name = "core/cover"; |
| @@ -8484,13 +5007,13 @@ | ||
| 8484 | 5007 | name = "core/social-link"; |
| 8485 | 5008 | } |
| 8486 | 5009 | if (name && name.indexOf("core-embed/") === 0) { |
| 8487 | 5010 | const providerSlug = name.substring(11); |
| 8488 | - const deprecated12 = { | |
| 5011 | + const deprecated13 = { | |
| 8489 | 5012 | speaker: "speaker-deck", |
| 8490 | 5013 | polldaddy: "crowdsignal" |
| 8491 | 5014 | }; |
| 8492 | - newAttributes.providerNameSlug = providerSlug in deprecated12 ? deprecated12[providerSlug] : providerSlug; | |
| 5015 | + newAttributes.providerNameSlug = providerSlug in deprecated13 ? deprecated13[providerSlug] : providerSlug; | |
| 8493 | 5016 | if (!["amazon-kindle", "wordpress"].includes(providerSlug)) { |
| 8494 | 5017 | newAttributes.responsive = true; |
| 8495 | 5018 | } |
| 8496 | 5019 | name = "core/embed"; |
| @@ -8546,8 +5069,12 @@ | ||
| 8546 | 5069 | rowSpan: isNaN(rowSpanNumber) ? void 0 : rowSpanNumber |
| 8547 | 5070 | } |
| 8548 | 5071 | }; |
| 8549 | 5072 | } |
| 5073 | + const normalizedStyle = normalizeStyleStateAliases(newAttributes.style); | |
| 5074 | + if (normalizedStyle !== newAttributes.style) { | |
| 5075 | + newAttributes.style = normalizedStyle; | |
| 5076 | + } | |
| 8550 | 5077 | return [name, newAttributes]; |
| 8551 | 5078 | } |
| 8552 | 5079 | |
| 8553 | 5080 | // node_modules/hpq/es/get-path.js |
| @@ -8581,9 +5108,9 @@ | ||
| 8581 | 5108 | var doc = getDocument(); |
| 8582 | 5109 | doc.body.innerHTML = source; |
| 8583 | 5110 | source = doc.body; |
| 8584 | 5111 | } |
| 8585 | - if ("function" === typeof matchers) { | |
| 5112 | + if (typeof matchers === "function") { | |
| 8586 | 5113 | return matchers(source); |
| 8587 | 5114 | } |
| 8588 | 5115 | if (Object !== matchers.constructor) { |
| 8589 | 5116 | return; |
| @@ -8588,16 +5115,22 @@ | ||
| 8588 | 5115 | if (Object !== matchers.constructor) { |
| 8589 | 5116 | return; |
| 8590 | 5117 | } |
| 8591 | 5118 | return Object.keys(matchers).reduce(function(memo, key) { |
| 8592 | - memo[key] = parse(source, matchers[key]); | |
| 5119 | + var inner = matchers[key]; | |
| 5120 | + memo[key] = parse(source, inner); | |
| 8593 | 5121 | return memo; |
| 8594 | 5122 | }, {}); |
| 8595 | 5123 | } |
| 8596 | - function prop(selector, name) { | |
| 5124 | + function prop(arg1, arg2) { | |
| 5125 | + var name; | |
| 5126 | + var selector; | |
| 8597 | 5127 | if (1 === arguments.length) { |
| 8598 | - name = selector; | |
| 5128 | + name = arg1; | |
| 8599 | 5129 | selector = void 0; |
| 5130 | + } else { | |
| 5131 | + name = arg2; | |
| 5132 | + selector = arg1; | |
| 8600 | 5133 | } |
| 8601 | 5134 | return function(node) { |
| 8602 | 5135 | var match = node; |
| 8603 | 5136 | if (selector) { |
| @@ -8607,16 +5140,21 @@ | ||
| 8607 | 5140 | return getPath(match, name); |
| 8608 | 5141 | } |
| 8609 | 5142 | }; |
| 8610 | 5143 | } |
| 8611 | - function attr(selector, name) { | |
| 5144 | + function attr(arg1, arg2) { | |
| 5145 | + var name; | |
| 5146 | + var selector; | |
| 8612 | 5147 | if (1 === arguments.length) { |
| 8613 | - name = selector; | |
| 5148 | + name = arg1; | |
| 8614 | 5149 | selector = void 0; |
| 5150 | + } else { | |
| 5151 | + name = arg2; | |
| 5152 | + selector = arg1; | |
| 8615 | 5153 | } |
| 8616 | 5154 | return function(node) { |
| 8617 | 5155 | var attributes = prop(selector, "attributes")(node); |
| 8618 | - if (attributes && attributes.hasOwnProperty(name)) { | |
| 5156 | + if (attributes && Object.prototype.hasOwnProperty.call(attributes, name)) { | |
| 8619 | 5157 | return attributes[name].value; |
| 8620 | 5158 | } |
| 8621 | 5159 | }; |
| 8622 | 5160 | } |
| @@ -8638,16 +5176,16 @@ | ||
| 8638 | 5176 | var head; |
| 8639 | 5177 | var tail; |
| 8640 | 5178 | options = options || {}; |
| 8641 | 5179 | function memoized() { |
| 8642 | - var node = head, len = arguments.length, args, i2; | |
| 5180 | + var node = head, len = arguments.length, args, i; | |
| 8643 | 5181 | searchCache: while (node) { |
| 8644 | 5182 | if (node.args.length !== arguments.length) { |
| 8645 | 5183 | node = node.next; |
| 8646 | 5184 | continue; |
| 8647 | 5185 | } |
| 8648 | - for (i2 = 0; i2 < len; i2++) { | |
| 8649 | - if (node.args[i2] !== arguments[i2]) { | |
| 5186 | + for (i = 0; i < len; i++) { | |
| 5187 | + if (node.args[i] !== arguments[i]) { | |
| 8650 | 5188 | node = node.next; |
| 8651 | 5189 | continue searchCache; |
| 8652 | 5190 | } |
| 8653 | 5191 | } |
| @@ -8666,10 +5204,10 @@ | ||
| 8666 | 5204 | } |
| 8667 | 5205 | return node.val; |
| 8668 | 5206 | } |
| 8669 | 5207 | args = new Array(len); |
| 8670 | - for (i2 = 0; i2 < len; i2++) { | |
| 8671 | - args[i2] = arguments[i2]; | |
| 5208 | + for (i = 0; i < len; i++) { | |
| 5209 | + args[i] = arguments[i]; | |
| 8672 | 5210 | } |
| 8673 | 5211 | node = { |
| 8674 | 5212 | args, |
| 8675 | 5213 | // Generate the result from original function |
| @@ -8707,18 +5245,18 @@ | ||
| 8707 | 5245 | // packages/blocks/build-module/api/matchers.mjs |
| 8708 | 5246 | var import_rich_text3 = __toESM(require_rich_text(), 1); |
| 8709 | 5247 | |
| 8710 | 5248 | // packages/blocks/build-module/api/node.mjs |
| 8711 | - var import_deprecated9 = __toESM(require_deprecated(), 1); | |
| 5249 | + var import_deprecated10 = __toESM(require_deprecated(), 1); | |
| 8712 | 5250 | |
| 8713 | 5251 | // packages/blocks/build-module/api/children.mjs |
| 8714 | 5252 | var import_element3 = __toESM(require_element(), 1); |
| 8715 | - var import_deprecated8 = __toESM(require_deprecated(), 1); | |
| 5253 | + var import_deprecated9 = __toESM(require_deprecated(), 1); | |
| 8716 | 5254 | function getSerializeCapableElement(children) { |
| 8717 | 5255 | return children; |
| 8718 | 5256 | } |
| 8719 | 5257 | function getChildrenArray(children) { |
| 8720 | - (0, import_deprecated8.default)("wp.blocks.children.getChildrenArray", { | |
| 5258 | + (0, import_deprecated9.default)("wp.blocks.children.getChildrenArray", { | |
| 8721 | 5259 | since: "6.1", |
| 8722 | 5260 | version: "6.3", |
| 8723 | 5261 | link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" |
| 8724 | 5262 | }); |
| @@ -8724,9 +5262,9 @@ | ||
| 8724 | 5262 | }); |
| 8725 | 5263 | return children; |
| 8726 | 5264 | } |
| 8727 | 5265 | function concat(...blockNodes) { |
| 8728 | - (0, import_deprecated8.default)("wp.blocks.children.concat", { | |
| 5266 | + (0, import_deprecated9.default)("wp.blocks.children.concat", { | |
| 8729 | 5267 | since: "6.1", |
| 8730 | 5268 | version: "6.3", |
| 8731 | 5269 | alternative: "wp.richText.concat", |
| 8732 | 5270 | link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" |
| @@ -8731,10 +5269,10 @@ | ||
| 8731 | 5269 | alternative: "wp.richText.concat", |
| 8732 | 5270 | link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" |
| 8733 | 5271 | }); |
| 8734 | 5272 | const result = []; |
| 8735 | - for (let i2 = 0; i2 < blockNodes.length; i2++) { | |
| 8736 | - const blockNode = Array.isArray(blockNodes[i2]) ? blockNodes[i2] : [blockNodes[i2]]; | |
| 5273 | + for (let i = 0; i < blockNodes.length; i++) { | |
| 5274 | + const blockNode = Array.isArray(blockNodes[i]) ? blockNodes[i] : [blockNodes[i]]; | |
| 8737 | 5275 | for (let j2 = 0; j2 < blockNode.length; j2++) { |
| 8738 | 5276 | const child = blockNode[j2]; |
| 8739 | 5277 | const canConcatToPreviousString = typeof child === "string" && typeof result[result.length - 1] === "string"; |
| 8740 | 5278 | if (canConcatToPreviousString) { |
| @@ -8746,9 +5284,9 @@ | ||
| 8746 | 5284 | } |
| 8747 | 5285 | return result; |
| 8748 | 5286 | } |
| 8749 | 5287 | function fromDOM22(domNodes) { |
| 8750 | - (0, import_deprecated8.default)("wp.blocks.children.fromDOM", { | |
| 5288 | + (0, import_deprecated9.default)("wp.blocks.children.fromDOM", { | |
| 8751 | 5289 | since: "6.1", |
| 8752 | 5290 | version: "6.3", |
| 8753 | 5291 | alternative: "wp.richText.create", |
| 8754 | 5292 | link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" |
| @@ -8753,11 +5291,11 @@ | ||
| 8753 | 5291 | alternative: "wp.richText.create", |
| 8754 | 5292 | link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" |
| 8755 | 5293 | }); |
| 8756 | 5294 | const result = []; |
| 8757 | - for (let i2 = 0; i2 < domNodes.length; i2++) { | |
| 5295 | + for (let i = 0; i < domNodes.length; i++) { | |
| 8758 | 5296 | try { |
| 8759 | - result.push(fromDOM2(domNodes[i2])); | |
| 5297 | + result.push(fromDOM2(domNodes[i])); | |
| 8760 | 5298 | } catch { |
| 8761 | 5299 | } |
| 8762 | 5300 | } |
| 8763 | 5301 | return result; |
| @@ -8762,9 +5300,9 @@ | ||
| 8762 | 5300 | } |
| 8763 | 5301 | return result; |
| 8764 | 5302 | } |
| 8765 | 5303 | function toHTML(children) { |
| 8766 | - (0, import_deprecated8.default)("wp.blocks.children.toHTML", { | |
| 5304 | + (0, import_deprecated9.default)("wp.blocks.children.toHTML", { | |
| 8767 | 5305 | since: "6.1", |
| 8768 | 5306 | version: "6.3", |
| 8769 | 5307 | alternative: "wp.richText.toHTMLString", |
| 8770 | 5308 | link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" |
| @@ -8772,9 +5310,9 @@ | ||
| 8772 | 5310 | const element = getSerializeCapableElement(children); |
| 8773 | 5311 | return (0, import_element3.renderToString)(element); |
| 8774 | 5312 | } |
| 8775 | 5313 | function matcher(selector) { |
| 8776 | - (0, import_deprecated8.default)("wp.blocks.children.matcher", { | |
| 5314 | + (0, import_deprecated9.default)("wp.blocks.children.matcher", { | |
| 8777 | 5315 | since: "6.1", |
| 8778 | 5316 | version: "6.3", |
| 8779 | 5317 | alternative: "html source", |
| 8780 | 5318 | link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" |
| @@ -8799,9 +5337,9 @@ | ||
| 8799 | 5337 | }; |
| 8800 | 5338 | |
| 8801 | 5339 | // packages/blocks/build-module/api/node.mjs |
| 8802 | 5340 | function isNodeOfType(node, type) { |
| 8803 | - (0, import_deprecated9.default)("wp.blocks.node.isNodeOfType", { | |
| 5341 | + (0, import_deprecated10.default)("wp.blocks.node.isNodeOfType", { | |
| 8804 | 5342 | since: "6.1", |
| 8805 | 5343 | version: "6.3", |
| 8806 | 5344 | link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" |
| 8807 | 5345 | }); |
| @@ -8808,16 +5346,16 @@ | ||
| 8808 | 5346 | return typeof node !== "string" && node?.type === type; |
| 8809 | 5347 | } |
| 8810 | 5348 | function getNamedNodeMapAsObject(nodeMap) { |
| 8811 | 5349 | const result = {}; |
| 8812 | - for (let i2 = 0; i2 < nodeMap.length; i2++) { | |
| 8813 | - const { name, value } = nodeMap[i2]; | |
| 5350 | + for (let i = 0; i < nodeMap.length; i++) { | |
| 5351 | + const { name, value } = nodeMap[i]; | |
| 8814 | 5352 | result[name] = value; |
| 8815 | 5353 | } |
| 8816 | 5354 | return result; |
| 8817 | 5355 | } |
| 8818 | 5356 | function fromDOM2(domNode) { |
| 8819 | - (0, import_deprecated9.default)("wp.blocks.node.fromDOM", { | |
| 5357 | + (0, import_deprecated10.default)("wp.blocks.node.fromDOM", { | |
| 8820 | 5358 | since: "6.1", |
| 8821 | 5359 | version: "6.3", |
| 8822 | 5360 | alternative: "wp.richText.create", |
| 8823 | 5361 | link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" |
| @@ -8838,9 +5376,9 @@ | ||
| 8838 | 5376 | } |
| 8839 | 5377 | }; |
| 8840 | 5378 | } |
| 8841 | 5379 | function toHTML2(node) { |
| 8842 | - (0, import_deprecated9.default)("wp.blocks.node.toHTML", { | |
| 5380 | + (0, import_deprecated10.default)("wp.blocks.node.toHTML", { | |
| 8843 | 5381 | since: "6.1", |
| 8844 | 5382 | version: "6.3", |
| 8845 | 5383 | alternative: "wp.richText.toHTMLString", |
| 8846 | 5384 | link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" |
| @@ -8847,9 +5385,9 @@ | ||
| 8847 | 5385 | }); |
| 8848 | 5386 | return toHTML([node]); |
| 8849 | 5387 | } |
| 8850 | 5388 | function matcher2(selector) { |
| 8851 | - (0, import_deprecated9.default)("wp.blocks.node.matcher", { | |
| 5389 | + (0, import_deprecated10.default)("wp.blocks.node.matcher", { | |
| 8852 | 5390 | since: "6.1", |
| 8853 | 5391 | version: "6.3", |
| 8854 | 5392 | alternative: "html source", |
| 8855 | 5393 | link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" |
| @@ -8905,9 +5443,9 @@ | ||
| 8905 | 5443 | }) : import_rich_text3.RichTextData.empty(); |
| 8906 | 5444 | }; |
| 8907 | 5445 | |
| 8908 | 5446 | // packages/blocks/build-module/api/parser/get-block-attributes.mjs |
| 8909 | - var toBooleanAttributeMatcher = (matcher3) => (value) => matcher3(value) !== void 0; | |
| 5447 | + var toBooleanAttributeMatcher = (matcher3) => (domNode) => matcher3(domNode) !== void 0; | |
| 8910 | 5448 | function isOfType(value, type) { |
| 8911 | 5449 | switch (type) { |
| 8912 | 5450 | case "rich-text": |
| 8913 | 5451 | return value instanceof import_rich_text4.RichTextData; |
| @@ -8971,14 +5509,14 @@ | ||
| 8971 | 5509 | var matcherFromSource = memize( |
| 8972 | 5510 | (sourceConfig) => { |
| 8973 | 5511 | switch (sourceConfig.source) { |
| 8974 | 5512 | case "attribute": { |
| 8975 | - let matcher3 = attr( | |
| 5513 | + const matcher3 = attr( | |
| 8976 | 5514 | sourceConfig.selector, |
| 8977 | 5515 | sourceConfig.attribute |
| 8978 | 5516 | ); |
| 8979 | 5517 | if (sourceConfig.type === "boolean") { |
| 8980 | - matcher3 = toBooleanAttributeMatcher(matcher3); | |
| 5518 | + return toBooleanAttributeMatcher(matcher3); | |
| 8981 | 5519 | } |
| 8982 | 5520 | return matcher3; |
| 8983 | 5521 | } |
| 8984 | 5522 | case "html": |
| @@ -9016,9 +5554,12 @@ | ||
| 9016 | 5554 | } |
| 9017 | 5555 | } |
| 9018 | 5556 | ); |
| 9019 | 5557 | function parseHtml(innerHTML) { |
| 9020 | - return parse(innerHTML, (h2) => h2); | |
| 5558 | + return parse( | |
| 5559 | + innerHTML ?? "", | |
| 5560 | + (h) => h | |
| 5561 | + ); | |
| 9021 | 5562 | } |
| 9022 | 5563 | function parseWithAttributeSchema(innerHTML, attributeSchema) { |
| 9023 | 5564 | return matcherFromSource(attributeSchema)( |
| 9024 | 5565 | parseHtml(innerHTML) |
| @@ -9154,10 +5695,10 @@ | ||
| 9154 | 5695 | const { deprecated: deprecatedDefinitions } = blockType; |
| 9155 | 5696 | if (!deprecatedDefinitions || !deprecatedDefinitions.length) { |
| 9156 | 5697 | return block; |
| 9157 | 5698 | } |
| 9158 | - for (let i2 = 0; i2 < deprecatedDefinitions.length; i2++) { | |
| 9159 | - const { isEligible = stubFalse } = deprecatedDefinitions[i2]; | |
| 5699 | + for (let i = 0; i < deprecatedDefinitions.length; i++) { | |
| 5700 | + const { isEligible = stubFalse } = deprecatedDefinitions[i]; | |
| 9160 | 5701 | if (block.isValid && !isEligible(parsedAttributes, block.innerBlocks, { |
| 9161 | 5702 | blockNode: rawBlock, |
| 9162 | 5703 | block |
| 9163 | 5704 | })) { |
| @@ -9167,9 +5708,9 @@ | ||
| 9167 | 5708 | omit( |
| 9168 | 5709 | blockType, |
| 9169 | 5710 | DEPRECATED_ENTRY_KEYS |
| 9170 | 5711 | ), |
| 9171 | - deprecatedDefinitions[i2] | |
| 5712 | + deprecatedDefinitions[i] | |
| 9172 | 5713 | ); |
| 9173 | 5714 | let migratedBlock = { |
| 9174 | 5715 | ...block, |
| 9175 | 5716 | attributes: getBlockAttributes( |
| @@ -9299,8 +5840,16 @@ | ||
| 9299 | 5840 | ), |
| 9300 | 5841 | parsedInnerBlocks |
| 9301 | 5842 | ); |
| 9302 | 5843 | parsedBlock.originalContent = normalizedBlock.innerHTML; |
| 5844 | + if (blockType.name === "core/html") { | |
| 5845 | + parsedBlock.innerContent = normalizedBlock.innerContent ?? [ | |
| 5846 | + normalizedBlock.innerHTML | |
| 5847 | + ]; | |
| 5848 | + parsedBlock.isValid = true; | |
| 5849 | + parsedBlock.validationIssues = []; | |
| 5850 | + return parsedBlock; | |
| 5851 | + } | |
| 9303 | 5852 | const validatedBlock = applyBlockValidation(parsedBlock, blockType); |
| 9304 | 5853 | const { validationIssues } = validatedBlock; |
| 9305 | 5854 | const updatedBlock = applyBlockDeprecatedVersions( |
| 9306 | 5855 | validatedBlock, |
| @@ -9341,22 +5890,19 @@ | ||
| 9341 | 5890 | ); |
| 9342 | 5891 | } |
| 9343 | 5892 | |
| 9344 | 5893 | // packages/blocks/build-module/api/raw-handling/index.mjs |
| 9345 | - var import_deprecated10 = __toESM(require_deprecated(), 1); | |
| 9346 | - var import_dom12 = __toESM(require_dom(), 1); | |
| 5894 | + var import_deprecated11 = __toESM(require_deprecated(), 1); | |
| 5895 | + var import_dom13 = __toESM(require_dom(), 1); | |
| 9347 | 5896 | |
| 9348 | - // packages/blocks/build-module/api/raw-handling/html-to-blocks.mjs | |
| 9349 | - var import_element4 = __toESM(require_element(), 1); | |
| 9350 | - | |
| 9351 | 5897 | // packages/blocks/build-module/api/raw-handling/get-raw-transforms.mjs |
| 9352 | 5898 | function getRawTransforms() { |
| 9353 | - return getBlockTransforms("from").filter(({ type }) => type === "raw").map((transform) => { | |
| 9354 | - return transform.isMatch ? transform : { | |
| 9355 | - ...transform, | |
| 9356 | - isMatch: (node) => transform.selector && node.matches(transform.selector) | |
| 9357 | - }; | |
| 9358 | - }); | |
| 5899 | + return getBlockTransforms("from").filter( | |
| 5900 | + (transform) => transform.type === "raw" | |
| 5901 | + ).map((transform) => ({ | |
| 5902 | + ...transform, | |
| 5903 | + isMatch: transform.isMatch ?? ((node) => !!transform.selector && node.matches(transform.selector)) | |
| 5904 | + })); | |
| 9359 | 5905 | } |
| 9360 | 5906 | |
| 9361 | 5907 | // packages/blocks/build-module/api/raw-handling/html-to-blocks.mjs |
| 9362 | 5908 | function htmlToBlocks(html2, handler) { |
| @@ -9365,23 +5911,17 @@ | ||
| 9365 | 5911 | return Array.from(doc.body.children).flatMap((node) => { |
| 9366 | 5912 | const transforms = getRawTransforms(); |
| 9367 | 5913 | const rawTransform = findTransform( |
| 9368 | 5914 | transforms, |
| 9369 | - ((t3) => { | |
| 9370 | - const transform2 = t3; | |
| 9371 | - return transform2.isMatch(node); | |
| 9372 | - }) | |
| 5915 | + (transform2) => transform2.isMatch(node) | |
| 9373 | 5916 | ); |
| 9374 | 5917 | if (!rawTransform) { |
| 9375 | - if (import_element4.Platform.isNative) { | |
| 9376 | - return parse2( | |
| 9377 | - `<!-- wp:html -->${node.outerHTML}<!-- /wp:html -->` | |
| 9378 | - ); | |
| 9379 | - } | |
| 9380 | 5918 | return createBlock( |
| 9381 | 5919 | // Should not be hardcoded. |
| 9382 | 5920 | "core/html", |
| 9383 | - getBlockAttributes("core/html", node.outerHTML) | |
| 5921 | + {}, | |
| 5922 | + [], | |
| 5923 | + [node.outerHTML] | |
| 9384 | 5924 | ); |
| 9385 | 5925 | } |
| 9386 | 5926 | const { transform, blockName } = rawTransform; |
| 9387 | 5927 | if (transform) { |
| @@ -9611,19 +6151,16 @@ | ||
| 9611 | 6151 | var castArray = (maybeArray) => Array.isArray(maybeArray) ? maybeArray : [maybeArray]; |
| 9612 | 6152 | var beforeLineRegexp = /(\n|<p>|<br\s*\/?>)\s*$/; |
| 9613 | 6153 | var afterLineRegexp = /^\s*(\n|<\/p>|<br\s*\/?>)/; |
| 9614 | 6154 | function segmentHTMLToShortcodeBlock(HTML, lastIndex = 0, excludedBlockNames = []) { |
| 9615 | - const transformsFrom = getBlockTransforms( | |
| 9616 | - "from" | |
| 6155 | + const transformsFrom = getBlockTransforms("from").filter( | |
| 6156 | + (transform) => transform.type === "shortcode" | |
| 9617 | 6157 | ); |
| 9618 | 6158 | const transformation = findTransform( |
| 9619 | 6159 | transformsFrom, |
| 9620 | - ((transform) => { | |
| 9621 | - const t3 = transform; | |
| 9622 | - return excludedBlockNames.indexOf(t3.blockName) === -1 && t3.type === "shortcode" && castArray(t3.tag).some( | |
| 9623 | - (tag) => (0, import_shortcode.regexp)(tag).test(HTML) | |
| 9624 | - ); | |
| 9625 | - }) | |
| 6160 | + (transform) => excludedBlockNames.indexOf(transform.blockName) === -1 && castArray(transform.tag).some( | |
| 6161 | + (tag) => (0, import_shortcode.regexp)(tag).test(HTML) | |
| 6162 | + ) | |
| 9626 | 6163 | ); |
| 9627 | 6164 | if (!transformation) { |
| 9628 | 6165 | return [HTML]; |
| 9629 | 6166 | } |
| @@ -9630,76 +6167,74 @@ | ||
| 9630 | 6167 | const transformTags = castArray(transformation.tag); |
| 9631 | 6168 | const transformTag = transformTags.find( |
| 9632 | 6169 | (tag) => (0, import_shortcode.regexp)(tag).test(HTML) |
| 9633 | 6170 | ); |
| 9634 | - let match; | |
| 9635 | 6171 | const previousIndex = lastIndex; |
| 9636 | - if (match = (0, import_shortcode.next)(transformTag, HTML, lastIndex)) { | |
| 9637 | - lastIndex = match.index + match.content.length; | |
| 9638 | - const beforeHTML = HTML.substr(0, match.index); | |
| 9639 | - const afterHTML = HTML.substr(lastIndex); | |
| 9640 | - if (!match.shortcode.content?.includes("<") && !(beforeLineRegexp.test(beforeHTML) && afterLineRegexp.test(afterHTML))) { | |
| 9641 | - return segmentHTMLToShortcodeBlock(HTML, lastIndex); | |
| 9642 | - } | |
| 9643 | - if (transformation.isMatch && !transformation.isMatch(match.shortcode.attrs)) { | |
| 9644 | - return segmentHTMLToShortcodeBlock(HTML, previousIndex, [ | |
| 9645 | - ...excludedBlockNames, | |
| 9646 | - transformation.blockName | |
| 9647 | - ]); | |
| 9648 | - } | |
| 9649 | - let blocks = []; | |
| 9650 | - if (typeof transformation.transform === "function") { | |
| 9651 | - blocks = [].concat( | |
| 9652 | - transformation.transform(match.shortcode.attrs, match) | |
| 9653 | - ); | |
| 9654 | - blocks = blocks.map((block) => { | |
| 9655 | - block.originalContent = match.shortcode.content; | |
| 9656 | - return applyBuiltInValidationFixes( | |
| 9657 | - block, | |
| 9658 | - getBlockType(block.name) | |
| 9659 | - ); | |
| 9660 | - }); | |
| 9661 | - } else { | |
| 9662 | - const attributes = Object.fromEntries( | |
| 9663 | - Object.entries(transformation.attributes).filter(([, schema]) => schema.shortcode).map(([key, schema]) => [ | |
| 9664 | - key, | |
| 9665 | - schema.shortcode(match.shortcode.attrs, match) | |
| 9666 | - ]) | |
| 9667 | - ); | |
| 9668 | - const blockType = getBlockType(transformation.blockName); | |
| 9669 | - if (!blockType) { | |
| 9670 | - return [HTML]; | |
| 9671 | - } | |
| 9672 | - const transformationBlockType = { | |
| 9673 | - ...blockType, | |
| 9674 | - attributes: transformation.attributes | |
| 9675 | - }; | |
| 9676 | - let block = createBlock( | |
| 9677 | - transformation.blockName, | |
| 9678 | - getBlockAttributes( | |
| 9679 | - transformationBlockType, | |
| 9680 | - match.shortcode.content, | |
| 9681 | - attributes | |
| 9682 | - ) | |
| 9683 | - ); | |
| 6172 | + const match = (0, import_shortcode.next)(transformTag, HTML, lastIndex); | |
| 6173 | + if (!match) { | |
| 6174 | + return [HTML]; | |
| 6175 | + } | |
| 6176 | + lastIndex = match.index + match.content.length; | |
| 6177 | + const beforeHTML = HTML.substr(0, match.index); | |
| 6178 | + const afterHTML = HTML.substr(lastIndex); | |
| 6179 | + if (!match.shortcode.content?.includes("<") && !(beforeLineRegexp.test(beforeHTML) && afterLineRegexp.test(afterHTML))) { | |
| 6180 | + return segmentHTMLToShortcodeBlock(HTML, lastIndex); | |
| 6181 | + } | |
| 6182 | + if (transformation.isMatch && !transformation.isMatch(match.shortcode.attrs)) { | |
| 6183 | + return segmentHTMLToShortcodeBlock(HTML, previousIndex, [ | |
| 6184 | + ...excludedBlockNames, | |
| 6185 | + transformation.blockName | |
| 6186 | + ]); | |
| 6187 | + } | |
| 6188 | + let blocks = []; | |
| 6189 | + if (typeof transformation.transform === "function") { | |
| 6190 | + blocks = [].concat( | |
| 6191 | + transformation.transform(match.shortcode.attrs, match) | |
| 6192 | + ); | |
| 6193 | + blocks = blocks.map((block) => { | |
| 9684 | 6194 | block.originalContent = match.shortcode.content; |
| 9685 | - block = applyBuiltInValidationFixes( | |
| 6195 | + return applyBuiltInValidationFixes( | |
| 9686 | 6196 | block, |
| 9687 | - transformationBlockType | |
| 6197 | + getBlockType(block.name) | |
| 9688 | 6198 | ); |
| 9689 | - blocks = [block]; | |
| 6199 | + }); | |
| 6200 | + } else { | |
| 6201 | + const blockType = getBlockType(transformation.blockName); | |
| 6202 | + if (!blockType) { | |
| 6203 | + return [HTML]; | |
| 9690 | 6204 | } |
| 9691 | - return [ | |
| 9692 | - ...segmentHTMLToShortcodeBlock( | |
| 9693 | - beforeHTML.replace(beforeLineRegexp, "") | |
| 9694 | - ), | |
| 9695 | - ...blocks, | |
| 9696 | - ...segmentHTMLToShortcodeBlock( | |
| 9697 | - afterHTML.replace(afterLineRegexp, "") | |
| 6205 | + const transformAttributes = transformation.attributes ?? blockType.attributes; | |
| 6206 | + const attributes = Object.fromEntries( | |
| 6207 | + Object.entries(transformAttributes).filter(([, schema]) => schema.shortcode).map(([key, schema]) => [ | |
| 6208 | + key, | |
| 6209 | + schema.shortcode(match.shortcode.attrs, match) | |
| 6210 | + ]) | |
| 6211 | + ); | |
| 6212 | + const transformationBlockType = { | |
| 6213 | + ...blockType, | |
| 6214 | + attributes: transformAttributes | |
| 6215 | + }; | |
| 6216 | + let block = createBlock( | |
| 6217 | + transformation.blockName, | |
| 6218 | + getBlockAttributes( | |
| 6219 | + transformationBlockType, | |
| 6220 | + match.shortcode.content, | |
| 6221 | + attributes | |
| 9698 | 6222 | ) |
| 9699 | - ]; | |
| 6223 | + ); | |
| 6224 | + block.originalContent = match.shortcode.content; | |
| 6225 | + block = applyBuiltInValidationFixes(block, transformationBlockType); | |
| 6226 | + blocks = [block]; | |
| 9700 | 6227 | } |
| 9701 | - return [HTML]; | |
| 6228 | + return [ | |
| 6229 | + ...segmentHTMLToShortcodeBlock( | |
| 6230 | + beforeHTML.replace(beforeLineRegexp, "") | |
| 6231 | + ), | |
| 6232 | + ...blocks, | |
| 6233 | + ...segmentHTMLToShortcodeBlock( | |
| 6234 | + afterHTML.replace(afterLineRegexp, "") | |
| 6235 | + ) | |
| 6236 | + ]; | |
| 9702 | 6237 | } |
| 9703 | 6238 | var shortcode_converter_default = segmentHTMLToShortcodeBlock; |
| 9704 | 6239 | |
| 9705 | 6240 | // packages/blocks/build-module/api/raw-handling/utils.mjs |
| @@ -9738,13 +6273,18 @@ | ||
| 9738 | 6273 | case "children": { |
| 9739 | 6274 | if (objValue === "*" || srcValue === "*") { |
| 9740 | 6275 | return "*"; |
| 9741 | 6276 | } |
| 9742 | - return { ...objValue, ...srcValue }; | |
| 6277 | + return mergeSchemas( | |
| 6278 | + { ...objValue || {} }, | |
| 6279 | + srcValue || {} | |
| 6280 | + ); | |
| 9743 | 6281 | } |
| 9744 | 6282 | case "attributes": |
| 9745 | 6283 | case "require": { |
| 9746 | - return [...objValue || [], ...srcValue || []]; | |
| 6284 | + return Array.from( | |
| 6285 | + /* @__PURE__ */ new Set([...objValue || [], ...srcValue || []]) | |
| 6286 | + ); | |
| 9747 | 6287 | } |
| 9748 | 6288 | case "isMatch": { |
| 9749 | 6289 | if (!objValue || !srcValue) { |
| 9750 | 6290 | return void 0; |
| @@ -9752,21 +6292,49 @@ | ||
| 9752 | 6292 | return (...args) => { |
| 9753 | 6293 | return objValue(...args) || srcValue(...args); |
| 9754 | 6294 | }; |
| 9755 | 6295 | } |
| 6296 | + case "classes": { | |
| 6297 | + if ((objValue || []).includes("*") || (srcValue || []).includes("*")) { | |
| 6298 | + return ["*"]; | |
| 6299 | + } | |
| 6300 | + return [...objValue || [], ...srcValue || []]; | |
| 6301 | + } | |
| 9756 | 6302 | } |
| 9757 | 6303 | } |
| 9758 | - function mergeTagNameSchemas(a2, b2) { | |
| 6304 | + function mergeTagNameSchemas(a, b2) { | |
| 6305 | + if (a === b2) { | |
| 6306 | + return a; | |
| 6307 | + } | |
| 9759 | 6308 | for (const key in b2) { |
| 9760 | - a2[key] = a2[key] ? mergeTagNameSchemaProperties(a2[key], b2[key], key) : { ...b2[key] }; | |
| 6309 | + if (a[key]) { | |
| 6310 | + a[key] = mergeTagNameSchemaProperties( | |
| 6311 | + a[key], | |
| 6312 | + b2[key], | |
| 6313 | + key | |
| 6314 | + ); | |
| 6315 | + } else if (Array.isArray(b2[key])) { | |
| 6316 | + a[key] = b2[key].slice(); | |
| 6317 | + } else { | |
| 6318 | + a[key] = { ...b2[key] }; | |
| 6319 | + } | |
| 9761 | 6320 | } |
| 9762 | - return a2; | |
| 6321 | + return a; | |
| 9763 | 6322 | } |
| 9764 | - function mergeSchemas(a2, b2) { | |
| 6323 | + function mergeSchemas(a, b2) { | |
| 6324 | + if (a === b2) { | |
| 6325 | + return a; | |
| 6326 | + } | |
| 9765 | 6327 | for (const key in b2) { |
| 9766 | - a2[key] = a2[key] ? mergeTagNameSchemas(a2[key], b2[key]) : { ...b2[key] }; | |
| 6328 | + if (a[key]) { | |
| 6329 | + a[key] = mergeTagNameSchemas(a[key], b2[key]); | |
| 6330 | + } else if (Array.isArray(b2[key])) { | |
| 6331 | + a[key] = b2[key].slice(); | |
| 6332 | + } else { | |
| 6333 | + a[key] = { ...b2[key] }; | |
| 6334 | + } | |
| 9767 | 6335 | } |
| 9768 | - return a2; | |
| 6336 | + return a; | |
| 9769 | 6337 | } |
| 9770 | 6338 | return schemas.reduce(mergeSchemas, {}); |
| 9771 | 6339 | } |
| 9772 | 6340 | function getBlockContentSchema(context) { |
| @@ -9782,10 +6350,10 @@ | ||
| 9782 | 6350 | return false; |
| 9783 | 6351 | } |
| 9784 | 6352 | const wrapper = doc.body.children.item(0); |
| 9785 | 6353 | const descendants = wrapper.getElementsByTagName("*"); |
| 9786 | - for (let i2 = 0; i2 < descendants.length; i2++) { | |
| 9787 | - if (descendants.item(i2).tagName !== "BR") { | |
| 6354 | + for (let i = 0; i < descendants.length; i++) { | |
| 6355 | + if (descendants.item(i).tagName !== "BR") { | |
| 9788 | 6356 | return false; |
| 9789 | 6357 | } |
| 9790 | 6358 | } |
| 9791 | 6359 | if (wrapper.tagName !== "SPAN") { |
| @@ -9822,9 +6390,9 @@ | ||
| 9822 | 6390 | return getSibling(parentNode, which); |
| 9823 | 6391 | } |
| 9824 | 6392 | |
| 9825 | 6393 | // packages/blocks/build-module/api/raw-handling/paste-handler.mjs |
| 9826 | - var import_dom11 = __toESM(require_dom(), 1); | |
| 6394 | + var import_dom12 = __toESM(require_dom(), 1); | |
| 9827 | 6395 | |
| 9828 | 6396 | // packages/blocks/build-module/api/raw-handling/comment-remover.mjs |
| 9829 | 6397 | var import_dom7 = __toESM(require_dom(), 1); |
| 9830 | 6398 | function commentRemover(node) { |
| @@ -9847,9 +6415,9 @@ | ||
| 9847 | 6415 | ["ul", "li", "ol"], |
| 9848 | 6416 | ["h1", "h2", "h3", "h4", "h5", "h6"] |
| 9849 | 6417 | ]; |
| 9850 | 6418 | return inlineAllowedTagGroups.some( |
| 9851 | - (tagGroup) => [tag, contextTag].filter((t3) => !tagGroup.includes(t3)).length === 0 | |
| 6419 | + (tagGroup) => [tag, contextTag].filter((t2) => !tagGroup.includes(t2)).length === 0 | |
| 9852 | 6420 | ); |
| 9853 | 6421 | } |
| 9854 | 6422 | function deepCheck(nodes, contextTag) { |
| 9855 | 6423 | return nodes.every( |
| @@ -10015,10 +6583,10 @@ | ||
| 10015 | 6583 | node.src = ""; |
| 10016 | 6584 | return; |
| 10017 | 6585 | } |
| 10018 | 6586 | const uint8Array = new Uint8Array(decoded.length); |
| 10019 | - for (let i2 = 0; i2 < uint8Array.length; i2++) { | |
| 10020 | - uint8Array[i2] = decoded.charCodeAt(i2); | |
| 6587 | + for (let i = 0; i < uint8Array.length; i++) { | |
| 6588 | + uint8Array[i] = decoded.charCodeAt(i); | |
| 10021 | 6589 | } |
| 10022 | 6590 | const name = type.replace("/", "."); |
| 10023 | 6591 | const file = new window.File([uint8Array], name, { type }); |
| 10024 | 6592 | node.src = (0, import_blob.createBlobURL)(file); |
| @@ -10036,17 +6604,1344 @@ | ||
| 10036 | 6604 | const node = div; |
| 10037 | 6605 | node.innerHTML = normaliseBlocks(node.innerHTML); |
| 10038 | 6606 | } |
| 10039 | 6607 | |
| 6608 | + // node_modules/marked/lib/marked.esm.js | |
| 6609 | + function A2() { | |
| 6610 | + return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null }; | |
| 6611 | + } | |
| 6612 | + var T = A2(); | |
| 6613 | + function U(l4) { | |
| 6614 | + T = l4; | |
| 6615 | + } | |
| 6616 | + var E2 = { exec: () => null }; | |
| 6617 | + function I(l4) { | |
| 6618 | + let e2 = []; | |
| 6619 | + return (t2) => { | |
| 6620 | + let n = Math.max(0, Math.min(3, t2 - 1)), i = e2[n]; | |
| 6621 | + return i || (i = l4(n), e2[n] = i), i; | |
| 6622 | + }; | |
| 6623 | + } | |
| 6624 | + function d(l4, e2 = "") { | |
| 6625 | + let t2 = typeof l4 == "string" ? l4 : l4.source, n = { replace: (i, r2) => { | |
| 6626 | + let o2 = typeof r2 == "string" ? r2 : r2.source; | |
| 6627 | + return o2 = o2.replace(m2.caret, "$1"), t2 = t2.replace(i, o2), n; | |
| 6628 | + }, getRegex: () => new RegExp(t2, e2) }; | |
| 6629 | + return n; | |
| 6630 | + } | |
| 6631 | + var we = ((l4 = "") => { | |
| 6632 | + try { | |
| 6633 | + return !!new RegExp("(?<=1)(?<!1)" + l4); | |
| 6634 | + } catch { | |
| 6635 | + return false; | |
| 6636 | + } | |
| 6637 | + })(); | |
| 6638 | + var m2 = { codeRemoveIndent: /^(?: {0,3}\t| {1,4})/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, endingSpaceTabChar: /[ \t]$/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (l4) => new RegExp(`^( {0,3}${l4})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: I((l4) => new RegExp(`^ {0,${l4}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: I((l4) => new RegExp(`^ {0,${l4}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)), fencesBeginRegex: I((l4) => new RegExp(`^ {0,${l4}}(?:\`\`\`|~~~)`)), headingBeginRegex: I((l4) => new RegExp(`^ {0,${l4}}#`)), htmlBeginRegex: I((l4) => new RegExp(`^ {0,${l4}}(?:</?(?:${H2})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`, "i")), blockquoteBeginRegex: I((l4) => new RegExp(`^ {0,${l4}}>`)) }; | |
| 6639 | + var ye = /^(?:[ \t]*(?:\n|$))+/; | |
| 6640 | + var Pe = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/; | |
| 6641 | + var Se = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/; | |
| 6642 | + var v2 = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/; | |
| 6643 | + var _e = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/; | |
| 6644 | + var K = / {0,3}(?:[*+-]|\d{1,9}[.)])/; | |
| 6645 | + var le = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/; | |
| 6646 | + var ue = d(le).replace(/bull/g, K).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(); | |
| 6647 | + var $e = d(le).replace(/bull/g, K).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(); | |
| 6648 | + var W = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/; | |
| 6649 | + var Le = /^[^\n]+/; | |
| 6650 | + var X = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/; | |
| 6651 | + var ze = d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", X).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(); | |
| 6652 | + var Ee = d(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, K).getRegex(); | |
| 6653 | + var H2 = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul"; | |
| 6654 | + var J = /<!--(?:-?>|[\s\S]*?(?:-->|$))/; | |
| 6655 | + var Me = d("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", J).replace("tag", H2).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(); | |
| 6656 | + var pe = (l4) => d(W).replace("hr", v2).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", l4).replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", H2).getRegex(); | |
| 6657 | + var Ae = pe(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/); | |
| 6658 | + var Ie = pe(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/); | |
| 6659 | + var Ce = d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Ie).getRegex(); | |
| 6660 | + var V = { blockquote: Ce, code: Pe, def: ze, fences: Se, heading: _e, hr: v2, html: Me, lheading: ue, list: Ee, newline: ye, paragraph: Ae, table: E2, text: Le }; | |
| 6661 | + var ie = d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", v2).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", H2).getRegex(); | |
| 6662 | + var Be = { ...V, lheading: $e, table: ie, paragraph: d(W).replace("hr", v2).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", ie).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", H2).getRegex() }; | |
| 6663 | + var De = { ...V, html: d(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", J).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: E2, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: d(W).replace("hr", v2).replace("heading", ` *#{1,6} *[^ | |
| 6664 | +]`).replace("lheading", ue).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }; | |
| 6665 | + var qe = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/; | |
| 6666 | + var ve = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/; | |
| 6667 | + var ce = /^( {2,}|\\)\n(?!\s*$)[ \t]*/; | |
| 6668 | + var He = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/; | |
| 6669 | + var _ = /[\p{P}\p{S}]/u; | |
| 6670 | + var C2 = /[\s\p{P}\p{S}]/u; | |
| 6671 | + var Z = /[^\s\p{P}\p{S}]/u; | |
| 6672 | + var Ze = d(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, C2).getRegex(); | |
| 6673 | + var Ge = /[\p{Pi}\p{Ps}"']/u; | |
| 6674 | + var he = /(?!~)[\p{P}\p{S}]/u; | |
| 6675 | + var Qe = /(?!~)[\s\p{P}\p{S}]/u; | |
| 6676 | + var Ne = /(?:[^\s\p{P}\p{S}]|~)/u; | |
| 6677 | + var je = d(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", we ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(); | |
| 6678 | + var de = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/; | |
| 6679 | + var Ue = d(de, "u").replace(/punct/g, _).getRegex(); | |
| 6680 | + var Fe = d(de, "u").replace(/punct/g, he).getRegex(); | |
| 6681 | + var Ke = /^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/; | |
| 6682 | + var We = d(Ke, "u").replace(/openQuote/g, Ge).replace(/punct/g, _).getRegex(); | |
| 6683 | + var ke = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)"; | |
| 6684 | + var Xe = d(ke, "gu").replace(/notPunctSpace/g, Z).replace(/punctSpace/g, C2).replace(/punct/g, _).getRegex(); | |
| 6685 | + var Je = d(ke, "gu").replace(/notPunctSpace/g, Ne).replace(/punctSpace/g, Qe).replace(/punct/g, he).getRegex(); | |
| 6686 | + var Ve = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)"; | |
| 6687 | + var Ye = d(Ve, "gu").replace(/notPunctSpace/g, Z).replace(/punctSpace/g, C2).replace(/punct/g, _).getRegex(); | |
| 6688 | + var et = d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Z).replace(/punctSpace/g, C2).replace(/punct/g, _).getRegex(); | |
| 6689 | + var tt = "^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)"; | |
| 6690 | + var nt = d(tt, "gu").replace(/notPunctSpace/g, Z).replace(/punctSpace/g, C2).replace(/punct/g, _).getRegex(); | |
| 6691 | + var rt = d(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, _).getRegex(); | |
| 6692 | + var st = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)"; | |
| 6693 | + var it = d(st, "gu").replace(/notPunctSpace/g, Z).replace(/punctSpace/g, C2).replace(/punct/g, _).getRegex(); | |
| 6694 | + var ot = d(/\\(punct)/, "gu").replace(/punct/g, _).getRegex(); | |
| 6695 | + var at = d(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(); | |
| 6696 | + var lt = d(J).replace("(?:-->|$)", "-->").getRegex(); | |
| 6697 | + var ut = d("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", lt).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(); | |
| 6698 | + var ge = /\[(?:\\[\s\S]|[^\[\]\\])*\]/; | |
| 6699 | + var N2 = d(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", ge).getRegex(); | |
| 6700 | + var pt = d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", N2).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(); | |
| 6701 | + var ct = d(/^!?\[(label)\]\[(ref)\]/).replace("label", N2).replace("ref", X).getRegex(); | |
| 6702 | + var ht = d(/^!?\[(ref)\](?:\[\])?/).replace("ref", X).getRegex(); | |
| 6703 | + var oe = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/; | |
| 6704 | + var dt = d(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", ge).getRegex(); | |
| 6705 | + var kt = d("reflink|nolink(?!\\()", "g").replace("reflink", d(/^!?\[(label)\]\[(ref)\]/).replace("label", dt).replace("ref", oe).getRegex()).replace("nolink", d(/^!?\[(ref)\](?:\[\])?/).replace("ref", oe).getRegex()).getRegex(); | |
| 6706 | + var ae = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/; | |
| 6707 | + var Y = { _backpedal: E2, anyPunctuation: ot, autolink: at, blockSkip: je, br: ce, code: ve, del: E2, delLDelim: E2, delRDelim: E2, emStrongLDelim: Ue, emStrongRDelimAst: Xe, emStrongRDelimUnd: et, escape: qe, link: pt, nolink: ht, punctuation: Ze, reflink: ct, reflinkSearch: kt, tag: ut, text: He, url: E2 }; | |
| 6708 | + var gt = { ...Y, emStrongLDelim: We, emStrongRDelimAst: Ye, emStrongRDelimUnd: nt, link: d(/^!?\[(label)\]\((.*?)\)/).replace("label", N2).getRegex(), reflink: d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", N2).getRegex() }; | |
| 6709 | + var F = { ...Y, emStrongRDelimAst: Je, emStrongLDelim: Fe, delLDelim: rt, delRDelim: it, url: d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ae).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: d(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ae).getRegex() }; | |
| 6710 | + var ft = { ...F, br: d(ce).replace("{2,}", "*").getRegex(), text: d(F.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }; | |
| 6711 | + var G = { normal: V, gfm: Be, pedantic: De }; | |
| 6712 | + var B = { normal: Y, gfm: F, breaks: ft, pedantic: gt }; | |
| 6713 | + var mt = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }; | |
| 6714 | + var fe = (l4) => mt[l4]; | |
| 6715 | + function R2(l4, e2) { | |
| 6716 | + if (e2) { | |
| 6717 | + if (m2.escapeTest.test(l4)) return l4.replace(m2.escapeReplace, fe); | |
| 6718 | + } else if (m2.escapeTestNoEncode.test(l4)) return l4.replace(m2.escapeReplaceNoEncode, fe); | |
| 6719 | + return l4; | |
| 6720 | + } | |
| 6721 | + function ee(l4) { | |
| 6722 | + try { | |
| 6723 | + l4 = encodeURI(l4).replace(m2.percentDecode, "%"); | |
| 6724 | + } catch { | |
| 6725 | + return null; | |
| 6726 | + } | |
| 6727 | + return l4; | |
| 6728 | + } | |
| 6729 | + function te(l4, e2) { | |
| 6730 | + let t2 = l4.replace(m2.findPipe, (r2, o2, s) => { | |
| 6731 | + let u = false, a = o2; | |
| 6732 | + for (; --a >= 0 && s[a] === "\\"; ) u = !u; | |
| 6733 | + return u ? "|" : " |"; | |
| 6734 | + }), n = t2.split(m2.splitPipe), i = 0; | |
| 6735 | + if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), e2) if (n.length > e2) n.splice(e2); | |
| 6736 | + else for (; n.length < e2; ) n.push(""); | |
| 6737 | + for (; i < n.length; i++) n[i] = n[i].trim().replace(m2.slashPipe, "|"); | |
| 6738 | + return n; | |
| 6739 | + } | |
| 6740 | + function $2(l4, e2, t2) { | |
| 6741 | + let n = l4.length; | |
| 6742 | + if (n === 0) return ""; | |
| 6743 | + let i = 0; | |
| 6744 | + for (; i < n; ) { | |
| 6745 | + let r2 = l4.charAt(n - i - 1); | |
| 6746 | + if (r2 === e2 && !t2) i++; | |
| 6747 | + else if (r2 !== e2 && t2) i++; | |
| 6748 | + else break; | |
| 6749 | + } | |
| 6750 | + return l4.slice(0, n - i); | |
| 6751 | + } | |
| 6752 | + function ne(l4) { | |
| 6753 | + let e2 = l4.split(` | |
| 6754 | +`), t2 = e2.length - 1; | |
| 6755 | + for (; t2 >= 0 && m2.blankLine.test(e2[t2]); ) t2--; | |
| 6756 | + return e2.length - t2 <= 2 ? l4 : e2.slice(0, t2 + 1).join(` | |
| 6757 | +`); | |
| 6758 | + } | |
| 6759 | + function D2(l4) { | |
| 6760 | + return l4.toLowerCase().toUpperCase().toLowerCase(); | |
| 6761 | + } | |
| 6762 | + function me(l4, e2) { | |
| 6763 | + if (l4.indexOf(e2[1]) === -1) return -1; | |
| 6764 | + let t2 = 0; | |
| 6765 | + for (let n = 0; n < l4.length; n++) if (l4[n] === "\\") n++; | |
| 6766 | + else if (l4[n] === e2[0]) t2++; | |
| 6767 | + else if (l4[n] === e2[1] && (t2--, t2 < 0)) return n; | |
| 6768 | + return t2 > 0 ? -2 : -1; | |
| 6769 | + } | |
| 6770 | + function xe(l4, e2 = 0) { | |
| 6771 | + let t2 = e2, n = ""; | |
| 6772 | + for (let i of l4) if (i === " ") { | |
| 6773 | + let r2 = 4 - t2 % 4; | |
| 6774 | + n += " ".repeat(r2), t2 += r2; | |
| 6775 | + } else n += i, t2++; | |
| 6776 | + return n; | |
| 6777 | + } | |
| 6778 | + function be(l4, e2, t2, n, i) { | |
| 6779 | + let r2 = e2.href, o2 = e2.title || null, s = l4[1].replace(i.other.outputLinkReplace, "$1"), u = l4[0].charAt(0) === "!"; | |
| 6780 | + n.state.inLink = true; | |
| 6781 | + let a = n.state.linkEmitted, p2 = n.state.inRawBlock; | |
| 6782 | + n.state.linkEmitted = false; | |
| 6783 | + let c2 = n.inlineTokens(s), h = n.state.linkEmitted; | |
| 6784 | + if (n.state.linkEmitted = a, n.state.inLink = false, !u) { | |
| 6785 | + if (h) { | |
| 6786 | + n.state.inRawBlock = p2; | |
| 6787 | + return; | |
| 6788 | + } | |
| 6789 | + n.state.linkEmitted = true; | |
| 6790 | + } | |
| 6791 | + return { type: u ? "image" : "link", raw: t2, href: r2, title: o2, text: s, tokens: c2 }; | |
| 6792 | + } | |
| 6793 | + function xt(l4, e2, t2) { | |
| 6794 | + let n = l4.match(t2.other.indentCodeCompensation); | |
| 6795 | + if (n === null) return e2; | |
| 6796 | + let i = n[1]; | |
| 6797 | + return e2.split(` | |
| 6798 | +`).map((r2) => { | |
| 6799 | + let o2 = r2.match(t2.other.beginningSpace); | |
| 6800 | + if (o2 === null) return r2; | |
| 6801 | + let [s] = o2; | |
| 6802 | + return r2.slice(Math.min(s.length, i.length)); | |
| 6803 | + }).join(` | |
| 6804 | +`); | |
| 6805 | + } | |
| 6806 | + function Re(l4, e2, t2, n) { | |
| 6807 | + if (!e2.includes("<")) return false; | |
| 6808 | + for (let i = 0; i < e2.length; i++) { | |
| 6809 | + if (e2[i] === "\\") { | |
| 6810 | + i++; | |
| 6811 | + continue; | |
| 6812 | + } | |
| 6813 | + if (e2[i] === "`") { | |
| 6814 | + let s = n.inline.code.exec(e2.slice(i)); | |
| 6815 | + if (s) { | |
| 6816 | + i += s[0].length - 1; | |
| 6817 | + continue; | |
| 6818 | + } | |
| 6819 | + } | |
| 6820 | + if (e2[i] !== "<") continue; | |
| 6821 | + let r2 = l4.slice(t2 + i), o2 = n.inline.tag.exec(r2) || n.inline.autolink.exec(r2); | |
| 6822 | + if (o2) { | |
| 6823 | + if (o2[0].length > e2.length - i) return true; | |
| 6824 | + i += o2[0].length - 1; | |
| 6825 | + } | |
| 6826 | + } | |
| 6827 | + return false; | |
| 6828 | + } | |
| 6829 | + var y2 = class { | |
| 6830 | + options; | |
| 6831 | + rules; | |
| 6832 | + lexer; | |
| 6833 | + constructor(e2) { | |
| 6834 | + this.options = e2 || T; | |
| 6835 | + } | |
| 6836 | + space(e2) { | |
| 6837 | + let t2 = this.rules.block.newline.exec(e2); | |
| 6838 | + if (t2 && t2[0].length > 0) return { type: "space", raw: t2[0] }; | |
| 6839 | + } | |
| 6840 | + code(e2) { | |
| 6841 | + let t2 = this.rules.block.code.exec(e2); | |
| 6842 | + if (t2) { | |
| 6843 | + let n = this.options.pedantic ? t2[0] : ne(t2[0]), i = n.replace(this.rules.other.codeRemoveIndent, ""); | |
| 6844 | + return { type: "code", raw: n, codeBlockStyle: "indented", text: i }; | |
| 6845 | + } | |
| 6846 | + } | |
| 6847 | + fences(e2) { | |
| 6848 | + let t2 = this.rules.block.fences.exec(e2); | |
| 6849 | + if (t2) { | |
| 6850 | + let n = t2[0], i = xt(n, t2[3] || "", this.rules); | |
| 6851 | + return { type: "code", raw: n, lang: t2[2] ? t2[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t2[2], text: i }; | |
| 6852 | + } | |
| 6853 | + } | |
| 6854 | + heading(e2) { | |
| 6855 | + let t2 = this.rules.block.heading.exec(e2); | |
| 6856 | + if (t2) { | |
| 6857 | + let n = t2[2].trim(); | |
| 6858 | + if (this.rules.other.endingHash.test(n)) { | |
| 6859 | + let i = $2(n, "#"); | |
| 6860 | + (this.options.pedantic || !i || this.rules.other.endingSpaceTabChar.test(i)) && (n = i.trim()); | |
| 6861 | + } | |
| 6862 | + return { type: "heading", raw: $2(t2[0], ` | |
| 6863 | +`), depth: t2[1].length, text: n, tokens: this.lexer.inline(n) }; | |
| 6864 | + } | |
| 6865 | + } | |
| 6866 | + hr(e2) { | |
| 6867 | + let t2 = this.rules.block.hr.exec(e2); | |
| 6868 | + if (t2) return { type: "hr", raw: $2(t2[0], ` | |
| 6869 | +`) }; | |
| 6870 | + } | |
| 6871 | + blockquote(e2) { | |
| 6872 | + let t2 = this.rules.block.blockquote.exec(e2); | |
| 6873 | + if (t2) { | |
| 6874 | + let n = $2(t2[0], ` | |
| 6875 | +`).split(` | |
| 6876 | +`), i = "", r2 = "", o2 = []; | |
| 6877 | + for (; n.length > 0; ) { | |
| 6878 | + let s = false, u = [], a; | |
| 6879 | + for (a = 0; a < n.length; a++) if (this.rules.other.blockquoteStart.test(n[a])) u.push(n[a]), s = true; | |
| 6880 | + else if (!s) u.push(n[a]); | |
| 6881 | + else break; | |
| 6882 | + n = n.slice(a); | |
| 6883 | + let p2 = u.join(` | |
| 6884 | +`), c2 = p2.replace(this.rules.other.blockquoteSetextReplace, ` | |
| 6885 | + $1`).replace(this.rules.other.blockquoteSetextReplace2, ""); | |
| 6886 | + i = i ? `${i} | |
| 6887 | +${p2}` : p2, r2 = r2 ? `${r2} | |
| 6888 | +${c2}` : c2; | |
| 6889 | + let h = this.lexer.state.top; | |
| 6890 | + if (this.lexer.state.top = true, this.lexer.blockTokens(c2, o2, true), this.lexer.state.top = h, n.length === 0) break; | |
| 6891 | + let k2 = o2.at(-1); | |
| 6892 | + if (k2?.type === "code") break; | |
| 6893 | + if (k2?.type === "blockquote") { | |
| 6894 | + let O = k2, g2 = n.join(` | |
| 6895 | +`), w2 = O.raw + ` | |
| 6896 | +` + g2.replace(this.rules.other.blockquoteSetextReplace2, ""), z = this.blockquote(w2); | |
| 6897 | + o2[o2.length - 1] = z, i = `${i} | |
| 6898 | +${g2}`, r2 = r2.substring(0, r2.length - O.text.length) + z.text; | |
| 6899 | + break; | |
| 6900 | + } else if (k2?.type === "list") { | |
| 6901 | + let O = k2, g2 = O.raw + ` | |
| 6902 | +` + n.join(` | |
| 6903 | +`), w2 = this.list(g2); | |
| 6904 | + o2[o2.length - 1] = w2, i = i.substring(0, i.length - k2.raw.length) + w2.raw, r2 = r2.substring(0, r2.length - O.raw.length) + w2.raw, n = g2.substring(o2.at(-1).raw.length).split(` | |
| 6905 | +`); | |
| 6906 | + continue; | |
| 6907 | + } | |
| 6908 | + } | |
| 6909 | + return { type: "blockquote", raw: i, tokens: o2, text: r2 }; | |
| 6910 | + } | |
| 6911 | + } | |
| 6912 | + list(e2) { | |
| 6913 | + let t2 = this.rules.block.list.exec(e2); | |
| 6914 | + if (t2) { | |
| 6915 | + let n = t2[1].trim(), i = n.length > 1, r2 = { type: "list", raw: "", ordered: i, start: i ? +n.slice(0, -1) : "", loose: false, items: [] }; | |
| 6916 | + n = i ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = i ? n : "[*+-]"); | |
| 6917 | + let o2 = this.rules.other.listItemRegex(n), s = false; | |
| 6918 | + for (; e2; ) { | |
| 6919 | + let a = false, p2 = "", c2 = ""; | |
| 6920 | + if (!(t2 = o2.exec(e2)) || this.rules.block.hr.test(e2)) break; | |
| 6921 | + p2 = t2[0], e2 = e2.substring(p2.length); | |
| 6922 | + let h = xe(t2[2].split(` | |
| 6923 | +`, 1)[0], t2[1].length), k2 = e2.split(` | |
| 6924 | +`, 1)[0], O = !h.trim(), g2 = 0; | |
| 6925 | + if (this.options.pedantic ? (g2 = 2, c2 = h.trimStart()) : O ? g2 = t2[1].length + 1 : (g2 = h.search(this.rules.other.nonSpaceChar), g2 = g2 > 4 ? 1 : g2, c2 = h.slice(g2), g2 += t2[1].length), O && this.rules.other.blankLine.test(k2) && (p2 += k2 + ` | |
| 6926 | +`, e2 = e2.substring(k2.length + 1), a = true), !a) { | |
| 6927 | + let w2 = this.rules.other.nextBulletRegex(g2), z = this.rules.other.hrRegex(g2), re = this.rules.other.fencesBeginRegex(g2), se = this.rules.other.headingBeginRegex(g2), Te = this.rules.other.htmlBeginRegex(g2), Oe = this.rules.other.blockquoteBeginRegex(g2); | |
| 6928 | + for (; e2; ) { | |
| 6929 | + let j2 = e2.split(` | |
| 6930 | +`, 1)[0], q2; | |
| 6931 | + if (k2 = j2, this.options.pedantic ? (k2 = k2.replace(this.rules.other.listReplaceNesting, " "), q2 = k2) : q2 = k2.replace(this.rules.other.tabCharGlobal, " "), re.test(k2) || se.test(k2) || Te.test(k2) || Oe.test(k2) || w2.test(k2) || z.test(k2)) break; | |
| 6932 | + if (q2.search(this.rules.other.nonSpaceChar) >= g2 || !k2.trim()) c2 += ` | |
| 6933 | +` + q2.slice(g2); | |
| 6934 | + else { | |
| 6935 | + if (O || h.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || re.test(h) || se.test(h) || z.test(h)) break; | |
| 6936 | + c2 += ` | |
| 6937 | +` + k2; | |
| 6938 | + } | |
| 6939 | + O = !k2.trim(), p2 += j2 + ` | |
| 6940 | +`, e2 = e2.substring(j2.length + 1), h = q2.slice(g2); | |
| 6941 | + } | |
| 6942 | + } | |
| 6943 | + r2.loose || (s ? r2.loose = true : this.rules.other.doubleBlankLine.test(p2) && (s = true)), r2.items.push({ type: "list_item", raw: p2, task: !!this.options.gfm && this.rules.other.listIsTask.test(c2), loose: false, text: c2, tokens: [] }), r2.raw += p2; | |
| 6944 | + } | |
| 6945 | + let u = r2.items.at(-1); | |
| 6946 | + if (u) u.raw = u.raw.trimEnd(), u.text = u.text.trimEnd(); | |
| 6947 | + else return; | |
| 6948 | + r2.raw = r2.raw.trimEnd(); | |
| 6949 | + for (let a of r2.items) if (this.lexer.state.top = false, a.tokens = this.lexer.blockTokens(a.text, []), !r2.loose) { | |
| 6950 | + let p2 = a.tokens.filter((h) => h.type === "space"), c2 = p2.length > 0 && p2.some((h) => this.rules.other.anyLine.test(h.raw)); | |
| 6951 | + r2.loose = c2; | |
| 6952 | + } | |
| 6953 | + for (let a of r2.items) { | |
| 6954 | + let p2 = a.tokens[0]; | |
| 6955 | + if (a.task && (p2?.type === "text" || p2?.type === "paragraph")) { | |
| 6956 | + a.text = a.text.replace(this.rules.other.listReplaceTask, ""), p2.raw = p2.raw.replace(this.rules.other.listReplaceTask, ""), p2.text = p2.text.replace(this.rules.other.listReplaceTask, ""); | |
| 6957 | + for (let h = this.lexer.inlineQueue.length - 1; h >= 0; h--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[h].src)) { | |
| 6958 | + this.lexer.inlineQueue[h].src = this.lexer.inlineQueue[h].src.replace(this.rules.other.listReplaceTask, ""); | |
| 6959 | + break; | |
| 6960 | + } | |
| 6961 | + let c2 = this.rules.other.listTaskCheckbox.exec(a.raw); | |
| 6962 | + if (c2) { | |
| 6963 | + let h = { type: "checkbox", raw: c2[0] + " ", checked: c2[0] !== "[ ]" }; | |
| 6964 | + a.checked = h.checked, r2.loose ? a.tokens[0] && ["paragraph", "text"].includes(a.tokens[0].type) && "tokens" in a.tokens[0] && a.tokens[0].tokens ? (a.tokens[0].raw = h.raw + a.tokens[0].raw, a.tokens[0].text = h.raw + a.tokens[0].text, a.tokens[0].tokens.unshift(h)) : a.tokens.unshift({ type: "paragraph", raw: h.raw, text: h.raw, tokens: [h] }) : a.tokens.unshift(h); | |
| 6965 | + } | |
| 6966 | + } else a.task && (a.task = false); | |
| 6967 | + } | |
| 6968 | + if (r2.loose) for (let a of r2.items) { | |
| 6969 | + a.loose = true; | |
| 6970 | + for (let p2 of a.tokens) p2.type === "text" && (p2.type = "paragraph"); | |
| 6971 | + } | |
| 6972 | + return r2; | |
| 6973 | + } | |
| 6974 | + } | |
| 6975 | + html(e2) { | |
| 6976 | + let t2 = this.rules.block.html.exec(e2); | |
| 6977 | + if (t2) { | |
| 6978 | + let n = ne(t2[0]); | |
| 6979 | + return { type: "html", block: true, raw: n, pre: t2[1] === "pre" || t2[1] === "script" || t2[1] === "style", text: n }; | |
| 6980 | + } | |
| 6981 | + } | |
| 6982 | + def(e2) { | |
| 6983 | + let t2 = this.rules.block.def.exec(e2); | |
| 6984 | + if (t2) { | |
| 6985 | + let n = D2(t2[1]).replace(this.rules.other.multipleSpaceGlobal, " "), i = t2[2] ? t2[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r2 = t2[3] ? t2[3].substring(1, t2[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t2[3]; | |
| 6986 | + return { type: "def", tag: n, raw: $2(t2[0], ` | |
| 6987 | +`), href: i, title: r2 }; | |
| 6988 | + } | |
| 6989 | + } | |
| 6990 | + table(e2) { | |
| 6991 | + let t2 = this.rules.block.table.exec(e2); | |
| 6992 | + if (!t2 || !this.rules.other.tableDelimiter.test(t2[2])) return; | |
| 6993 | + let n = te(t2[1]), i = t2[2].replace(this.rules.other.tableAlignChars, "").split("|"), r2 = t2[3]?.trim() ? t2[3].replace(this.rules.other.tableRowBlankLine, "").split(` | |
| 6994 | +`) : [], o2 = { type: "table", raw: $2(t2[0], ` | |
| 6995 | +`), header: [], align: [], rows: [] }; | |
| 6996 | + if (n.length === i.length) { | |
| 6997 | + for (let s of i) this.rules.other.tableAlignRight.test(s) ? o2.align.push("right") : this.rules.other.tableAlignCenter.test(s) ? o2.align.push("center") : this.rules.other.tableAlignLeft.test(s) ? o2.align.push("left") : o2.align.push(null); | |
| 6998 | + for (let s = 0; s < n.length; s++) o2.header.push({ text: n[s], tokens: this.lexer.inline(n[s]), header: true, align: o2.align[s] }); | |
| 6999 | + for (let s of r2) o2.rows.push(te(s, o2.header.length).map((u, a) => ({ text: u, tokens: this.lexer.inline(u), header: false, align: o2.align[a] }))); | |
| 7000 | + return o2; | |
| 7001 | + } | |
| 7002 | + } | |
| 7003 | + lheading(e2) { | |
| 7004 | + let t2 = this.rules.block.lheading.exec(e2); | |
| 7005 | + if (t2) { | |
| 7006 | + let n = t2[1].trim(); | |
| 7007 | + return { type: "heading", raw: $2(t2[0], ` | |
| 7008 | +`), depth: t2[2].charAt(0) === "=" ? 1 : 2, text: n, tokens: this.lexer.inline(n) }; | |
| 7009 | + } | |
| 7010 | + } | |
| 7011 | + paragraph(e2) { | |
| 7012 | + let t2 = this.rules.block.paragraph.exec(e2); | |
| 7013 | + if (t2) { | |
| 7014 | + let n = t2[1].charAt(t2[1].length - 1) === ` | |
| 7015 | +` ? t2[1].slice(0, -1) : t2[1]; | |
| 7016 | + return { type: "paragraph", raw: t2[0], text: n, tokens: this.lexer.inline(n) }; | |
| 7017 | + } | |
| 7018 | + } | |
| 7019 | + text(e2) { | |
| 7020 | + let t2 = this.rules.block.text.exec(e2); | |
| 7021 | + if (t2) return { type: "text", raw: t2[0], text: t2[0], tokens: this.lexer.inline(t2[0]) }; | |
| 7022 | + } | |
| 7023 | + escape(e2) { | |
| 7024 | + let t2 = this.rules.inline.escape.exec(e2); | |
| 7025 | + if (t2) return { type: "escape", raw: t2[0], text: t2[1] }; | |
| 7026 | + } | |
| 7027 | + tag(e2) { | |
| 7028 | + let t2 = this.rules.inline.tag.exec(e2); | |
| 7029 | + if (t2) return !this.lexer.state.inLink && this.rules.other.startATag.test(t2[0]) ? this.lexer.state.inLink = true : this.lexer.state.inLink && this.rules.other.endATag.test(t2[0]) && (this.lexer.state.inLink = false), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(t2[0]) ? this.lexer.state.inRawBlock = true : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(t2[0]) && (this.lexer.state.inRawBlock = false), { type: "html", raw: t2[0], inLink: this.lexer.state.inLink, inRawBlock: this.lexer.state.inRawBlock, block: false, text: t2[0] }; | |
| 7030 | + } | |
| 7031 | + link(e2) { | |
| 7032 | + let t2 = this.rules.inline.link.exec(e2); | |
| 7033 | + if (t2) { | |
| 7034 | + let n = t2[0].charAt(0) === "!" ? 2 : 1; | |
| 7035 | + if (!this.options.pedantic && Re(e2, t2[1], n, this.rules)) return; | |
| 7036 | + let i = t2[2].trim(); | |
| 7037 | + if (!this.options.pedantic && this.rules.other.startAngleBracket.test(i)) { | |
| 7038 | + if (!this.rules.other.endAngleBracket.test(i)) return; | |
| 7039 | + let s = $2(i.slice(0, -1), "\\"); | |
| 7040 | + if ((i.length - s.length) % 2 === 0) return; | |
| 7041 | + } else { | |
| 7042 | + let s = me(t2[2], "()"); | |
| 7043 | + if (s === -2) return; | |
| 7044 | + if (s > -1) { | |
| 7045 | + let a = (t2[0].indexOf("!") === 0 ? 5 : 4) + t2[1].length + s; | |
| 7046 | + t2[2] = t2[2].substring(0, s), t2[0] = t2[0].substring(0, a).trim(), t2[3] = ""; | |
| 7047 | + } | |
| 7048 | + } | |
| 7049 | + let r2 = t2[2], o2 = ""; | |
| 7050 | + if (this.options.pedantic) { | |
| 7051 | + let s = this.rules.other.pedanticHrefTitle.exec(r2); | |
| 7052 | + s && (r2 = s[1], o2 = s[3]); | |
| 7053 | + } else o2 = t2[3] ? t2[3].slice(1, -1) : ""; | |
| 7054 | + return r2 = r2.trim(), this.rules.other.startAngleBracket.test(r2) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(i) ? r2 = r2.slice(1) : r2 = r2.slice(1, -1)), be(t2, { href: r2 && r2.replace(this.rules.inline.anyPunctuation, "$1"), title: o2 && o2.replace(this.rules.inline.anyPunctuation, "$1") }, t2[0], this.lexer, this.rules); | |
| 7055 | + } | |
| 7056 | + } | |
| 7057 | + reflink(e2, t2) { | |
| 7058 | + let n; | |
| 7059 | + if ((n = this.rules.inline.reflink.exec(e2)) || (n = this.rules.inline.nolink.exec(e2))) { | |
| 7060 | + let i = n[0].charAt(0) === "!" ? 2 : 1; | |
| 7061 | + if (!this.options.pedantic && Re(e2, n[1], i, this.rules)) return; | |
| 7062 | + let r2 = (n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "), o2 = t2[D2(r2)]; | |
| 7063 | + if (!o2) { | |
| 7064 | + let s = n[0].charAt(0); | |
| 7065 | + return { type: "text", raw: s, text: s }; | |
| 7066 | + } | |
| 7067 | + return be(n, o2, n[0], this.lexer, this.rules); | |
| 7068 | + } | |
| 7069 | + } | |
| 7070 | + emStrong(e2, t2, n = "") { | |
| 7071 | + let i = this.rules.inline.emStrongLDelim.exec(e2); | |
| 7072 | + if (!i || !i[1] && !i[2] && !i[3] && !i[4] || i[4] && n.match(this.rules.other.unicodeAlphaNumeric)) return; | |
| 7073 | + if (!(i[1] || i[3] || "") || !n || this.rules.inline.punctuation.exec(n)) { | |
| 7074 | + let o2 = [...i[0]].length - 1, s, u, a = o2, p2 = 0, c2 = i[0][0], h = n === c2, k2 = c2 === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd; | |
| 7075 | + for (k2.lastIndex = 0, t2 = t2.slice(-1 * e2.length + o2); (i = k2.exec(t2)) !== null; ) { | |
| 7076 | + if (s = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !s) continue; | |
| 7077 | + if (u = [...s].length, i[3] || i[4]) { | |
| 7078 | + a += u; | |
| 7079 | + continue; | |
| 7080 | + } else if (i[5] || i[6]) { | |
| 7081 | + if (o2 % 3 && !((o2 + u) % 3)) { | |
| 7082 | + p2 += u; | |
| 7083 | + continue; | |
| 7084 | + } | |
| 7085 | + if (h) break; | |
| 7086 | + } | |
| 7087 | + if (a -= u, a > 0) continue; | |
| 7088 | + u = Math.min(u, u + a + p2); | |
| 7089 | + let O = [...i[0]][0].length, g2 = e2.slice(0, o2 + i.index + O + u); | |
| 7090 | + if (Math.min(o2, u) % 2) { | |
| 7091 | + let z = g2.slice(1, -1); | |
| 7092 | + return { type: "em", raw: g2, text: z, tokens: this.lexer.inlineTokens(z) }; | |
| 7093 | + } | |
| 7094 | + let w2 = g2.slice(2, -2); | |
| 7095 | + return { type: "strong", raw: g2, text: w2, tokens: this.lexer.inlineTokens(w2) }; | |
| 7096 | + } | |
| 7097 | + } | |
| 7098 | + } | |
| 7099 | + codespan(e2) { | |
| 7100 | + let t2 = this.rules.inline.code.exec(e2); | |
| 7101 | + if (t2) { | |
| 7102 | + let n = t2[2].replace(this.rules.other.newLineCharGlobal, " "), i = this.rules.other.nonSpaceChar.test(n), r2 = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n); | |
| 7103 | + return i && r2 && (n = n.substring(1, n.length - 1)), { type: "codespan", raw: t2[0], text: n }; | |
| 7104 | + } | |
| 7105 | + } | |
| 7106 | + br(e2) { | |
| 7107 | + let t2 = this.rules.inline.br.exec(e2); | |
| 7108 | + if (t2) return { type: "br", raw: t2[0] }; | |
| 7109 | + } | |
| 7110 | + del(e2, t2, n = "") { | |
| 7111 | + let i = this.rules.inline.delLDelim.exec(e2); | |
| 7112 | + if (!i) return; | |
| 7113 | + if (!(i[1] || "") || !n || this.rules.inline.punctuation.exec(n)) { | |
| 7114 | + let o2 = [...i[0]].length - 1, s, u, a = o2, p2 = this.rules.inline.delRDelim; | |
| 7115 | + for (p2.lastIndex = 0, t2 = t2.slice(-1 * e2.length + o2); (i = p2.exec(t2)) !== null; ) { | |
| 7116 | + if (s = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !s || (u = [...s].length, u !== o2)) continue; | |
| 7117 | + if (i[3] || i[4]) { | |
| 7118 | + a += u; | |
| 7119 | + continue; | |
| 7120 | + } | |
| 7121 | + if (a -= u, a > 0) continue; | |
| 7122 | + u = Math.min(u, u + a); | |
| 7123 | + let c2 = [...i[0]][0].length, h = e2.slice(0, o2 + i.index + c2 + u), k2 = h.slice(o2, -o2); | |
| 7124 | + return { type: "del", raw: h, text: k2, tokens: this.lexer.inlineTokens(k2) }; | |
| 7125 | + } | |
| 7126 | + } | |
| 7127 | + } | |
| 7128 | + autolink(e2) { | |
| 7129 | + let t2 = this.rules.inline.autolink.exec(e2); | |
| 7130 | + if (t2) { | |
| 7131 | + let n, i; | |
| 7132 | + return t2[2] === "@" ? (n = t2[1], i = "mailto:" + n) : (n = t2[1], i = n), { type: "link", raw: t2[0], text: n, href: i, autolink: true, tokens: [{ type: "text", raw: n, text: n }] }; | |
| 7133 | + } | |
| 7134 | + } | |
| 7135 | + url(e2) { | |
| 7136 | + let t2; | |
| 7137 | + if (t2 = this.rules.inline.url.exec(e2)) { | |
| 7138 | + let n, i; | |
| 7139 | + if (t2[2] === "@") n = t2[0], i = "mailto:" + n; | |
| 7140 | + else { | |
| 7141 | + let r2; | |
| 7142 | + do | |
| 7143 | + r2 = t2[0], t2[0] = this.rules.inline._backpedal.exec(t2[0])?.[0] ?? ""; | |
| 7144 | + while (r2 !== t2[0]); | |
| 7145 | + n = t2[0], t2[1] === "www." ? i = "http://" + t2[0] : i = t2[0]; | |
| 7146 | + } | |
| 7147 | + return { type: "link", raw: t2[0], text: n, href: i, autolink: true, tokens: [{ type: "text", raw: n, text: n }] }; | |
| 7148 | + } | |
| 7149 | + } | |
| 7150 | + inlineText(e2) { | |
| 7151 | + let t2 = this.rules.inline.text.exec(e2); | |
| 7152 | + if (t2) { | |
| 7153 | + let n = this.lexer.state.inRawBlock; | |
| 7154 | + return { type: "text", raw: t2[0], text: t2[0], escaped: n }; | |
| 7155 | + } | |
| 7156 | + } | |
| 7157 | + }; | |
| 7158 | + var x2 = class l2 { | |
| 7159 | + tokens; | |
| 7160 | + options; | |
| 7161 | + state; | |
| 7162 | + inlineQueue; | |
| 7163 | + tokenizer; | |
| 7164 | + constructor(e2) { | |
| 7165 | + this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e2 || T, this.options.tokenizer = this.options.tokenizer || new y2(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: false, inRawBlock: false, linkEmitted: false, top: true }; | |
| 7166 | + let t2 = { other: m2, block: G.normal, inline: B.normal }; | |
| 7167 | + this.options.pedantic ? (t2.block = G.pedantic, t2.inline = B.pedantic) : this.options.gfm && (t2.block = G.gfm, this.options.breaks ? t2.inline = B.breaks : t2.inline = B.gfm), this.tokenizer.rules = t2; | |
| 7168 | + } | |
| 7169 | + static get rules() { | |
| 7170 | + return { block: G, inline: B }; | |
| 7171 | + } | |
| 7172 | + static lex(e2, t2) { | |
| 7173 | + return new l2(t2).lex(e2); | |
| 7174 | + } | |
| 7175 | + static lexInline(e2, t2) { | |
| 7176 | + return new l2(t2).inlineTokens(e2); | |
| 7177 | + } | |
| 7178 | + lex(e2) { | |
| 7179 | + e2 = e2.replace(m2.carriageReturn, ` | |
| 7180 | +`), this.blockTokens(e2, this.tokens); | |
| 7181 | + for (let t2 = 0; t2 < this.inlineQueue.length; t2++) { | |
| 7182 | + let n = this.inlineQueue[t2]; | |
| 7183 | + this.inlineTokens(n.src, n.tokens); | |
| 7184 | + } | |
| 7185 | + return this.inlineQueue = [], this.tokens; | |
| 7186 | + } | |
| 7187 | + blockTokens(e2, t2 = [], n = false) { | |
| 7188 | + this.tokenizer.lexer = this, this.options.pedantic && (e2 = e2.replace(m2.tabCharGlobal, " ").replace(m2.spaceLine, "")); | |
| 7189 | + let i = 1 / 0; | |
| 7190 | + for (; e2; ) { | |
| 7191 | + if (e2.length < i) i = e2.length; | |
| 7192 | + else { | |
| 7193 | + this.infiniteLoopError(e2.charCodeAt(0)); | |
| 7194 | + break; | |
| 7195 | + } | |
| 7196 | + let r2; | |
| 7197 | + if (this.options.extensions?.block?.some((s) => (r2 = s.call({ lexer: this }, e2, t2)) ? (e2 = e2.substring(r2.raw.length), t2.push(r2), true) : false)) continue; | |
| 7198 | + if (r2 = this.tokenizer.space(e2)) { | |
| 7199 | + e2 = e2.substring(r2.raw.length); | |
| 7200 | + let s = t2.at(-1); | |
| 7201 | + r2.raw.length === 1 && s !== void 0 ? s.raw += ` | |
| 7202 | +` : t2.push(r2); | |
| 7203 | + continue; | |
| 7204 | + } | |
| 7205 | + if (r2 = this.tokenizer.code(e2)) { | |
| 7206 | + e2 = e2.substring(r2.raw.length); | |
| 7207 | + let s = t2.at(-1); | |
| 7208 | + s?.type === "paragraph" || s?.type === "text" ? (s.raw += (s.raw.endsWith(` | |
| 7209 | +`) ? "" : ` | |
| 7210 | +`) + r2.raw, s.text += ` | |
| 7211 | +` + r2.text, this.inlineQueue.at(-1).src = s.text) : t2.push(r2); | |
| 7212 | + continue; | |
| 7213 | + } | |
| 7214 | + if (r2 = this.tokenizer.fences(e2)) { | |
| 7215 | + e2 = e2.substring(r2.raw.length), t2.push(r2); | |
| 7216 | + continue; | |
| 7217 | + } | |
| 7218 | + if (r2 = this.tokenizer.heading(e2)) { | |
| 7219 | + e2 = e2.substring(r2.raw.length), t2.push(r2); | |
| 7220 | + continue; | |
| 7221 | + } | |
| 7222 | + if (r2 = this.tokenizer.hr(e2)) { | |
| 7223 | + e2 = e2.substring(r2.raw.length), t2.push(r2); | |
| 7224 | + continue; | |
| 7225 | + } | |
| 7226 | + if (r2 = this.tokenizer.blockquote(e2)) { | |
| 7227 | + e2 = e2.substring(r2.raw.length), t2.push(r2); | |
| 7228 | + continue; | |
| 7229 | + } | |
| 7230 | + if (r2 = this.tokenizer.list(e2)) { | |
| 7231 | + e2 = e2.substring(r2.raw.length), t2.push(r2); | |
| 7232 | + continue; | |
| 7233 | + } | |
| 7234 | + if (r2 = this.tokenizer.html(e2)) { | |
| 7235 | + e2 = e2.substring(r2.raw.length), t2.push(r2); | |
| 7236 | + continue; | |
| 7237 | + } | |
| 7238 | + if (r2 = this.tokenizer.def(e2)) { | |
| 7239 | + e2 = e2.substring(r2.raw.length); | |
| 7240 | + let s = t2.at(-1); | |
| 7241 | + s?.type === "paragraph" || s?.type === "text" ? (s.raw += (s.raw.endsWith(` | |
| 7242 | +`) ? "" : ` | |
| 7243 | +`) + r2.raw, s.text += ` | |
| 7244 | +` + r2.raw, this.inlineQueue.at(-1).src = s.text) : this.tokens.links[r2.tag] || (this.tokens.links[r2.tag] = { href: r2.href, title: r2.title }, t2.push(r2)); | |
| 7245 | + continue; | |
| 7246 | + } | |
| 7247 | + if (r2 = this.tokenizer.table(e2)) { | |
| 7248 | + e2 = e2.substring(r2.raw.length), t2.push(r2); | |
| 7249 | + continue; | |
| 7250 | + } | |
| 7251 | + if (r2 = this.tokenizer.lheading(e2)) { | |
| 7252 | + e2 = e2.substring(r2.raw.length), t2.push(r2); | |
| 7253 | + continue; | |
| 7254 | + } | |
| 7255 | + let o2 = e2; | |
| 7256 | + if (this.options.extensions?.startBlock) { | |
| 7257 | + let s = 1 / 0, u = e2.slice(1), a; | |
| 7258 | + this.options.extensions.startBlock.forEach((p2) => { | |
| 7259 | + a = p2.call({ lexer: this }, u), typeof a == "number" && a >= 0 && (s = Math.min(s, a)); | |
| 7260 | + }), s < 1 / 0 && s >= 0 && (o2 = e2.substring(0, s + 1)); | |
| 7261 | + } | |
| 7262 | + if (this.state.top && (r2 = this.tokenizer.paragraph(o2))) { | |
| 7263 | + let s = t2.at(-1); | |
| 7264 | + n && s?.type === "paragraph" ? (s.raw += (s.raw.endsWith(` | |
| 7265 | +`) ? "" : ` | |
| 7266 | +`) + r2.raw, s.text += ` | |
| 7267 | +` + r2.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s.text) : t2.push(r2), n = o2.length !== e2.length, e2 = e2.substring(r2.raw.length); | |
| 7268 | + continue; | |
| 7269 | + } | |
| 7270 | + if (r2 = this.tokenizer.text(e2)) { | |
| 7271 | + e2 = e2.substring(r2.raw.length); | |
| 7272 | + let s = t2.at(-1); | |
| 7273 | + s?.type === "text" ? (s.raw += (s.raw.endsWith(` | |
| 7274 | +`) ? "" : ` | |
| 7275 | +`) + r2.raw, s.text += ` | |
| 7276 | +` + r2.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s.text) : t2.push(r2); | |
| 7277 | + continue; | |
| 7278 | + } | |
| 7279 | + if (e2) { | |
| 7280 | + this.infiniteLoopError(e2.charCodeAt(0)); | |
| 7281 | + break; | |
| 7282 | + } | |
| 7283 | + } | |
| 7284 | + return this.state.top = true, t2; | |
| 7285 | + } | |
| 7286 | + inline(e2, t2 = []) { | |
| 7287 | + return this.inlineQueue.push({ src: e2, tokens: t2 }), t2; | |
| 7288 | + } | |
| 7289 | + linkInText(e2) { | |
| 7290 | + if (!e2.includes("[")) return false; | |
| 7291 | + let t2 = this.tokenizer.rules.inline.link; | |
| 7292 | + for (let n of e2.matchAll(this.tokenizer.rules.inline.blockSkip)) if (t2.test(n[0]) && e2.charAt(n.index - 1) !== "!") return true; | |
| 7293 | + for (let n of e2.matchAll(this.tokenizer.rules.inline.reflinkSearch)) { | |
| 7294 | + let i = n[0], r2 = i.lastIndexOf("["); | |
| 7295 | + if (!(i.charAt(0) === "!" || !Object.hasOwn(this.tokens.links, D2(i.slice(r2 + 1, -1)))) && !(r2 > 1 && this.linkInText(i.slice(1, r2 - 1)))) return true; | |
| 7296 | + } | |
| 7297 | + return false; | |
| 7298 | + } | |
| 7299 | + inlineTokens(e2, t2 = []) { | |
| 7300 | + this.tokenizer.lexer = this; | |
| 7301 | + let n = e2; | |
| 7302 | + if (this.tokens.links && e2.includes("[")) { | |
| 7303 | + let s = this.tokenizer.rules.inline.reflinkSearch, u = (a) => { | |
| 7304 | + let p2 = a.lastIndexOf("["); | |
| 7305 | + if (!Object.hasOwn(this.tokens.links, D2(a.slice(p2 + 1, -1)))) return a; | |
| 7306 | + if (p2 > 1 && a.charAt(0) !== "!") { | |
| 7307 | + let c2 = a.slice(1, p2 - 1); | |
| 7308 | + if (this.linkInText(c2)) return "[" + c2.replace(s, u) + "][" + "a".repeat(a.length - p2 - 2) + "]"; | |
| 7309 | + } | |
| 7310 | + return "[" + "a".repeat(a.length - 2) + "]"; | |
| 7311 | + }; | |
| 7312 | + n = n.replace(s, u); | |
| 7313 | + } | |
| 7314 | + n = n.replace(this.tokenizer.rules.inline.anyPunctuation, (s) => "+".repeat(s.length)), n = n.replace(this.tokenizer.rules.inline.blockSkip, (s, u, a) => { | |
| 7315 | + let p2 = a ? a.length : 0; | |
| 7316 | + return s.slice(0, p2) + "[" + "a".repeat(s.length - p2 - 2) + "]"; | |
| 7317 | + }), n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n; | |
| 7318 | + let i = false, r2 = "", o2 = 1 / 0; | |
| 7319 | + for (; e2; ) { | |
| 7320 | + if (e2.length < o2) o2 = e2.length; | |
| 7321 | + else { | |
| 7322 | + this.infiniteLoopError(e2.charCodeAt(0)); | |
| 7323 | + break; | |
| 7324 | + } | |
| 7325 | + i || (r2 = ""), i = false; | |
| 7326 | + let s; | |
| 7327 | + if (this.options.extensions?.inline?.some((a) => (s = a.call({ lexer: this }, e2, t2)) ? (e2 = e2.substring(s.raw.length), t2.push(s), true) : false)) continue; | |
| 7328 | + if (s = this.tokenizer.escape(e2)) { | |
| 7329 | + e2 = e2.substring(s.raw.length), t2.push(s); | |
| 7330 | + continue; | |
| 7331 | + } | |
| 7332 | + if (s = this.tokenizer.tag(e2)) { | |
| 7333 | + e2 = e2.substring(s.raw.length), t2.push(s); | |
| 7334 | + continue; | |
| 7335 | + } | |
| 7336 | + if (s = this.tokenizer.link(e2)) { | |
| 7337 | + e2 = e2.substring(s.raw.length), t2.push(s); | |
| 7338 | + continue; | |
| 7339 | + } | |
| 7340 | + if (s = this.tokenizer.reflink(e2, this.tokens.links)) { | |
| 7341 | + e2 = e2.substring(s.raw.length); | |
| 7342 | + let a = t2.at(-1); | |
| 7343 | + s.type === "text" && a?.type === "text" ? (a.raw += s.raw, a.text += s.text) : t2.push(s); | |
| 7344 | + continue; | |
| 7345 | + } | |
| 7346 | + if (s = this.tokenizer.emStrong(e2, n, r2)) { | |
| 7347 | + e2 = e2.substring(s.raw.length), t2.push(s); | |
| 7348 | + continue; | |
| 7349 | + } | |
| 7350 | + if (s = this.tokenizer.codespan(e2)) { | |
| 7351 | + e2 = e2.substring(s.raw.length), t2.push(s); | |
| 7352 | + continue; | |
| 7353 | + } | |
| 7354 | + if (s = this.tokenizer.br(e2)) { | |
| 7355 | + e2 = e2.substring(s.raw.length), t2.push(s); | |
| 7356 | + continue; | |
| 7357 | + } | |
| 7358 | + if (s = this.tokenizer.del(e2, n, r2)) { | |
| 7359 | + e2 = e2.substring(s.raw.length), t2.push(s); | |
| 7360 | + continue; | |
| 7361 | + } | |
| 7362 | + if (s = this.tokenizer.autolink(e2)) { | |
| 7363 | + e2 = e2.substring(s.raw.length), t2.push(s); | |
| 7364 | + continue; | |
| 7365 | + } | |
| 7366 | + if (!this.state.inLink && (s = this.tokenizer.url(e2))) { | |
| 7367 | + e2 = e2.substring(s.raw.length), t2.push(s); | |
| 7368 | + continue; | |
| 7369 | + } | |
| 7370 | + let u = e2; | |
| 7371 | + if (this.options.extensions?.startInline) { | |
| 7372 | + let a = 1 / 0, p2 = e2.slice(1), c2; | |
| 7373 | + this.options.extensions.startInline.forEach((h) => { | |
| 7374 | + c2 = h.call({ lexer: this }, p2), typeof c2 == "number" && c2 >= 0 && (a = Math.min(a, c2)); | |
| 7375 | + }), a < 1 / 0 && a >= 0 && (u = e2.substring(0, a + 1)); | |
| 7376 | + } | |
| 7377 | + if (s = this.tokenizer.inlineText(u)) { | |
| 7378 | + e2 = e2.substring(s.raw.length), s.raw.slice(-1) !== "_" && (r2 = s.raw.slice(-1)), i = true; | |
| 7379 | + let a = t2.at(-1); | |
| 7380 | + a?.type === "text" ? (a.raw += s.raw, a.text += s.text) : t2.push(s); | |
| 7381 | + continue; | |
| 7382 | + } | |
| 7383 | + if (e2) { | |
| 7384 | + this.infiniteLoopError(e2.charCodeAt(0)); | |
| 7385 | + break; | |
| 7386 | + } | |
| 7387 | + } | |
| 7388 | + return t2; | |
| 7389 | + } | |
| 7390 | + infiniteLoopError(e2) { | |
| 7391 | + let t2 = "Infinite loop on byte: " + e2; | |
| 7392 | + if (this.options.silent) console.error(t2); | |
| 7393 | + else throw new Error(t2); | |
| 7394 | + } | |
| 7395 | + }; | |
| 7396 | + var P = class { | |
| 7397 | + options; | |
| 7398 | + parser; | |
| 7399 | + constructor(e2) { | |
| 7400 | + this.options = e2 || T; | |
| 7401 | + } | |
| 7402 | + space(e2) { | |
| 7403 | + return ""; | |
| 7404 | + } | |
| 7405 | + code({ text: e2, lang: t2, escaped: n }) { | |
| 7406 | + let i = (t2 || "").match(m2.notSpaceStart)?.[0], r2 = e2 ? e2.replace(m2.endingNewline, "") + ` | |
| 7407 | +` : ""; | |
| 7408 | + return i ? '<pre><code class="language-' + R2(i) + '">' + (n ? r2 : R2(r2, true)) + `</code></pre> | |
| 7409 | +` : "<pre><code>" + (n ? r2 : R2(r2, true)) + `</code></pre> | |
| 7410 | +`; | |
| 7411 | + } | |
| 7412 | + blockquote({ tokens: e2 }) { | |
| 7413 | + return `<blockquote> | |
| 7414 | +${this.parser.parse(e2)}</blockquote> | |
| 7415 | +`; | |
| 7416 | + } | |
| 7417 | + html({ text: e2 }) { | |
| 7418 | + return e2; | |
| 7419 | + } | |
| 7420 | + def(e2) { | |
| 7421 | + return ""; | |
| 7422 | + } | |
| 7423 | + heading({ tokens: e2, depth: t2 }) { | |
| 7424 | + return `<h${t2}>${this.parser.parseInline(e2)}</h${t2}> | |
| 7425 | +`; | |
| 7426 | + } | |
| 7427 | + hr(e2) { | |
| 7428 | + return `<hr> | |
| 7429 | +`; | |
| 7430 | + } | |
| 7431 | + list(e2) { | |
| 7432 | + let t2 = e2.ordered, n = e2.start, i = ""; | |
| 7433 | + for (let s = 0; s < e2.items.length; s++) { | |
| 7434 | + let u = e2.items[s]; | |
| 7435 | + i += this.listitem(u); | |
| 7436 | + } | |
| 7437 | + let r2 = t2 ? "ol" : "ul", o2 = t2 && n !== 1 ? ' start="' + n + '"' : ""; | |
| 7438 | + return "<" + r2 + o2 + `> | |
| 7439 | +` + i + "</" + r2 + `> | |
| 7440 | +`; | |
| 7441 | + } | |
| 7442 | + listitem(e2) { | |
| 7443 | + return `<li>${this.parser.parse(e2.tokens)}</li> | |
| 7444 | +`; | |
| 7445 | + } | |
| 7446 | + checkbox({ checked: e2 }) { | |
| 7447 | + return "<input " + (e2 ? 'checked="" ' : "") + 'disabled="" type="checkbox"> '; | |
| 7448 | + } | |
| 7449 | + paragraph({ tokens: e2 }) { | |
| 7450 | + return `<p>${this.parser.parseInline(e2)}</p> | |
| 7451 | +`; | |
| 7452 | + } | |
| 7453 | + table(e2) { | |
| 7454 | + let t2 = "", n = ""; | |
| 7455 | + for (let r2 = 0; r2 < e2.header.length; r2++) n += this.tablecell(e2.header[r2]); | |
| 7456 | + t2 += this.tablerow({ text: n }); | |
| 7457 | + let i = ""; | |
| 7458 | + for (let r2 = 0; r2 < e2.rows.length; r2++) { | |
| 7459 | + let o2 = e2.rows[r2]; | |
| 7460 | + n = ""; | |
| 7461 | + for (let s = 0; s < o2.length; s++) n += this.tablecell(o2[s]); | |
| 7462 | + i += this.tablerow({ text: n }); | |
| 7463 | + } | |
| 7464 | + return i && (i = `<tbody>${i}</tbody>`), `<table> | |
| 7465 | +<thead> | |
| 7466 | +` + t2 + `</thead> | |
| 7467 | +` + i + `</table> | |
| 7468 | +`; | |
| 7469 | + } | |
| 7470 | + tablerow({ text: e2 }) { | |
| 7471 | + return `<tr> | |
| 7472 | +${e2}</tr> | |
| 7473 | +`; | |
| 7474 | + } | |
| 7475 | + tablecell(e2) { | |
| 7476 | + let t2 = this.parser.parseInline(e2.tokens), n = e2.header ? "th" : "td"; | |
| 7477 | + return (e2.align ? `<${n} align="${e2.align}">` : `<${n}>`) + t2 + `</${n}> | |
| 7478 | +`; | |
| 7479 | + } | |
| 7480 | + strong({ tokens: e2 }) { | |
| 7481 | + return `<strong>${this.parser.parseInline(e2)}</strong>`; | |
| 7482 | + } | |
| 7483 | + em({ tokens: e2 }) { | |
| 7484 | + return `<em>${this.parser.parseInline(e2)}</em>`; | |
| 7485 | + } | |
| 7486 | + codespan({ text: e2 }) { | |
| 7487 | + return `<code>${R2(e2, true)}</code>`; | |
| 7488 | + } | |
| 7489 | + br(e2) { | |
| 7490 | + return "<br>"; | |
| 7491 | + } | |
| 7492 | + del({ tokens: e2 }) { | |
| 7493 | + return `<del>${this.parser.parseInline(e2)}</del>`; | |
| 7494 | + } | |
| 7495 | + link({ href: e2, title: t2, text: n, tokens: i, autolink: r2 }) { | |
| 7496 | + let o2 = r2 ? R2(n, true) : this.parser.parseInline(i), s = ee(e2); | |
| 7497 | + if (s === null) return o2; | |
| 7498 | + e2 = R2(s, r2); | |
| 7499 | + let u = '<a href="' + e2 + '"'; | |
| 7500 | + return t2 && (u += ' title="' + R2(t2) + '"'), u += ">" + o2 + "</a>", u; | |
| 7501 | + } | |
| 7502 | + image({ href: e2, title: t2, text: n, tokens: i }) { | |
| 7503 | + i && (n = this.parser.parseInline(i, this.parser.textRenderer)); | |
| 7504 | + let r2 = ee(e2); | |
| 7505 | + if (r2 === null) return R2(n); | |
| 7506 | + e2 = r2; | |
| 7507 | + let o2 = `<img src="${R2(e2)}" alt="${R2(n)}"`; | |
| 7508 | + return t2 && (o2 += ` title="${R2(t2)}"`), o2 += ">", o2; | |
| 7509 | + } | |
| 7510 | + text(e2) { | |
| 7511 | + return "tokens" in e2 && e2.tokens ? this.parser.parseInline(e2.tokens) : "escaped" in e2 && e2.escaped ? e2.text : R2(e2.text); | |
| 7512 | + } | |
| 7513 | + }; | |
| 7514 | + var L = class { | |
| 7515 | + strong({ text: e2 }) { | |
| 7516 | + return e2; | |
| 7517 | + } | |
| 7518 | + em({ text: e2 }) { | |
| 7519 | + return e2; | |
| 7520 | + } | |
| 7521 | + codespan({ text: e2 }) { | |
| 7522 | + return e2; | |
| 7523 | + } | |
| 7524 | + del({ text: e2 }) { | |
| 7525 | + return e2; | |
| 7526 | + } | |
| 7527 | + html({ text: e2 }) { | |
| 7528 | + return e2; | |
| 7529 | + } | |
| 7530 | + text({ text: e2 }) { | |
| 7531 | + return e2; | |
| 7532 | + } | |
| 7533 | + link({ text: e2 }) { | |
| 7534 | + return "" + e2; | |
| 7535 | + } | |
| 7536 | + image({ text: e2 }) { | |
| 7537 | + return "" + e2; | |
| 7538 | + } | |
| 7539 | + br() { | |
| 7540 | + return ""; | |
| 7541 | + } | |
| 7542 | + checkbox({ raw: e2 }) { | |
| 7543 | + return e2; | |
| 7544 | + } | |
| 7545 | + }; | |
| 7546 | + var b = class l3 { | |
| 7547 | + options; | |
| 7548 | + renderer; | |
| 7549 | + textRenderer; | |
| 7550 | + constructor(e2) { | |
| 7551 | + this.options = e2 || T, this.options.renderer = this.options.renderer || new P(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new L(); | |
| 7552 | + } | |
| 7553 | + static parse(e2, t2) { | |
| 7554 | + return new l3(t2).parse(e2); | |
| 7555 | + } | |
| 7556 | + static parseInline(e2, t2) { | |
| 7557 | + return new l3(t2).parseInline(e2); | |
| 7558 | + } | |
| 7559 | + parse(e2) { | |
| 7560 | + this.renderer.parser = this; | |
| 7561 | + let t2 = ""; | |
| 7562 | + for (let n = 0; n < e2.length; n++) { | |
| 7563 | + let i = e2[n]; | |
| 7564 | + if (this.options.extensions?.renderers?.[i.type]) { | |
| 7565 | + let o2 = i, s = this.options.extensions.renderers[o2.type].call({ parser: this }, o2); | |
| 7566 | + if (s !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "checkbox", "html", "def", "paragraph", "text"].includes(o2.type)) { | |
| 7567 | + t2 += s || ""; | |
| 7568 | + continue; | |
| 7569 | + } | |
| 7570 | + } | |
| 7571 | + let r2 = i; | |
| 7572 | + switch (r2.type) { | |
| 7573 | + case "space": { | |
| 7574 | + t2 += this.renderer.space(r2); | |
| 7575 | + break; | |
| 7576 | + } | |
| 7577 | + case "hr": { | |
| 7578 | + t2 += this.renderer.hr(r2); | |
| 7579 | + break; | |
| 7580 | + } | |
| 7581 | + case "heading": { | |
| 7582 | + t2 += this.renderer.heading(r2); | |
| 7583 | + break; | |
| 7584 | + } | |
| 7585 | + case "code": { | |
| 7586 | + t2 += this.renderer.code(r2); | |
| 7587 | + break; | |
| 7588 | + } | |
| 7589 | + case "table": { | |
| 7590 | + t2 += this.renderer.table(r2); | |
| 7591 | + break; | |
| 7592 | + } | |
| 7593 | + case "blockquote": { | |
| 7594 | + t2 += this.renderer.blockquote(r2); | |
| 7595 | + break; | |
| 7596 | + } | |
| 7597 | + case "list": { | |
| 7598 | + t2 += this.renderer.list(r2); | |
| 7599 | + break; | |
| 7600 | + } | |
| 7601 | + case "checkbox": { | |
| 7602 | + t2 += this.renderer.checkbox(r2); | |
| 7603 | + break; | |
| 7604 | + } | |
| 7605 | + case "html": { | |
| 7606 | + t2 += this.renderer.html(r2); | |
| 7607 | + break; | |
| 7608 | + } | |
| 7609 | + case "def": { | |
| 7610 | + t2 += this.renderer.def(r2); | |
| 7611 | + break; | |
| 7612 | + } | |
| 7613 | + case "paragraph": { | |
| 7614 | + t2 += this.renderer.paragraph(r2); | |
| 7615 | + break; | |
| 7616 | + } | |
| 7617 | + case "text": { | |
| 7618 | + t2 += this.renderer.text(r2); | |
| 7619 | + break; | |
| 7620 | + } | |
| 7621 | + default: { | |
| 7622 | + let o2 = 'Token with "' + r2.type + '" type was not found.'; | |
| 7623 | + if (this.options.silent) return console.error(o2), ""; | |
| 7624 | + throw new Error(o2); | |
| 7625 | + } | |
| 7626 | + } | |
| 7627 | + } | |
| 7628 | + return t2; | |
| 7629 | + } | |
| 7630 | + parseInline(e2, t2 = this.renderer) { | |
| 7631 | + this.renderer.parser = this; | |
| 7632 | + let n = ""; | |
| 7633 | + for (let i = 0; i < e2.length; i++) { | |
| 7634 | + let r2 = e2[i]; | |
| 7635 | + if (this.options.extensions?.renderers?.[r2.type]) { | |
| 7636 | + let s = this.options.extensions.renderers[r2.type].call({ parser: this }, r2); | |
| 7637 | + if (s !== false || !["escape", "html", "link", "image", "checkbox", "strong", "em", "codespan", "br", "del", "text"].includes(r2.type)) { | |
| 7638 | + n += s || ""; | |
| 7639 | + continue; | |
| 7640 | + } | |
| 7641 | + } | |
| 7642 | + let o2 = r2; | |
| 7643 | + switch (o2.type) { | |
| 7644 | + case "escape": { | |
| 7645 | + n += t2.text(o2); | |
| 7646 | + break; | |
| 7647 | + } | |
| 7648 | + case "html": { | |
| 7649 | + n += t2.html(o2); | |
| 7650 | + break; | |
| 7651 | + } | |
| 7652 | + case "link": { | |
| 7653 | + n += t2.link(o2); | |
| 7654 | + break; | |
| 7655 | + } | |
| 7656 | + case "image": { | |
| 7657 | + n += t2.image(o2); | |
| 7658 | + break; | |
| 7659 | + } | |
| 7660 | + case "checkbox": { | |
| 7661 | + n += t2.checkbox(o2); | |
| 7662 | + break; | |
| 7663 | + } | |
| 7664 | + case "strong": { | |
| 7665 | + n += t2.strong(o2); | |
| 7666 | + break; | |
| 7667 | + } | |
| 7668 | + case "em": { | |
| 7669 | + n += t2.em(o2); | |
| 7670 | + break; | |
| 7671 | + } | |
| 7672 | + case "codespan": { | |
| 7673 | + n += t2.codespan(o2); | |
| 7674 | + break; | |
| 7675 | + } | |
| 7676 | + case "br": { | |
| 7677 | + n += t2.br(o2); | |
| 7678 | + break; | |
| 7679 | + } | |
| 7680 | + case "del": { | |
| 7681 | + n += t2.del(o2); | |
| 7682 | + break; | |
| 7683 | + } | |
| 7684 | + case "text": { | |
| 7685 | + n += t2.text(o2); | |
| 7686 | + break; | |
| 7687 | + } | |
| 7688 | + default: { | |
| 7689 | + let s = 'Token with "' + o2.type + '" type was not found.'; | |
| 7690 | + if (this.options.silent) return console.error(s), ""; | |
| 7691 | + throw new Error(s); | |
| 7692 | + } | |
| 7693 | + } | |
| 7694 | + } | |
| 7695 | + return n; | |
| 7696 | + } | |
| 7697 | + }; | |
| 7698 | + var S = class { | |
| 7699 | + options; | |
| 7700 | + block; | |
| 7701 | + constructor(e2) { | |
| 7702 | + this.options = e2 || T; | |
| 7703 | + } | |
| 7704 | + static passThroughHooks = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"]); | |
| 7705 | + static passThroughHooksRespectAsync = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"]); | |
| 7706 | + preprocess(e2) { | |
| 7707 | + return e2; | |
| 7708 | + } | |
| 7709 | + postprocess(e2) { | |
| 7710 | + return e2; | |
| 7711 | + } | |
| 7712 | + processAllTokens(e2) { | |
| 7713 | + return e2; | |
| 7714 | + } | |
| 7715 | + emStrongMask(e2) { | |
| 7716 | + return e2; | |
| 7717 | + } | |
| 7718 | + provideLexer(e2 = this.block) { | |
| 7719 | + return e2 ? x2.lex : x2.lexInline; | |
| 7720 | + } | |
| 7721 | + provideParser(e2 = this.block) { | |
| 7722 | + return e2 ? b.parse : b.parseInline; | |
| 7723 | + } | |
| 7724 | + }; | |
| 7725 | + var Q = class { | |
| 7726 | + defaults = A2(); | |
| 7727 | + options = this.setOptions; | |
| 7728 | + parse = this.parseMarkdown(true); | |
| 7729 | + parseInline = this.parseMarkdown(false); | |
| 7730 | + Parser = b; | |
| 7731 | + Renderer = P; | |
| 7732 | + TextRenderer = L; | |
| 7733 | + Lexer = x2; | |
| 7734 | + Tokenizer = y2; | |
| 7735 | + Hooks = S; | |
| 7736 | + constructor(...e2) { | |
| 7737 | + this.use(...e2); | |
| 7738 | + } | |
| 7739 | + walkTokens(e2, t2) { | |
| 7740 | + let n = []; | |
| 7741 | + for (let i of e2) switch (n = n.concat(t2.call(this, i)), i.type) { | |
| 7742 | + case "table": { | |
| 7743 | + let r2 = i; | |
| 7744 | + for (let o2 of r2.header) n = n.concat(this.walkTokens(o2.tokens, t2)); | |
| 7745 | + for (let o2 of r2.rows) for (let s of o2) n = n.concat(this.walkTokens(s.tokens, t2)); | |
| 7746 | + break; | |
| 7747 | + } | |
| 7748 | + case "list": { | |
| 7749 | + let r2 = i; | |
| 7750 | + n = n.concat(this.walkTokens(r2.items, t2)); | |
| 7751 | + break; | |
| 7752 | + } | |
| 7753 | + default: { | |
| 7754 | + let r2 = i; | |
| 7755 | + this.defaults.extensions?.childTokens?.[r2.type] ? this.defaults.extensions.childTokens[r2.type].forEach((o2) => { | |
| 7756 | + let s = r2[o2].flat(1 / 0); | |
| 7757 | + n = n.concat(this.walkTokens(s, t2)); | |
| 7758 | + }) : r2.tokens && (n = n.concat(this.walkTokens(r2.tokens, t2))); | |
| 7759 | + } | |
| 7760 | + } | |
| 7761 | + return n; | |
| 7762 | + } | |
| 7763 | + use(...e2) { | |
| 7764 | + let t2 = this.defaults.extensions || { renderers: {}, childTokens: {} }; | |
| 7765 | + return e2.forEach((n) => { | |
| 7766 | + let i = { ...n }; | |
| 7767 | + if (i.async = this.defaults.async || i.async || false, n.extensions && (n.extensions.forEach((r2) => { | |
| 7768 | + if (!r2.name) throw new Error("extension name required"); | |
| 7769 | + if ("renderer" in r2) { | |
| 7770 | + let o2 = t2.renderers[r2.name]; | |
| 7771 | + o2 ? t2.renderers[r2.name] = function(...s) { | |
| 7772 | + let u = r2.renderer.apply(this, s); | |
| 7773 | + return u === false && (u = o2.apply(this, s)), u; | |
| 7774 | + } : t2.renderers[r2.name] = r2.renderer; | |
| 7775 | + } | |
| 7776 | + if ("tokenizer" in r2) { | |
| 7777 | + if (!r2.level || r2.level !== "block" && r2.level !== "inline") throw new Error("extension level must be 'block' or 'inline'"); | |
| 7778 | + let o2 = t2[r2.level]; | |
| 7779 | + o2 ? o2.unshift(r2.tokenizer) : t2[r2.level] = [r2.tokenizer], r2.start && (r2.level === "block" ? t2.startBlock ? t2.startBlock.push(r2.start) : t2.startBlock = [r2.start] : r2.level === "inline" && (t2.startInline ? t2.startInline.push(r2.start) : t2.startInline = [r2.start])); | |
| 7780 | + } | |
| 7781 | + "childTokens" in r2 && r2.childTokens && (t2.childTokens[r2.name] = r2.childTokens); | |
| 7782 | + }), i.extensions = t2), n.renderer) { | |
| 7783 | + let r2 = this.defaults.renderer || new P(this.defaults); | |
| 7784 | + for (let o2 in n.renderer) { | |
| 7785 | + if (!(o2 in r2)) throw new Error(`renderer '${o2}' does not exist`); | |
| 7786 | + if (["options", "parser"].includes(o2)) continue; | |
| 7787 | + let s = o2, u = n.renderer[s], a = r2[s]; | |
| 7788 | + r2[s] = (...p2) => { | |
| 7789 | + let c2 = u.apply(r2, p2); | |
| 7790 | + return c2 === false && (c2 = a.apply(r2, p2)), c2 || ""; | |
| 7791 | + }; | |
| 7792 | + } | |
| 7793 | + i.renderer = r2; | |
| 7794 | + } | |
| 7795 | + if (n.tokenizer) { | |
| 7796 | + let r2 = this.defaults.tokenizer || new y2(this.defaults); | |
| 7797 | + for (let o2 in n.tokenizer) { | |
| 7798 | + if (!(o2 in r2)) throw new Error(`tokenizer '${o2}' does not exist`); | |
| 7799 | + if (["options", "rules", "lexer"].includes(o2)) continue; | |
| 7800 | + let s = o2, u = n.tokenizer[s], a = r2[s]; | |
| 7801 | + r2[s] = (...p2) => { | |
| 7802 | + let c2 = u.apply(r2, p2); | |
| 7803 | + return c2 === false && (c2 = a.apply(r2, p2)), c2; | |
| 7804 | + }; | |
| 7805 | + } | |
| 7806 | + i.tokenizer = r2; | |
| 7807 | + } | |
| 7808 | + if (n.hooks) { | |
| 7809 | + let r2 = this.defaults.hooks || new S(); | |
| 7810 | + for (let o2 in n.hooks) { | |
| 7811 | + if (!(o2 in r2)) throw new Error(`hook '${o2}' does not exist`); | |
| 7812 | + if (["options", "block"].includes(o2)) continue; | |
| 7813 | + let s = o2, u = n.hooks[s], a = r2[s]; | |
| 7814 | + S.passThroughHooks.has(o2) ? r2[s] = (p2) => { | |
| 7815 | + if (this.defaults.async && S.passThroughHooksRespectAsync.has(o2)) return (async () => { | |
| 7816 | + let h = await u.call(r2, p2); | |
| 7817 | + return a.call(r2, h); | |
| 7818 | + })(); | |
| 7819 | + let c2 = u.call(r2, p2); | |
| 7820 | + return a.call(r2, c2); | |
| 7821 | + } : r2[s] = (...p2) => { | |
| 7822 | + if (this.defaults.async) return (async () => { | |
| 7823 | + let h = await u.apply(r2, p2); | |
| 7824 | + return h === false && (h = await a.apply(r2, p2)), h; | |
| 7825 | + })(); | |
| 7826 | + let c2 = u.apply(r2, p2); | |
| 7827 | + return c2 === false && (c2 = a.apply(r2, p2)), c2; | |
| 7828 | + }; | |
| 7829 | + } | |
| 7830 | + i.hooks = r2; | |
| 7831 | + } | |
| 7832 | + if (n.walkTokens) { | |
| 7833 | + let r2 = this.defaults.walkTokens, o2 = n.walkTokens; | |
| 7834 | + i.walkTokens = function(s) { | |
| 7835 | + let u = []; | |
| 7836 | + return u.push(o2.call(this, s)), r2 && (u = u.concat(r2.call(this, s))), u; | |
| 7837 | + }; | |
| 7838 | + } | |
| 7839 | + this.defaults = { ...this.defaults, ...i }; | |
| 7840 | + }), this; | |
| 7841 | + } | |
| 7842 | + setOptions(e2) { | |
| 7843 | + return this.defaults = { ...this.defaults, ...e2 }, this; | |
| 7844 | + } | |
| 7845 | + lexer(e2, t2) { | |
| 7846 | + return x2.lex(e2, t2 ?? this.defaults); | |
| 7847 | + } | |
| 7848 | + parser(e2, t2) { | |
| 7849 | + return b.parse(e2, t2 ?? this.defaults); | |
| 7850 | + } | |
| 7851 | + parseMarkdown(e2) { | |
| 7852 | + return (n, i) => { | |
| 7853 | + let r2 = { ...i }, o2 = { ...this.defaults, ...r2 }, s = this.onError(!!o2.silent, !!o2.async); | |
| 7854 | + if (this.defaults.async === true && r2.async === false) return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.")); | |
| 7855 | + if (typeof n > "u" || n === null) return s(new Error("marked(): input parameter is undefined or null")); | |
| 7856 | + if (typeof n != "string") return s(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected")); | |
| 7857 | + if (o2.hooks && (o2.hooks.options = o2, o2.hooks.block = e2), o2.async) return (async () => { | |
| 7858 | + let u = o2.hooks ? await o2.hooks.preprocess(n) : n, p2 = await (o2.hooks ? await o2.hooks.provideLexer(e2) : e2 ? x2.lex : x2.lexInline)(u, o2), c2 = o2.hooks ? await o2.hooks.processAllTokens(p2) : p2; | |
| 7859 | + o2.walkTokens && await Promise.all(this.walkTokens(c2, o2.walkTokens)); | |
| 7860 | + let k2 = await (o2.hooks ? await o2.hooks.provideParser(e2) : e2 ? b.parse : b.parseInline)(c2, o2); | |
| 7861 | + return o2.hooks ? await o2.hooks.postprocess(k2) : k2; | |
| 7862 | + })().catch(s); | |
| 7863 | + try { | |
| 7864 | + o2.hooks && (n = o2.hooks.preprocess(n)); | |
| 7865 | + let a = (o2.hooks ? o2.hooks.provideLexer(e2) : e2 ? x2.lex : x2.lexInline)(n, o2); | |
| 7866 | + o2.hooks && (a = o2.hooks.processAllTokens(a)), o2.walkTokens && this.walkTokens(a, o2.walkTokens); | |
| 7867 | + let c2 = (o2.hooks ? o2.hooks.provideParser(e2) : e2 ? b.parse : b.parseInline)(a, o2); | |
| 7868 | + return o2.hooks && (c2 = o2.hooks.postprocess(c2)), c2; | |
| 7869 | + } catch (u) { | |
| 7870 | + return s(u); | |
| 7871 | + } | |
| 7872 | + }; | |
| 7873 | + } | |
| 7874 | + onError(e2, t2) { | |
| 7875 | + return (n) => { | |
| 7876 | + if (n.message += ` | |
| 7877 | +Please report this to https://github.com/markedjs/marked.`, e2) { | |
| 7878 | + let i = "<p>An error occurred:</p><pre>" + R2(n.message + "", true) + "</pre>"; | |
| 7879 | + return t2 ? Promise.resolve(i) : i; | |
| 7880 | + } | |
| 7881 | + if (t2) return Promise.reject(n); | |
| 7882 | + throw n; | |
| 7883 | + }; | |
| 7884 | + } | |
| 7885 | + }; | |
| 7886 | + var M2 = new Q(); | |
| 7887 | + function f(l4, e2) { | |
| 7888 | + return M2.parse(l4, e2); | |
| 7889 | + } | |
| 7890 | + f.options = f.setOptions = function(l4) { | |
| 7891 | + return M2.setOptions(l4), f.defaults = M2.defaults, U(f.defaults), f; | |
| 7892 | + }; | |
| 7893 | + f.getDefaults = A2; | |
| 7894 | + f.defaults = T; | |
| 7895 | + function bt(...l4) { | |
| 7896 | + return M2.use(...l4), f.defaults = M2.defaults, U(f.defaults), f; | |
| 7897 | + } | |
| 7898 | + f.use = bt; | |
| 7899 | + f.walkTokens = function(l4, e2) { | |
| 7900 | + return M2.walkTokens(l4, e2); | |
| 7901 | + }; | |
| 7902 | + f.parseInline = M2.parseInline; | |
| 7903 | + f.Parser = b; | |
| 7904 | + f.parser = b.parse; | |
| 7905 | + f.Renderer = P; | |
| 7906 | + f.TextRenderer = L; | |
| 7907 | + f.Lexer = x2; | |
| 7908 | + f.lexer = x2.lex; | |
| 7909 | + f.Tokenizer = y2; | |
| 7910 | + f.Hooks = S; | |
| 7911 | + f.parse = f; | |
| 7912 | + var un = f.options; | |
| 7913 | + var pn = f.setOptions; | |
| 7914 | + var cn = f.walkTokens; | |
| 7915 | + var hn = f.parseInline; | |
| 7916 | + var kn = b.parse; | |
| 7917 | + var gn = x2.lex; | |
| 7918 | + | |
| 10040 | 7919 | // packages/blocks/build-module/api/raw-handling/markdown-converter.mjs |
| 10041 | - var import_showdown = __toESM(require_showdown(), 1); | |
| 10042 | - var converter = new import_showdown.default.Converter({ | |
| 10043 | - noHeaderId: true, | |
| 10044 | - tables: true, | |
| 10045 | - literalMidWordUnderscores: true, | |
| 10046 | - omitExtraWLInCodeBlocks: true, | |
| 10047 | - simpleLineBreaks: true, | |
| 10048 | - strikethrough: true | |
| 7920 | + function escapeBodyText(value) { | |
| 7921 | + return value.replace(/&(?!#?\w+;)/g, "&").replace(/</g, "<").replace(/>/g, ">"); | |
| 7922 | + } | |
| 7923 | + var converter = new Q({ | |
| 7924 | + gfm: true, | |
| 7925 | + breaks: true, | |
| 7926 | + renderer: { | |
| 7927 | + // Match showdown's `omitExtraWLInCodeBlocks`: marked appends `\n` | |
| 7928 | + // before `</code>`, which leaks into the Code block's content as a | |
| 7929 | + // trailing blank line. | |
| 7930 | + code({ text: text2, lang }) { | |
| 7931 | + const language = (lang || "").match(/^\S*/)?.[0]; | |
| 7932 | + const cls = language ? ` class="${language} language-${language}"` : ""; | |
| 7933 | + return `<pre><code${cls}>${escapeBodyText( | |
| 7934 | + text2 | |
| 7935 | + )}</code></pre>`; | |
| 7936 | + }, | |
| 7937 | + text(token) { | |
| 7938 | + if ("tokens" in token && token.tokens || "escaped" in token && token.escaped) { | |
| 7939 | + return false; | |
| 7940 | + } | |
| 7941 | + return escapeBodyText(token.text); | |
| 7942 | + } | |
| 7943 | + } | |
| 10049 | 7944 | }); |
| 10050 | 7945 | function slackMarkdownVariantCorrector(text2) { |
| 10051 | 7946 | return text2.replace( |
| 10052 | 7947 | /((?:^|\n)```)([^\n`]+)(```(?:$|\n))/, |
| @@ -10057,11 +7952,26 @@ | ||
| 10057 | 7952 | } |
| 10058 | 7953 | function bulletsToAsterisks(text2) { |
| 10059 | 7954 | return text2.replace(/(^|\n)•( +)/g, "$1*$2"); |
| 10060 | 7955 | } |
| 7956 | + function escapeSingleLineOrderedListMarker(text2) { | |
| 7957 | + if (text2.includes("\n")) { | |
| 7958 | + return text2; | |
| 7959 | + } | |
| 7960 | + return text2.replace(/^(\d+)\.(\s)/, "$1\\.$2"); | |
| 7961 | + } | |
| 7962 | + var correctors = [ | |
| 7963 | + escapeSingleLineOrderedListMarker, | |
| 7964 | + bulletsToAsterisks, | |
| 7965 | + slackMarkdownVariantCorrector | |
| 7966 | + ]; | |
| 10061 | 7967 | function markdownConverter(text2) { |
| 10062 | - return converter.makeHtml( | |
| 10063 | - slackMarkdownVariantCorrector(bulletsToAsterisks(text2)) | |
| 7968 | + return converter.parse( | |
| 7969 | + correctors.reduce( | |
| 7970 | + (current, corrector) => corrector(current), | |
| 7971 | + text2 | |
| 7972 | + ), | |
| 7973 | + { async: false } | |
| 10064 | 7974 | ); |
| 10065 | 7975 | } |
| 10066 | 7976 | |
| 10067 | 7977 | // packages/blocks/build-module/api/raw-handling/iframe-remover.mjs |
| @@ -10121,8 +8031,37 @@ | ||
| 10121 | 8031 | textNode.data = newData; |
| 10122 | 8032 | } |
| 10123 | 8033 | } |
| 10124 | 8034 | |
| 8035 | + // packages/blocks/build-module/api/raw-handling/format-space-corrector.mjs | |
| 8036 | + var import_dom11 = __toESM(require_dom(), 1); | |
| 8037 | + function moveEdgeSpace(node, doc, isLeading) { | |
| 8038 | + const child = isLeading ? node.firstChild : node.lastChild; | |
| 8039 | + if (!child || child.nodeType !== node.TEXT_NODE) { | |
| 8040 | + return; | |
| 8041 | + } | |
| 8042 | + const text2 = child; | |
| 8043 | + const edgeIndex = isLeading ? 0 : text2.data.length - 1; | |
| 8044 | + if (text2.data[edgeIndex] !== " ") { | |
| 8045 | + return; | |
| 8046 | + } | |
| 8047 | + text2.data = isLeading ? text2.data.slice(1) : text2.data.slice(0, -1); | |
| 8048 | + if (!text2.data) { | |
| 8049 | + node.removeChild(text2); | |
| 8050 | + } | |
| 8051 | + node.parentNode.insertBefore( | |
| 8052 | + doc.createTextNode(" "), | |
| 8053 | + isLeading ? node : node.nextSibling | |
| 8054 | + ); | |
| 8055 | + } | |
| 8056 | + function formatSpaceCorrector(node, doc) { | |
| 8057 | + if (node.nodeType !== node.ELEMENT_NODE || !(0, import_dom11.isPhrasingContent)(node)) { | |
| 8058 | + return; | |
| 8059 | + } | |
| 8060 | + moveEdgeSpace(node, doc, true); | |
| 8061 | + moveEdgeSpace(node, doc, false); | |
| 8062 | + } | |
| 8063 | + | |
| 10125 | 8064 | // packages/blocks/build-module/api/raw-handling/br-remover.mjs |
| 10126 | 8065 | function brRemover(node) { |
| 10127 | 8066 | if (node.nodeName !== "BR") { |
| 10128 | 8067 | return; |
| @@ -10178,13 +8117,13 @@ | ||
| 10178 | 8117 | if (/\\[a-zA-Z]+\s*\{/g.test(text2)) { |
| 10179 | 8118 | return true; |
| 10180 | 8119 | } |
| 10181 | 8120 | const softClues = [ |
| 10182 | - (t3) => t3.includes("^") && !t3.startsWith("^"), | |
| 10183 | - (t3) => ["=", "+", "-", "/", "*"].some( | |
| 10184 | - (operator) => t3.includes(operator) | |
| 8121 | + (t2) => t2.includes("^") && !t2.startsWith("^"), | |
| 8122 | + (t2) => ["=", "+", "-", "/", "*"].some( | |
| 8123 | + (operator) => t2.includes(operator) | |
| 10185 | 8124 | ), |
| 10186 | - (t3) => /\\[a-zA-Z]+/g.test(t3) | |
| 8125 | + (t2) => /\\[a-zA-Z]+/g.test(t2) | |
| 10187 | 8126 | ]; |
| 10188 | 8127 | if (softClues.filter((clue) => clue(text2)).length >= 2) { |
| 10189 | 8128 | return true; |
| 10190 | 8129 | } |
| @@ -10224,14 +8163,18 @@ | ||
| 10224 | 8163 | msListIgnore, |
| 10225 | 8164 | phrasingContentReducer, |
| 10226 | 8165 | commentRemover |
| 10227 | 8166 | ]); |
| 10228 | - HTML = (0, import_dom11.removeInvalidHTML)( | |
| 8167 | + HTML = (0, import_dom12.removeInvalidHTML)( | |
| 10229 | 8168 | HTML, |
| 10230 | - (0, import_dom11.getPhrasingContentSchema)("paste"), | |
| 8169 | + (0, import_dom12.getPhrasingContentSchema)("paste"), | |
| 10231 | 8170 | true |
| 10232 | 8171 | ); |
| 10233 | - HTML = deepFilterHTML(HTML, [htmlFormattingRemover, brRemover]); | |
| 8172 | + HTML = deepFilterHTML(HTML, [ | |
| 8173 | + htmlFormattingRemover, | |
| 8174 | + formatSpaceCorrector, | |
| 8175 | + brRemover | |
| 8176 | + ]); | |
| 10234 | 8177 | log("Processed inline HTML:\n\n", HTML); |
| 10235 | 8178 | return HTML; |
| 10236 | 8179 | } |
| 10237 | 8180 | function pasteHandler({ |
| @@ -10285,9 +8228,9 @@ | ||
| 10285 | 8228 | } |
| 10286 | 8229 | if (mode === "AUTO" && !hasShortcodes && isInlineContent(HTML, tagName)) { |
| 10287 | 8230 | return filterInlineHTML(HTML); |
| 10288 | 8231 | } |
| 10289 | - const phrasingContentSchema = (0, import_dom11.getPhrasingContentSchema)("paste"); | |
| 8232 | + const phrasingContentSchema = (0, import_dom12.getPhrasingContentSchema)("paste"); | |
| 10290 | 8233 | const blockContentSchema = getBlockContentSchema("paste"); |
| 10291 | 8234 | const blocks = pieces.map((piece) => { |
| 10292 | 8235 | if (typeof piece !== "string") { |
| 10293 | 8236 | return piece; |
| @@ -10312,13 +8255,18 @@ | ||
| 10312 | 8255 | // Keep top-level phrasing content, normalised by `normaliseBlocks`. |
| 10313 | 8256 | ...phrasingContentSchema |
| 10314 | 8257 | }; |
| 10315 | 8258 | piece = deepFilterHTML(piece, filters, blockContentSchema); |
| 10316 | - piece = (0, import_dom11.removeInvalidHTML)(piece, schema, false); | |
| 8259 | + piece = (0, import_dom12.removeInvalidHTML)(piece, schema, false); | |
| 10317 | 8260 | piece = normaliseBlocks(piece); |
| 10318 | 8261 | piece = deepFilterHTML( |
| 10319 | 8262 | piece, |
| 10320 | - [htmlFormattingRemover, brRemover, emptyParagraphRemover], | |
| 8263 | + [ | |
| 8264 | + htmlFormattingRemover, | |
| 8265 | + formatSpaceCorrector, | |
| 8266 | + brRemover, | |
| 8267 | + emptyParagraphRemover | |
| 8268 | + ], | |
| 10321 | 8269 | blockContentSchema |
| 10322 | 8270 | ); |
| 10323 | 8271 | log("Processed HTML piece:\n\n", piece); |
| 10324 | 8272 | return htmlToBlocks(piece, pasteHandler); |
| @@ -10326,9 +8274,9 @@ | ||
| 10326 | 8274 | if (mode === "AUTO" && blocks.length === 1 && hasBlockSupport(blocks[0].name, "__unstablePasteTextInline", false)) { |
| 10327 | 8275 | const trimRegex = /^[\n]+|[\n]+$/g; |
| 10328 | 8276 | const trimmedPlainText = plainText.replace(trimRegex, ""); |
| 10329 | 8277 | if (trimmedPlainText !== "" && trimmedPlainText.indexOf("\n") === -1) { |
| 10330 | - return (0, import_dom11.removeInvalidHTML)( | |
| 8278 | + return (0, import_dom12.removeInvalidHTML)( | |
| 10331 | 8279 | getBlockInnerHTML(blocks[0]), |
| 10332 | 8280 | phrasingContentSchema, |
| 10333 | 8281 | false |
| 10334 | 8282 | ).replace(trimRegex, ""); |
| @@ -10338,13 +8286,13 @@ | ||
| 10338 | 8286 | } |
| 10339 | 8287 | |
| 10340 | 8288 | // packages/blocks/build-module/api/raw-handling/index.mjs |
| 10341 | 8289 | function deprecatedGetPhrasingContentSchema(context) { |
| 10342 | - (0, import_deprecated10.default)("wp.blocks.getPhrasingContentSchema", { | |
| 8290 | + (0, import_deprecated11.default)("wp.blocks.getPhrasingContentSchema", { | |
| 10343 | 8291 | since: "5.6", |
| 10344 | 8292 | alternative: "wp.dom.getPhrasingContentSchema" |
| 10345 | 8293 | }); |
| 10346 | - return (0, import_dom12.getPhrasingContentSchema)(context); | |
| 8294 | + return (0, import_dom13.getPhrasingContentSchema)(context); | |
| 10347 | 8295 | } |
| 10348 | 8296 | function rawHandler({ HTML = "" }) { |
| 10349 | 8297 | if (HTML.indexOf("<!-- wp:") !== -1) { |
| 10350 | 8298 | const parseResult = parse2(HTML); |
| @@ -10388,9 +8336,9 @@ | ||
| 10388 | 8336 | (0, import_data6.dispatch)(store).updateCategory(slug, category); |
| 10389 | 8337 | } |
| 10390 | 8338 | |
| 10391 | 8339 | // packages/blocks/build-module/api/templates.mjs |
| 10392 | - var import_element5 = __toESM(require_element(), 1); | |
| 8340 | + var import_element4 = __toESM(require_element(), 1); | |
| 10393 | 8341 | function doBlocksMatchTemplate(blocks = [], template = []) { |
| 10394 | 8342 | return blocks.length === template.length && template.every(([name, , innerBlocksTemplate], index) => { |
| 10395 | 8343 | const block = blocks[index]; |
| 10396 | 8344 | return name === block.name && doBlocksMatchTemplate(block.innerBlocks, innerBlocksTemplate); |
| @@ -10410,9 +8358,9 @@ | ||
| 10410 | 8358 | ); |
| 10411 | 8359 | } |
| 10412 | 8360 | function normalizeAttribute(definition, value) { |
| 10413 | 8361 | if (isHTMLAttribute(definition) && Array.isArray(value)) { |
| 10414 | - return (0, import_element5.renderToString)(value); | |
| 8362 | + return (0, import_element4.renderToString)(value); | |
| 10415 | 8363 | } |
| 10416 | 8364 | if (isQueryAttribute(definition) && value) { |
| 10417 | 8365 | return value.map( |
| 10418 | 8366 | (subValues) => { |
| @@ -10454,22 +8402,20 @@ | ||
| 10454 | 8402 | ); |
| 10455 | 8403 | } |
| 10456 | 8404 | |
| 10457 | 8405 | // packages/blocks/build-module/api/index.mjs |
| 10458 | - var fieldsKey = /* @__PURE__ */ Symbol("fields"); | |
| 10459 | - var formKey = /* @__PURE__ */ Symbol("form"); | |
| 8406 | + var editableRootKey = /* @__PURE__ */ Symbol("editableRoot"); | |
| 10460 | 8407 | var privateApis = {}; |
| 10461 | 8408 | lock(privateApis, { |
| 10462 | 8409 | isContentBlock, |
| 10463 | - fieldsKey, | |
| 10464 | - formKey, | |
| 8410 | + editableRootKey, | |
| 10465 | 8411 | parseRawBlock |
| 10466 | 8412 | }); |
| 10467 | 8413 | |
| 10468 | 8414 | // packages/blocks/build-module/deprecated.mjs |
| 10469 | - var import_deprecated11 = __toESM(require_deprecated(), 1); | |
| 8415 | + var import_deprecated12 = __toESM(require_deprecated(), 1); | |
| 10470 | 8416 | function withBlockContentContext(OriginalComponent) { |
| 10471 | - (0, import_deprecated11.default)("wp.blocks.withBlockContentContext", { | |
| 8417 | + (0, import_deprecated12.default)("wp.blocks.withBlockContentContext", { | |
| 10472 | 8418 | since: "6.1" |
| 10473 | 8419 | }); |
| 10474 | 8420 | return OriginalComponent; |
| 10475 | 8421 | } |
| @@ -10487,11 +8433,8 @@ | ||
| 10487 | 8433 | * This source code is licensed under the MIT license found in the |
| 10488 | 8434 | * LICENSE file in the root directory of this source tree. |
| 10489 | 8435 | *) |
| 10490 | 8436 | |
| 10491 | -showdown/dist/showdown.js: | |
| 10492 | - (*! showdown v 1.9.1 - 02-11-2019 *) | |
| 10493 | - | |
| 10494 | 8437 | is-plain-object/dist/is-plain-object.mjs: |
| 10495 | 8438 | (*! |
| 10496 | 8439 | * is-plain-object <https://github.com/jonschlinkert/is-plain-object> |
| 10497 | 8440 | * |
| @@ -10498,5 +8441,7 @@ | ||
| 10498 | 8441 | * Copyright (c) 2014-2017, Jon Schlinkert. |
| 10499 | 8442 | * Released under the MIT License. |
| 10500 | 8443 | *) |
| 10501 | 8444 | */ |
| 8445 | +(window.wp ||= {}).blocks = wp.blocks; | |
| 8446 | +})(); | |
| 10502 | 8447 | //# sourceMappingURL=index.js.map |