chrome-devtools-frontend 1.0.944427 → 1.0.944903
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/gni/devtools_grd_files.gni +3 -0
- package/front_end/core/common/ParsedURL.ts +1 -1
- package/front_end/core/host/InspectorFrontendHostAPI.ts +5 -5
- package/front_end/core/i18n/locales/en-US.json +3 -15
- package/front_end/core/i18n/locales/en-XL.json +15 -27
- package/front_end/core/protocol_client/NodeURL.ts +1 -0
- package/front_end/core/sdk/CSSStyleSheetHeader.ts +2 -3
- package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +2 -3
- package/front_end/core/sdk/Cookie.ts +17 -0
- package/front_end/core/sdk/CookieModel.ts +1 -0
- package/front_end/core/sdk/DebuggerModel.ts +5 -4
- package/front_end/core/sdk/NetworkManager.ts +4 -1
- package/front_end/core/sdk/NetworkRequest.ts +2 -2
- package/front_end/core/sdk/Resource.ts +2 -2
- package/front_end/core/sdk/Script.ts +2 -3
- package/front_end/models/bindings/BreakpointManager.ts +3 -4
- package/front_end/models/bindings/ResourceMapping.ts +1 -2
- package/front_end/models/bindings/StylesSourceMapping.ts +1 -2
- package/front_end/models/persistence/IsolatedFileSystem.ts +7 -6
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +10 -6
- package/front_end/models/persistence/PersistenceActions.ts +4 -1
- package/front_end/models/persistence/PlatformFileSystem.ts +3 -4
- package/front_end/models/text_utils/ContentProvider.ts +1 -2
- package/front_end/models/text_utils/StaticContentProvider.ts +2 -3
- package/front_end/models/workspace/UISourceCode.ts +2 -2
- package/front_end/panels/animation/animationTimeline.css +2 -0
- package/front_end/panels/application/ReportingApiView.ts +15 -1
- package/front_end/panels/application/components/EndpointsGrid.ts +63 -4
- package/front_end/panels/application/components/FrameDetailsView.ts +21 -34
- package/front_end/panels/snippets/ScriptSnippetFileSystem.ts +1 -1
- package/front_end/panels/sources/DebuggerPlugin.ts +1 -1
- package/front_end/panels/sources/NavigatorView.ts +1 -1
- package/front_end/panels/sources/UISourceCodeFrame.ts +0 -1
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +3 -34
- package/front_end/panels/timeline/TimelineUIUtils.ts +51 -3
- package/front_end/services/window_bounds/WindowBoundsService.ts +27 -0
- package/front_end/services/window_bounds/window_bounds.ts +9 -0
- package/front_end/third_party/codemirror.next/bundle.ts +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/codemirror.next.d.ts +8 -1
- package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
- package/front_end/third_party/codemirror.next/package.json +1 -1
- package/front_end/third_party/lit-html/README.chromium +2 -2
- package/front_end/third_party/lit-html/package/CHANGELOG.md +216 -28
- package/front_end/third_party/lit-html/package/LICENSE +9 -9
- package/front_end/third_party/lit-html/package/README.md +12 -162
- package/front_end/third_party/lit-html/package/async-directive.d.ts +23 -54
- package/front_end/third_party/lit-html/package/async-directive.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/async-directive.js +2 -7
- package/front_end/third_party/lit-html/package/async-directive.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/async-directive.d.ts +23 -54
- package/front_end/third_party/lit-html/package/development/async-directive.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/async-directive.js +44 -194
- package/front_end/third_party/lit-html/package/development/async-directive.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directive-helpers.d.ts +6 -5
- package/front_end/third_party/lit-html/package/development/directive-helpers.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directive-helpers.js +25 -9
- package/front_end/third_party/lit-html/package/development/directive-helpers.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directive.d.ts +3 -16
- package/front_end/third_party/lit-html/package/development/directive.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directive.js +6 -1
- package/front_end/third_party/lit-html/package/development/directive.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/async-append.d.ts +7 -14
- package/front_end/third_party/lit-html/package/development/directives/async-append.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/async-append.js +17 -58
- package/front_end/third_party/lit-html/package/development/directives/async-append.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/async-replace.d.ts +9 -14
- package/front_end/third_party/lit-html/package/development/directives/async-replace.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/async-replace.js +57 -37
- package/front_end/third_party/lit-html/package/development/directives/async-replace.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/cache.d.ts +2 -3
- package/front_end/third_party/lit-html/package/development/directives/cache.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/cache.js +4 -6
- package/front_end/third_party/lit-html/package/development/directives/cache.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/class-map.d.ts +2 -2
- package/front_end/third_party/lit-html/package/development/directives/class-map.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/class-map.js +17 -7
- package/front_end/third_party/lit-html/package/development/directives/class-map.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/guard.d.ts +3 -2
- package/front_end/third_party/lit-html/package/development/directives/guard.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/guard.js +3 -2
- package/front_end/third_party/lit-html/package/development/directives/guard.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/live.d.ts +4 -3
- package/front_end/third_party/lit-html/package/development/directives/live.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/live.js +5 -7
- package/front_end/third_party/lit-html/package/development/directives/live.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/private-async-helpers.d.ts +58 -0
- package/front_end/third_party/lit-html/package/development/directives/private-async-helpers.d.ts.map +1 -0
- package/front_end/third_party/lit-html/package/development/directives/private-async-helpers.js +85 -0
- package/front_end/third_party/lit-html/package/development/directives/private-async-helpers.js.map +1 -0
- package/front_end/third_party/lit-html/package/development/directives/ref.d.ts +14 -11
- package/front_end/third_party/lit-html/package/development/directives/ref.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/ref.js +13 -11
- package/front_end/third_party/lit-html/package/development/directives/ref.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/repeat.d.ts +8 -4
- package/front_end/third_party/lit-html/package/development/directives/repeat.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/repeat.js +23 -9
- package/front_end/third_party/lit-html/package/development/directives/repeat.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/style-map.d.ts +1 -2
- package/front_end/third_party/lit-html/package/development/directives/style-map.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/style-map.js +1 -2
- package/front_end/third_party/lit-html/package/development/directives/style-map.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/template-content.d.ts +1 -2
- package/front_end/third_party/lit-html/package/development/directives/template-content.js +1 -2
- package/front_end/third_party/lit-html/package/development/directives/unsafe-html.d.ts +6 -4
- package/front_end/third_party/lit-html/package/development/directives/unsafe-html.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/unsafe-html.js +7 -5
- package/front_end/third_party/lit-html/package/development/directives/unsafe-html.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/unsafe-svg.d.ts +4 -1
- package/front_end/third_party/lit-html/package/development/directives/unsafe-svg.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/unsafe-svg.js +3 -0
- package/front_end/third_party/lit-html/package/development/directives/unsafe-svg.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/until.d.ts +12 -8
- package/front_end/third_party/lit-html/package/development/directives/until.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/until.js +63 -23
- package/front_end/third_party/lit-html/package/development/directives/until.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/experimental-hydrate.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/experimental-hydrate.js +9 -8
- package/front_end/third_party/lit-html/package/development/experimental-hydrate.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/lit-html.d.ts +81 -136
- package/front_end/third_party/lit-html/package/development/lit-html.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/lit-html.js +249 -76
- package/front_end/third_party/lit-html/package/development/lit-html.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/polyfill-support.d.ts +1 -41
- package/front_end/third_party/lit-html/package/development/polyfill-support.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/polyfill-support.js +40 -21
- package/front_end/third_party/lit-html/package/development/polyfill-support.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/private-ssr-support.d.ts +12 -10
- package/front_end/third_party/lit-html/package/development/private-ssr-support.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/private-ssr-support.js +11 -3
- package/front_end/third_party/lit-html/package/development/private-ssr-support.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/static.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/static.js +6 -5
- package/front_end/third_party/lit-html/package/development/static.js.map +1 -1
- package/front_end/third_party/lit-html/package/directive-helpers.d.ts +6 -5
- package/front_end/third_party/lit-html/package/directive-helpers.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directive-helpers.js +2 -2
- package/front_end/third_party/lit-html/package/directive-helpers.js.map +1 -1
- package/front_end/third_party/lit-html/package/directive.d.ts +3 -16
- package/front_end/third_party/lit-html/package/directive.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directive.js +1 -1
- package/front_end/third_party/lit-html/package/directive.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/async-append.d.ts +7 -14
- package/front_end/third_party/lit-html/package/directives/async-append.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/async-append.js +2 -6
- package/front_end/third_party/lit-html/package/directives/async-append.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/async-replace.d.ts +9 -14
- package/front_end/third_party/lit-html/package/directives/async-replace.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/async-replace.js +2 -5
- package/front_end/third_party/lit-html/package/directives/async-replace.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/cache.d.ts +2 -3
- package/front_end/third_party/lit-html/package/directives/cache.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/cache.js +2 -5
- package/front_end/third_party/lit-html/package/directives/cache.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/class-map.d.ts +2 -2
- package/front_end/third_party/lit-html/package/directives/class-map.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/class-map.js +2 -4
- package/front_end/third_party/lit-html/package/directives/class-map.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/guard.d.ts +3 -2
- package/front_end/third_party/lit-html/package/directives/guard.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/guard.js +2 -4
- package/front_end/third_party/lit-html/package/directives/guard.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/live.d.ts +4 -3
- package/front_end/third_party/lit-html/package/directives/live.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/live.js +1 -4
- package/front_end/third_party/lit-html/package/directives/live.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/private-async-helpers.d.ts +58 -0
- package/front_end/third_party/lit-html/package/directives/private-async-helpers.d.ts.map +1 -0
- package/front_end/third_party/lit-html/package/directives/private-async-helpers.js +7 -0
- package/front_end/third_party/lit-html/package/directives/private-async-helpers.js.map +1 -0
- package/front_end/third_party/lit-html/package/directives/ref.d.ts +14 -11
- package/front_end/third_party/lit-html/package/directives/ref.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/ref.js +2 -5
- package/front_end/third_party/lit-html/package/directives/ref.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/repeat.d.ts +8 -4
- package/front_end/third_party/lit-html/package/directives/repeat.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/repeat.js +2 -5
- package/front_end/third_party/lit-html/package/directives/repeat.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/style-map.d.ts +1 -2
- package/front_end/third_party/lit-html/package/directives/style-map.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/style-map.js +2 -4
- package/front_end/third_party/lit-html/package/directives/style-map.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/template-content.d.ts +1 -2
- package/front_end/third_party/lit-html/package/directives/template-content.js +2 -4
- package/front_end/third_party/lit-html/package/directives/template-content.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/unsafe-html.d.ts +6 -4
- package/front_end/third_party/lit-html/package/directives/unsafe-html.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/unsafe-html.js +2 -4
- package/front_end/third_party/lit-html/package/directives/unsafe-html.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/unsafe-svg.d.ts +4 -1
- package/front_end/third_party/lit-html/package/directives/unsafe-svg.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/unsafe-svg.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/until.d.ts +12 -8
- package/front_end/third_party/lit-html/package/directives/until.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/until.js +2 -6
- package/front_end/third_party/lit-html/package/directives/until.js.map +1 -1
- package/front_end/third_party/lit-html/package/experimental-hydrate.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/experimental-hydrate.js +2 -5
- package/front_end/third_party/lit-html/package/experimental-hydrate.js.map +1 -1
- package/front_end/third_party/lit-html/package/lit-html.d.ts +81 -136
- package/front_end/third_party/lit-html/package/lit-html.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/lit-html.js +1 -1
- package/front_end/third_party/lit-html/package/lit-html.js.map +1 -1
- package/front_end/third_party/lit-html/package/package.json +75 -24
- package/front_end/third_party/lit-html/package/polyfill-support.d.ts +1 -41
- package/front_end/third_party/lit-html/package/polyfill-support.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/polyfill-support.js +1 -1
- package/front_end/third_party/lit-html/package/polyfill-support.js.map +1 -1
- package/front_end/third_party/lit-html/package/private-ssr-support.d.ts +12 -10
- package/front_end/third_party/lit-html/package/private-ssr-support.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/private-ssr-support.js +2 -2
- package/front_end/third_party/lit-html/package/private-ssr-support.js.map +1 -1
- package/front_end/third_party/lit-html/package/static.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/static.js +1 -1
- package/front_end/third_party/lit-html/package/static.js.map +1 -1
- package/front_end/third_party/marked/README.chromium +2 -2
- package/front_end/third_party/marked/marked.ts +2 -2
- package/front_end/third_party/marked/package/README.md +7 -1
- package/front_end/third_party/marked/package/bin/marked.js +214 -0
- package/front_end/third_party/marked/package/lib/marked.cjs +2907 -0
- package/front_end/third_party/marked/package/lib/marked.esm.d.ts +1 -3
- package/front_end/third_party/marked/package/lib/marked.esm.js +627 -586
- package/front_end/third_party/marked/package/lib/marked.umd.js +2913 -0
- package/front_end/third_party/marked/package/man/marked.1 +5 -24
- package/front_end/third_party/marked/package/man/marked.1.txt +21 -31
- package/front_end/third_party/marked/package/marked.min.js +1 -1
- package/front_end/third_party/marked/package/package.json +41 -32
- package/front_end/third_party/marked/package/src/Lexer.js +109 -108
- package/front_end/third_party/marked/package/src/Parser.js +38 -15
- package/front_end/third_party/marked/package/src/Renderer.js +5 -5
- package/front_end/third_party/marked/package/src/Slugger.js +2 -2
- package/front_end/third_party/marked/package/src/TextRenderer.js +2 -2
- package/front_end/third_party/marked/package/src/Tokenizer.js +215 -190
- package/front_end/third_party/marked/package/src/defaults.js +6 -9
- package/front_end/third_party/marked/package/src/helpers.js +16 -27
- package/front_end/third_party/marked/package/src/marked.js +146 -63
- package/front_end/third_party/marked/package/src/rules.js +20 -45
- package/front_end/third_party/wasmparser/README.chromium +2 -2
- package/front_end/third_party/wasmparser/package/.github/workflows/main.yml +47 -0
- package/front_end/third_party/wasmparser/package/CHANGELOG.md +12 -0
- package/front_end/third_party/wasmparser/package/dist/cjs/WasmParser.js +53 -53
- package/front_end/third_party/wasmparser/package/dist/cjs/WasmParser.js.map +1 -1
- package/front_end/third_party/wasmparser/package/dist/esm/WasmParser.js +53 -53
- package/front_end/third_party/wasmparser/package/dist/esm/WasmParser.js.map +1 -1
- package/front_end/third_party/wasmparser/package/package.json +1 -1
- package/front_end/third_party/wasmparser/package/src/WasmParser.ts +53 -53
- package/front_end/ui/components/text_editor/TextEditor.ts +29 -0
- package/front_end/ui/components/text_editor/config.ts +4 -2
- package/front_end/ui/legacy/ViewManager.ts +6 -0
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +20 -0
- package/package.json +1 -1
|
@@ -13,7 +13,7 @@ const escapeReplacements = {
|
|
|
13
13
|
"'": '''
|
|
14
14
|
};
|
|
15
15
|
const getEscapeReplacement = (ch) => escapeReplacements[ch];
|
|
16
|
-
function escape(html, encode) {
|
|
16
|
+
export function escape(html, encode) {
|
|
17
17
|
if (encode) {
|
|
18
18
|
if (escapeTest.test(html)) {
|
|
19
19
|
return html.replace(escapeReplace, getEscapeReplacement);
|
|
@@ -29,7 +29,7 @@ function escape(html, encode) {
|
|
|
29
29
|
|
|
30
30
|
const unescapeTest = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;
|
|
31
31
|
|
|
32
|
-
function unescape(html) {
|
|
32
|
+
export function unescape(html) {
|
|
33
33
|
// explicitly match decimal, hex, and named HTML entities
|
|
34
34
|
return html.replace(unescapeTest, (_, n) => {
|
|
35
35
|
n = n.toLowerCase();
|
|
@@ -44,7 +44,7 @@ function unescape(html) {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
const caret = /(^|[^\[])\^/g;
|
|
47
|
-
function edit(regex, opt) {
|
|
47
|
+
export function edit(regex, opt) {
|
|
48
48
|
regex = regex.source || regex;
|
|
49
49
|
opt = opt || '';
|
|
50
50
|
const obj = {
|
|
@@ -63,7 +63,7 @@ function edit(regex, opt) {
|
|
|
63
63
|
|
|
64
64
|
const nonWordAndColonTest = /[^\w:]/g;
|
|
65
65
|
const originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;
|
|
66
|
-
function cleanUrl(sanitize, base, href) {
|
|
66
|
+
export function cleanUrl(sanitize, base, href) {
|
|
67
67
|
if (sanitize) {
|
|
68
68
|
let prot;
|
|
69
69
|
try {
|
|
@@ -93,7 +93,7 @@ const justDomain = /^[^:]+:\/*[^/]*$/;
|
|
|
93
93
|
const protocol = /^([^:]+:)[\s\S]*$/;
|
|
94
94
|
const domain = /^([^:]+:\/*[^/]*)[\s\S]*$/;
|
|
95
95
|
|
|
96
|
-
function resolveUrl(base, href) {
|
|
96
|
+
export function resolveUrl(base, href) {
|
|
97
97
|
if (!baseUrls[' ' + base]) {
|
|
98
98
|
// we can ignore everything in base after the last slash of its path component,
|
|
99
99
|
// but we might need to add _that_
|
|
@@ -122,9 +122,9 @@ function resolveUrl(base, href) {
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
const noopTest = { exec: function noopTest() {} };
|
|
125
|
+
export const noopTest = { exec: function noopTest() {} };
|
|
126
126
|
|
|
127
|
-
function merge(obj) {
|
|
127
|
+
export function merge(obj) {
|
|
128
128
|
let i = 1,
|
|
129
129
|
target,
|
|
130
130
|
key;
|
|
@@ -141,7 +141,7 @@ function merge(obj) {
|
|
|
141
141
|
return obj;
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
function splitCells(tableRow, count) {
|
|
144
|
+
export function splitCells(tableRow, count) {
|
|
145
145
|
// ensure that every cell-delimiting pipe has a space
|
|
146
146
|
// before it to distinguish it from an escaped pipe
|
|
147
147
|
const row = tableRow.replace(/\|/g, (match, offset, str) => {
|
|
@@ -160,6 +160,10 @@ function splitCells(tableRow, count) {
|
|
|
160
160
|
cells = row.split(/ \|/);
|
|
161
161
|
let i = 0;
|
|
162
162
|
|
|
163
|
+
// First/last cell in a row cannot be empty if it has no leading/trailing pipe
|
|
164
|
+
if (!cells[0].trim()) { cells.shift(); }
|
|
165
|
+
if (!cells[cells.length - 1].trim()) { cells.pop(); }
|
|
166
|
+
|
|
163
167
|
if (cells.length > count) {
|
|
164
168
|
cells.splice(count);
|
|
165
169
|
} else {
|
|
@@ -176,7 +180,7 @@ function splitCells(tableRow, count) {
|
|
|
176
180
|
// Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').
|
|
177
181
|
// /c*$/ is vulnerable to REDOS.
|
|
178
182
|
// invert: Remove suffix of non-c chars instead. Default falsey.
|
|
179
|
-
function rtrim(str, c, invert) {
|
|
183
|
+
export function rtrim(str, c, invert) {
|
|
180
184
|
const l = str.length;
|
|
181
185
|
if (l === 0) {
|
|
182
186
|
return '';
|
|
@@ -200,7 +204,7 @@ function rtrim(str, c, invert) {
|
|
|
200
204
|
return str.substr(0, l - suffLen);
|
|
201
205
|
}
|
|
202
206
|
|
|
203
|
-
function findClosingBracket(str, b) {
|
|
207
|
+
export function findClosingBracket(str, b) {
|
|
204
208
|
if (str.indexOf(b[1]) === -1) {
|
|
205
209
|
return -1;
|
|
206
210
|
}
|
|
@@ -222,14 +226,14 @@ function findClosingBracket(str, b) {
|
|
|
222
226
|
return -1;
|
|
223
227
|
}
|
|
224
228
|
|
|
225
|
-
function checkSanitizeDeprecation(opt) {
|
|
229
|
+
export function checkSanitizeDeprecation(opt) {
|
|
226
230
|
if (opt && opt.sanitize && !opt.silent) {
|
|
227
231
|
console.warn('marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options');
|
|
228
232
|
}
|
|
229
233
|
}
|
|
230
234
|
|
|
231
235
|
// copied from https://stackoverflow.com/a/5450113/806777
|
|
232
|
-
function repeatString(pattern, count) {
|
|
236
|
+
export function repeatString(pattern, count) {
|
|
233
237
|
if (count < 1) {
|
|
234
238
|
return '';
|
|
235
239
|
}
|
|
@@ -243,18 +247,3 @@ function repeatString(pattern, count) {
|
|
|
243
247
|
}
|
|
244
248
|
return result + pattern;
|
|
245
249
|
}
|
|
246
|
-
|
|
247
|
-
module.exports = {
|
|
248
|
-
escape,
|
|
249
|
-
unescape,
|
|
250
|
-
edit,
|
|
251
|
-
cleanUrl,
|
|
252
|
-
resolveUrl,
|
|
253
|
-
noopTest,
|
|
254
|
-
merge,
|
|
255
|
-
splitCells,
|
|
256
|
-
rtrim,
|
|
257
|
-
findClosingBracket,
|
|
258
|
-
checkSanitizeDeprecation,
|
|
259
|
-
repeatString
|
|
260
|
-
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
const Parser = require('./Parser.js');
|
|
3
|
-
const Tokenizer = require('./Tokenizer.js');
|
|
4
|
-
const Renderer = require('./Renderer.js');
|
|
5
|
-
const TextRenderer = require('./TextRenderer.js');
|
|
6
|
-
const Slugger = require('./Slugger.js');
|
|
7
|
-
const {
|
|
8
|
-
merge,
|
|
9
|
-
checkSanitizeDeprecation,
|
|
10
|
-
escape
|
|
11
|
-
} = require('./helpers.js');
|
|
12
|
-
const {
|
|
13
|
-
getDefaults,
|
|
1
|
+
import {
|
|
14
2
|
changeDefaults,
|
|
15
3
|
defaults
|
|
16
|
-
|
|
4
|
+
,
|
|
5
|
+
getDefaults} from './defaults.js';
|
|
6
|
+
import {
|
|
7
|
+
checkSanitizeDeprecation,
|
|
8
|
+
escape
|
|
9
|
+
,
|
|
10
|
+
merge} from './helpers.js';
|
|
11
|
+
import { Lexer } from './Lexer.js';
|
|
12
|
+
import { Parser } from './Parser.js';
|
|
13
|
+
import { Renderer } from './Renderer.js';
|
|
14
|
+
import { Slugger } from './Slugger.js';
|
|
15
|
+
import { TextRenderer } from './TextRenderer.js';
|
|
16
|
+
import { Tokenizer } from './Tokenizer.js';
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Marked
|
|
20
20
|
*/
|
|
21
|
-
function marked(src, opt, callback) {
|
|
21
|
+
export function marked(src, opt, callback) {
|
|
22
22
|
// throw error in case of non string input
|
|
23
23
|
if (typeof src === 'undefined' || src === null) {
|
|
24
24
|
throw new Error('marked(): input parameter is undefined or null');
|
|
@@ -51,6 +51,9 @@ function marked(src, opt, callback) {
|
|
|
51
51
|
|
|
52
52
|
if (!err) {
|
|
53
53
|
try {
|
|
54
|
+
if (opt.walkTokens) {
|
|
55
|
+
marked.walkTokens(tokens, opt.walkTokens);
|
|
56
|
+
}
|
|
54
57
|
out = Parser.parse(tokens, opt);
|
|
55
58
|
} catch (e) {
|
|
56
59
|
err = e;
|
|
@@ -138,46 +141,114 @@ marked.defaults = defaults;
|
|
|
138
141
|
* Use Extension
|
|
139
142
|
*/
|
|
140
143
|
|
|
141
|
-
marked.use = function(
|
|
142
|
-
const opts = merge({},
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
144
|
+
marked.use = function(...args) {
|
|
145
|
+
const opts = merge({}, ...args);
|
|
146
|
+
const extensions = marked.defaults.extensions || { renderers: {}, childTokens: {} };
|
|
147
|
+
let hasExtensions;
|
|
148
|
+
|
|
149
|
+
args.forEach((pack) => {
|
|
150
|
+
// ==-- Parse "addon" extensions --== //
|
|
151
|
+
if (pack.extensions) {
|
|
152
|
+
hasExtensions = true;
|
|
153
|
+
pack.extensions.forEach((ext) => {
|
|
154
|
+
if (!ext.name) {
|
|
155
|
+
throw new Error('extension name required');
|
|
151
156
|
}
|
|
152
|
-
|
|
153
|
-
|
|
157
|
+
if (ext.renderer) { // Renderer extensions
|
|
158
|
+
const prevRenderer = extensions.renderers ? extensions.renderers[ext.name] : null;
|
|
159
|
+
if (prevRenderer) {
|
|
160
|
+
// Replace extension with func to run new extension but fall back if false
|
|
161
|
+
extensions.renderers[ext.name] = function(...args) {
|
|
162
|
+
let ret = ext.renderer.apply(this, args);
|
|
163
|
+
if (ret === false) {
|
|
164
|
+
ret = prevRenderer.apply(this, args);
|
|
165
|
+
}
|
|
166
|
+
return ret;
|
|
167
|
+
};
|
|
168
|
+
} else {
|
|
169
|
+
extensions.renderers[ext.name] = ext.renderer;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
if (ext.tokenizer) { // Tokenizer Extensions
|
|
173
|
+
if (!ext.level || (ext.level !== 'block' && ext.level !== 'inline')) {
|
|
174
|
+
throw new Error("extension level must be 'block' or 'inline'");
|
|
175
|
+
}
|
|
176
|
+
if (extensions[ext.level]) {
|
|
177
|
+
extensions[ext.level].unshift(ext.tokenizer);
|
|
178
|
+
} else {
|
|
179
|
+
extensions[ext.level] = [ext.tokenizer];
|
|
180
|
+
}
|
|
181
|
+
if (ext.start) { // Function to check for start of token
|
|
182
|
+
if (ext.level === 'block') {
|
|
183
|
+
if (extensions.startBlock) {
|
|
184
|
+
extensions.startBlock.push(ext.start);
|
|
185
|
+
} else {
|
|
186
|
+
extensions.startBlock = [ext.start];
|
|
187
|
+
}
|
|
188
|
+
} else if (ext.level === 'inline') {
|
|
189
|
+
if (extensions.startInline) {
|
|
190
|
+
extensions.startInline.push(ext.start);
|
|
191
|
+
} else {
|
|
192
|
+
extensions.startInline = [ext.start];
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
if (ext.childTokens) { // Child tokens to be visited by walkTokens
|
|
198
|
+
extensions.childTokens[ext.name] = ext.childTokens;
|
|
199
|
+
}
|
|
200
|
+
});
|
|
154
201
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
ret
|
|
202
|
+
|
|
203
|
+
// ==-- Parse "overwrite" extensions --== //
|
|
204
|
+
if (pack.renderer) {
|
|
205
|
+
const renderer = marked.defaults.renderer || new Renderer();
|
|
206
|
+
for (const prop in pack.renderer) {
|
|
207
|
+
const prevRenderer = renderer[prop];
|
|
208
|
+
// Replace renderer with func to run extension, but fall back if false
|
|
209
|
+
renderer[prop] = (...args) => {
|
|
210
|
+
let ret = pack.renderer[prop].apply(renderer, args);
|
|
211
|
+
if (ret === false) {
|
|
212
|
+
ret = prevRenderer.apply(renderer, args);
|
|
213
|
+
}
|
|
214
|
+
return ret;
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
opts.renderer = renderer;
|
|
218
|
+
}
|
|
219
|
+
if (pack.tokenizer) {
|
|
220
|
+
const tokenizer = marked.defaults.tokenizer || new Tokenizer();
|
|
221
|
+
for (const prop in pack.tokenizer) {
|
|
222
|
+
const prevTokenizer = tokenizer[prop];
|
|
223
|
+
// Replace tokenizer with func to run extension, but fall back if false
|
|
224
|
+
tokenizer[prop] = (...args) => {
|
|
225
|
+
let ret = pack.tokenizer[prop].apply(tokenizer, args);
|
|
226
|
+
if (ret === false) {
|
|
227
|
+
ret = prevTokenizer.apply(tokenizer, args);
|
|
228
|
+
}
|
|
229
|
+
return ret;
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
opts.tokenizer = tokenizer;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// ==-- Parse WalkTokens extensions --== //
|
|
236
|
+
if (pack.walkTokens) {
|
|
237
|
+
const walkTokens = marked.defaults.walkTokens;
|
|
238
|
+
opts.walkTokens = function(token) {
|
|
239
|
+
pack.walkTokens.call(this, token);
|
|
240
|
+
if (walkTokens) {
|
|
241
|
+
walkTokens.call(this, token);
|
|
165
242
|
}
|
|
166
|
-
return ret;
|
|
167
243
|
};
|
|
168
244
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
walkTokens(token);
|
|
177
|
-
}
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
marked.setOptions(opts);
|
|
245
|
+
|
|
246
|
+
if (hasExtensions) {
|
|
247
|
+
opts.extensions = extensions;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
marked.setOptions(opts);
|
|
251
|
+
});
|
|
181
252
|
};
|
|
182
253
|
|
|
183
254
|
/**
|
|
@@ -186,15 +257,15 @@ marked.use = function(extension) {
|
|
|
186
257
|
|
|
187
258
|
marked.walkTokens = function(tokens, callback) {
|
|
188
259
|
for (const token of tokens) {
|
|
189
|
-
callback(token);
|
|
260
|
+
callback.call(marked, token);
|
|
190
261
|
switch (token.type) {
|
|
191
262
|
case 'table': {
|
|
192
|
-
for (const cell of token.
|
|
193
|
-
marked.walkTokens(cell, callback);
|
|
263
|
+
for (const cell of token.header) {
|
|
264
|
+
marked.walkTokens(cell.tokens, callback);
|
|
194
265
|
}
|
|
195
|
-
for (const row of token.
|
|
266
|
+
for (const row of token.rows) {
|
|
196
267
|
for (const cell of row) {
|
|
197
|
-
marked.walkTokens(cell, callback);
|
|
268
|
+
marked.walkTokens(cell.tokens, callback);
|
|
198
269
|
}
|
|
199
270
|
}
|
|
200
271
|
break;
|
|
@@ -204,7 +275,11 @@ marked.walkTokens = function(tokens, callback) {
|
|
|
204
275
|
break;
|
|
205
276
|
}
|
|
206
277
|
default: {
|
|
207
|
-
if (token.
|
|
278
|
+
if (marked.defaults.extensions && marked.defaults.extensions.childTokens && marked.defaults.extensions.childTokens[token.type]) { // Walk any extensions
|
|
279
|
+
marked.defaults.extensions.childTokens[token.type].forEach(function(childTokens) {
|
|
280
|
+
marked.walkTokens(token[childTokens], callback);
|
|
281
|
+
});
|
|
282
|
+
} else if (token.tokens) {
|
|
208
283
|
marked.walkTokens(token.tokens, callback);
|
|
209
284
|
}
|
|
210
285
|
}
|
|
@@ -248,20 +323,28 @@ marked.parseInline = function(src, opt) {
|
|
|
248
323
|
/**
|
|
249
324
|
* Expose
|
|
250
325
|
*/
|
|
251
|
-
|
|
252
326
|
marked.Parser = Parser;
|
|
253
327
|
marked.parser = Parser.parse;
|
|
254
|
-
|
|
255
328
|
marked.Renderer = Renderer;
|
|
256
329
|
marked.TextRenderer = TextRenderer;
|
|
257
|
-
|
|
258
330
|
marked.Lexer = Lexer;
|
|
259
331
|
marked.lexer = Lexer.lex;
|
|
260
|
-
|
|
261
332
|
marked.Tokenizer = Tokenizer;
|
|
262
|
-
|
|
263
333
|
marked.Slugger = Slugger;
|
|
264
|
-
|
|
265
334
|
marked.parse = marked;
|
|
266
335
|
|
|
267
|
-
|
|
336
|
+
export const options = marked.options;
|
|
337
|
+
export const setOptions = marked.setOptions;
|
|
338
|
+
export const use = marked.use;
|
|
339
|
+
export const walkTokens = marked.walkTokens;
|
|
340
|
+
export const parseInline = marked.parseInline;
|
|
341
|
+
export const parse = marked;
|
|
342
|
+
export const parser = Parser.parse;
|
|
343
|
+
export const lexer = Lexer.lex;
|
|
344
|
+
export { defaults, getDefaults } from './defaults.js';
|
|
345
|
+
export { Lexer } from './Lexer.js';
|
|
346
|
+
export { Parser } from './Parser.js';
|
|
347
|
+
export { Tokenizer } from './Tokenizer.js';
|
|
348
|
+
export { Renderer } from './Renderer.js';
|
|
349
|
+
export { TextRenderer } from './TextRenderer.js';
|
|
350
|
+
export { Slugger } from './Slugger.js';
|
|
@@ -1,32 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
noopTest,
|
|
1
|
+
import {
|
|
3
2
|
edit,
|
|
4
3
|
merge
|
|
5
|
-
|
|
4
|
+
,
|
|
5
|
+
noopTest} from './helpers.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Block-Level Grammar
|
|
9
9
|
*/
|
|
10
|
-
const block = {
|
|
10
|
+
export const block = {
|
|
11
11
|
newline: /^(?: *(?:\n|$))+/,
|
|
12
12
|
code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,
|
|
13
|
-
fences: /^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(
|
|
13
|
+
fences: /^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,
|
|
14
14
|
hr: /^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,
|
|
15
15
|
heading: /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,
|
|
16
16
|
blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,
|
|
17
|
-
list: /^( {0,3})(
|
|
17
|
+
list: /^( {0,3}bull)( [^\n]+?)?(?:\n|$)/,
|
|
18
18
|
html: '^ {0,3}(?:' // optional indentation
|
|
19
|
-
+ '<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)' // (1)
|
|
19
|
+
+ '<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)' // (1)
|
|
20
20
|
+ '|comment[^\\n]*(\\n+|$)' // (2)
|
|
21
21
|
+ '|<\\?[\\s\\S]*?(?:\\?>\\n*|$)' // (3)
|
|
22
22
|
+ '|<![A-Z][\\s\\S]*?(?:>\\n*|$)' // (4)
|
|
23
23
|
+ '|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)' // (5)
|
|
24
|
-
+ '|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n
|
|
25
|
-
+ '|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n
|
|
26
|
-
+ '|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n
|
|
24
|
+
+ '|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (6)
|
|
25
|
+
+ '|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (7) open tag
|
|
26
|
+
+ '|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (7) closing tag
|
|
27
27
|
+ ')',
|
|
28
28
|
def: /^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,
|
|
29
|
-
nptable: noopTest,
|
|
30
29
|
table: noopTest,
|
|
31
30
|
lheading: /^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
32
31
|
// regex template, placeholders will be replaced according to different paragraph
|
|
@@ -43,11 +42,6 @@ block.def = edit(block.def)
|
|
|
43
42
|
.getRegex();
|
|
44
43
|
|
|
45
44
|
block.bullet = /(?:[*+-]|\d{1,9}[.)])/;
|
|
46
|
-
block.item = /^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/;
|
|
47
|
-
block.item = edit(block.item, 'gm')
|
|
48
|
-
.replace(/bull/g, block.bullet)
|
|
49
|
-
.getRegex();
|
|
50
|
-
|
|
51
45
|
block.listItemStart = edit(/^( *)(bull) */)
|
|
52
46
|
.replace('bull', block.bullet)
|
|
53
47
|
.getRegex();
|
|
@@ -78,7 +72,7 @@ block.paragraph = edit(block._paragraph)
|
|
|
78
72
|
.replace('blockquote', ' {0,3}>')
|
|
79
73
|
.replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n')
|
|
80
74
|
.replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
|
|
81
|
-
.replace('html', '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)')
|
|
75
|
+
.replace('html', '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)')
|
|
82
76
|
.replace('tag', block._tag) // pars can be interrupted by type (6) html blocks
|
|
83
77
|
.getRegex();
|
|
84
78
|
|
|
@@ -97,25 +91,11 @@ block.normal = merge({}, block);
|
|
|
97
91
|
*/
|
|
98
92
|
|
|
99
93
|
block.gfm = merge({}, block.normal, {
|
|
100
|
-
|
|
101
|
-
+ ' {0,3}(
|
|
102
|
-
+ '(?:\\n((?:(
|
|
103
|
-
table: '^ *\\|(.+)\\n' // Header
|
|
104
|
-
+ ' {0,3}\\|?( *[-:]+[-| :]*)' // Align
|
|
105
|
-
+ '(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells
|
|
94
|
+
table: '^ *([^\\n ].*\\|.*)\\n' // Header
|
|
95
|
+
+ ' {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?' // Align
|
|
96
|
+
+ '(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells
|
|
106
97
|
});
|
|
107
98
|
|
|
108
|
-
block.gfm.nptable = edit(block.gfm.nptable)
|
|
109
|
-
.replace('hr', block.hr)
|
|
110
|
-
.replace('heading', ' {0,3}#{1,6} ')
|
|
111
|
-
.replace('blockquote', ' {0,3}>')
|
|
112
|
-
.replace('code', ' {4}[^\\n]')
|
|
113
|
-
.replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n')
|
|
114
|
-
.replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
|
|
115
|
-
.replace('html', '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)')
|
|
116
|
-
.replace('tag', block._tag) // tables can be interrupted by type (6) html blocks
|
|
117
|
-
.getRegex();
|
|
118
|
-
|
|
119
99
|
block.gfm.table = edit(block.gfm.table)
|
|
120
100
|
.replace('hr', block.hr)
|
|
121
101
|
.replace('heading', ' {0,3}#{1,6} ')
|
|
@@ -123,7 +103,7 @@ block.gfm.table = edit(block.gfm.table)
|
|
|
123
103
|
.replace('code', ' {4}[^\\n]')
|
|
124
104
|
.replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n')
|
|
125
105
|
.replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
|
|
126
|
-
.replace('html', '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)')
|
|
106
|
+
.replace('html', '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)')
|
|
127
107
|
.replace('tag', block._tag) // tables can be interrupted by type (6) html blocks
|
|
128
108
|
.getRegex();
|
|
129
109
|
|
|
@@ -159,7 +139,7 @@ block.pedantic = merge({}, block.normal, {
|
|
|
159
139
|
/**
|
|
160
140
|
* Inline-Level Grammar
|
|
161
141
|
*/
|
|
162
|
-
const inline = {
|
|
142
|
+
export const inline = {
|
|
163
143
|
escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
|
|
164
144
|
autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/,
|
|
165
145
|
url: noopTest,
|
|
@@ -176,9 +156,9 @@ const inline = {
|
|
|
176
156
|
emStrong: {
|
|
177
157
|
lDelim: /^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,
|
|
178
158
|
// (1) and (2) can only be a Right Delimiter. (3) and (4) can only be Left. (5) and (6) can be either Left or Right.
|
|
179
|
-
// () Skip
|
|
180
|
-
rDelimAst:
|
|
181
|
-
rDelimUnd:
|
|
159
|
+
// () Skip orphan delim inside strong (1) #*** (2) a***#, a*** (3) #***a, ***a (4) ***# (5) #***# (6) a***a
|
|
160
|
+
rDelimAst: /^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,
|
|
161
|
+
rDelimUnd: /^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/ // ^- Not allowed for _
|
|
182
162
|
},
|
|
183
163
|
code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,
|
|
184
164
|
br: /^( {2,}|\\)\n(?!\s*$)/,
|
|
@@ -286,7 +266,7 @@ inline.gfm = merge({}, inline.normal, {
|
|
|
286
266
|
url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,
|
|
287
267
|
_backpedal: /(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,
|
|
288
268
|
del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,
|
|
289
|
-
text: /^([`~]+|[^`~])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))
|
|
269
|
+
text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
|
|
290
270
|
});
|
|
291
271
|
|
|
292
272
|
inline.gfm.url = edit(inline.gfm.url, 'i')
|
|
@@ -303,8 +283,3 @@ inline.breaks = merge({}, inline.gfm, {
|
|
|
303
283
|
.replace(/\{2,\}/g, '*')
|
|
304
284
|
.getRegex()
|
|
305
285
|
});
|
|
306
|
-
|
|
307
|
-
module.exports = {
|
|
308
|
-
block,
|
|
309
|
-
inline
|
|
310
|
-
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Name: wasdk/wasmparser
|
|
2
2
|
Short Name: wasmparser
|
|
3
3
|
URL: https://github.com/wasdk/wasmparser
|
|
4
|
-
Version: 5.
|
|
4
|
+
Version: 5.4.0
|
|
5
5
|
License: Apache
|
|
6
6
|
License File: LICENSE
|
|
7
7
|
Security Critical: no
|
|
@@ -10,5 +10,5 @@ Description:
|
|
|
10
10
|
Simple streamable WebAssembly binary parser.
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
|
-
wget -qO- https://registry.npmjs.org/wasmparser/-/wasmparser-5.
|
|
13
|
+
wget -qO- https://registry.npmjs.org/wasmparser/-/wasmparser-5.4.0.tgz | tar xzf -
|
|
14
14
|
```
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
name: Node.js CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ master ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ master ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
|
|
13
|
+
strategy:
|
|
14
|
+
matrix:
|
|
15
|
+
node-version: [14.x]
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v2
|
|
19
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
20
|
+
uses: actions/setup-node@v2
|
|
21
|
+
with:
|
|
22
|
+
node-version: ${{ matrix.node-version }}
|
|
23
|
+
- name: Install dependencies
|
|
24
|
+
run: npm ci
|
|
25
|
+
- run: npm run build
|
|
26
|
+
- run: npm run lint
|
|
27
|
+
- run: npm test
|
|
28
|
+
|
|
29
|
+
release:
|
|
30
|
+
runs-on: ubuntu-latest
|
|
31
|
+
needs: build
|
|
32
|
+
if: ${{ github.event_name == 'push' }}
|
|
33
|
+
|
|
34
|
+
steps:
|
|
35
|
+
- uses: actions/checkout@v2
|
|
36
|
+
with:
|
|
37
|
+
fetch-depth: 0
|
|
38
|
+
persist-credentials: false
|
|
39
|
+
- uses: actions/setup-node@v1
|
|
40
|
+
with:
|
|
41
|
+
node-version: ${{ matrix.node-version }}
|
|
42
|
+
- run: npm ci
|
|
43
|
+
- name: Release
|
|
44
|
+
run: npx semantic-release
|
|
45
|
+
env:
|
|
46
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
47
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
# [5.4.0](https://github.com/wasdk/wasmparser/compare/v5.3.0...v5.4.0) (2021-10-12)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* prevent negative name subsection entry length ([c9eeec7](https://github.com/wasdk/wasmparser/commit/c9eeec7a26d45cf436422a0f20c16dcf14c511bd))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* add tests for negative name subsection length ([b5d8d83](https://github.com/wasdk/wasmparser/commit/b5d8d83811785c8b3a0877e5e52c01cad4b4951e))
|
|
12
|
+
|
|
1
13
|
# [5.3.0](https://github.com/wasdk/wasmparser/compare/v5.2.0...v5.3.0) (2021-09-20)
|
|
2
14
|
|
|
3
15
|
|