chrome-devtools-frontend 1.0.943986 → 1.0.945579
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 +4 -0
- package/config/gni/devtools_image_files.gni +1 -0
- package/front_end/Images/src/circled_exclamation_icon.svg +3 -0
- package/front_end/core/common/ParsedURL.ts +1 -1
- package/front_end/core/host/UserMetrics.ts +2 -1
- package/front_end/core/i18n/i18nImpl.ts +7 -4
- package/front_end/core/i18n/locales/en-US.json +3 -72
- package/front_end/core/i18n/locales/en-XL.json +15 -84
- package/front_end/core/protocol_client/NodeURL.ts +1 -0
- package/front_end/core/sdk/CSSMetadata.ts +0 -1
- package/front_end/core/sdk/CSSStyleDeclaration.ts +4 -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/OverlayModel.ts +0 -9
- package/front_end/core/sdk/Resource.ts +2 -2
- package/front_end/core/sdk/Script.ts +2 -3
- package/front_end/core/sdk/sdk-meta.ts +0 -26
- package/front_end/entrypoints/inspector_main/RenderingOptions.ts +0 -13
- package/front_end/entrypoints/main/MainImpl.ts +4 -0
- package/front_end/generated/protocol.d.ts +0 -4
- 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/emulation/EmulatedDevices.ts +2 -4
- package/front_end/models/persistence/IsolatedFileSystem.ts +7 -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/models/workspace_diff/WorkspaceDiff.ts +20 -6
- package/front_end/panels/animation/animationTimeline.css +2 -0
- package/front_end/panels/application/BackForwardCacheStrings.ts +15 -75
- package/front_end/panels/application/BackForwardCacheView.ts +8 -1
- 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/changes/ChangesView.ts +8 -7
- package/front_end/panels/console/ConsolePinPane.ts +1 -0
- package/front_end/panels/console/ConsolePrompt.ts +121 -171
- package/front_end/panels/console/ConsoleView.ts +1 -1
- package/front_end/panels/console/consoleView.css +1 -1
- package/front_end/panels/css_overview/cssOverviewCompletedView.css +2 -2
- package/front_end/panels/elements/AccessibilityTreeUtils.ts +2 -1
- package/front_end/panels/elements/ElementsTreeElement.ts +1 -0
- package/front_end/panels/elements/StyleEditorWidget.ts +13 -2
- package/front_end/panels/elements/StylePropertyHighlighter.ts +29 -19
- package/front_end/panels/elements/StylePropertyTreeElement.ts +8 -12
- package/front_end/panels/elements/StylesSidebarPane.ts +36 -10
- package/front_end/panels/elements/components/AccessibilityTreeNode.ts +27 -3
- package/front_end/panels/emulation/DeviceModeView.ts +3 -0
- package/front_end/panels/help/ReleaseNoteText.ts +3 -1
- package/front_end/panels/network/NetworkDataGridNode.ts +5 -1
- package/front_end/panels/snippets/ScriptSnippetFileSystem.ts +1 -1
- package/front_end/panels/sources/BreakpointEditDialog.ts +1 -0
- 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/acorn/README.chromium +2 -2
- package/front_end/third_party/acorn/acorn.ts +1 -1
- package/front_end/third_party/acorn/package/CHANGELOG.md +31 -1
- package/front_end/third_party/acorn/package/README.md +1 -1
- package/front_end/third_party/acorn/package/dist/acorn.d.ts +3 -0
- package/front_end/third_party/acorn/package/dist/acorn.js +772 -708
- package/front_end/third_party/acorn/package/dist/acorn.mjs +767 -703
- package/front_end/third_party/acorn/package/dist/bin.js +47 -21
- package/front_end/third_party/acorn/package/package.json +1 -1
- package/front_end/third_party/acorn-loose/README.chromium +2 -2
- package/front_end/third_party/acorn-loose/package/CHANGELOG.md +12 -0
- package/front_end/third_party/acorn-loose/package/dist/acorn-loose.js +27 -7
- package/front_end/third_party/acorn-loose/package/dist/acorn-loose.mjs +28 -8
- package/front_end/third_party/acorn-loose/package/package.json +2 -2
- package/front_end/third_party/codemirror.next/bundle.ts +4 -3
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/codemirror.next.d.ts +39 -1
- package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
- package/front_end/third_party/codemirror.next/package.json +4 -4
- package/front_end/third_party/i18n/i18n-impl.ts +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/adorners/Adorner.ts +14 -14
- package/front_end/ui/components/buttons/Button.ts +116 -42
- package/front_end/ui/components/data_grid/DataGrid.ts +122 -122
- package/front_end/ui/components/data_grid/DataGridController.ts +42 -42
- package/front_end/ui/components/diff_view/DiffView.ts +4 -4
- package/front_end/ui/components/docs/button/basic.html +3 -0
- package/front_end/ui/components/docs/button/basic.ts +16 -0
- package/front_end/ui/components/expandable_list/ExpandableList.ts +11 -11
- package/front_end/ui/components/icon_button/Icon.ts +24 -21
- package/front_end/ui/components/icon_button/IconButton.ts +31 -31
- package/front_end/ui/components/issue_counter/IssueCounter.ts +52 -52
- package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +42 -42
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspector.ts +67 -67
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorController.ts +22 -22
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorPane.ts +36 -36
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryNavigator.ts +19 -19
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryValueInterpreter.ts +25 -25
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryViewer.ts +52 -52
- package/front_end/ui/components/linear_memory_inspector/ValueInterpreterDisplay.ts +21 -21
- package/front_end/ui/components/linear_memory_inspector/ValueInterpreterSettings.ts +6 -6
- package/front_end/ui/components/markdown_view/MarkdownImage.ts +14 -14
- package/front_end/ui/components/markdown_view/MarkdownLink.ts +8 -8
- package/front_end/ui/components/markdown_view/MarkdownView.ts +6 -6
- package/front_end/ui/components/render_coordinator/RenderCoordinator.ts +33 -33
- package/front_end/ui/components/report_view/ReportView.ts +18 -18
- package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +53 -53
- package/front_end/ui/components/settings/SettingCheckbox.ts +15 -15
- package/front_end/ui/components/survey_link/SurveyLink.ts +28 -28
- package/front_end/ui/components/text_editor/TextEditor.ts +65 -36
- package/front_end/ui/components/text_editor/config.ts +36 -14
- package/front_end/ui/components/text_editor/javascript.ts +20 -15
- package/front_end/ui/components/text_editor/theme.ts +29 -4
- package/front_end/ui/components/text_prompt/TextPrompt.ts +19 -19
- package/front_end/ui/components/tree_outline/TreeOutline.ts +56 -56
- package/front_end/ui/legacy/Infobar.ts +9 -0
- package/front_end/ui/legacy/InspectorView.ts +1 -1
- package/front_end/ui/legacy/ViewManager.ts +6 -0
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +20 -0
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +1 -0
- package/front_end/ui/legacy/components/utils/Linkifier.ts +49 -79
- package/front_end/ui/legacy/tabbedPane.css +1 -1
- package/front_end/ui/legacy/themeColors.css +2 -0
- package/inspector_overlay/main.ts +3 -0
- package/package.json +1 -1
|
@@ -1,24 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
rtrim,
|
|
4
|
-
splitCells,
|
|
1
|
+
import { defaults } from './defaults.js';
|
|
2
|
+
import {
|
|
5
3
|
escape,
|
|
6
4
|
findClosingBracket
|
|
7
|
-
|
|
5
|
+
,
|
|
6
|
+
rtrim,
|
|
7
|
+
splitCells} from './helpers.js';
|
|
8
8
|
|
|
9
|
-
function outputLink(cap, link, raw) {
|
|
9
|
+
function outputLink(cap, link, raw, lexer) {
|
|
10
10
|
const href = link.href;
|
|
11
11
|
const title = link.title ? escape(link.title) : null;
|
|
12
12
|
const text = cap[1].replace(/\\([\[\]])/g, '$1');
|
|
13
13
|
|
|
14
14
|
if (cap[0].charAt(0) !== '!') {
|
|
15
|
-
|
|
15
|
+
lexer.state.inLink = true;
|
|
16
|
+
const token = {
|
|
16
17
|
type: 'link',
|
|
17
18
|
raw,
|
|
18
19
|
href,
|
|
19
20
|
title,
|
|
20
|
-
text
|
|
21
|
+
text,
|
|
22
|
+
tokens: lexer.inlineTokens(text, [])
|
|
21
23
|
};
|
|
24
|
+
lexer.state.inLink = false;
|
|
25
|
+
return token;
|
|
22
26
|
} else {
|
|
23
27
|
return {
|
|
24
28
|
type: 'image',
|
|
@@ -61,7 +65,7 @@ function indentCodeCompensation(raw, text) {
|
|
|
61
65
|
/**
|
|
62
66
|
* Tokenizer
|
|
63
67
|
*/
|
|
64
|
-
|
|
68
|
+
export class Tokenizer {
|
|
65
69
|
constructor(options) {
|
|
66
70
|
this.options = options || defaults;
|
|
67
71
|
}
|
|
@@ -125,48 +129,15 @@ module.exports = class Tokenizer {
|
|
|
125
129
|
}
|
|
126
130
|
}
|
|
127
131
|
|
|
128
|
-
|
|
132
|
+
const token = {
|
|
129
133
|
type: 'heading',
|
|
130
134
|
raw: cap[0],
|
|
131
135
|
depth: cap[1].length,
|
|
132
|
-
text: text
|
|
136
|
+
text: text,
|
|
137
|
+
tokens: []
|
|
133
138
|
};
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
nptable(src) {
|
|
138
|
-
const cap = this.rules.block.nptable.exec(src);
|
|
139
|
-
if (cap) {
|
|
140
|
-
const item = {
|
|
141
|
-
type: 'table',
|
|
142
|
-
header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')),
|
|
143
|
-
align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
|
|
144
|
-
cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : [],
|
|
145
|
-
raw: cap[0]
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
if (item.header.length === item.align.length) {
|
|
149
|
-
let l = item.align.length;
|
|
150
|
-
let i;
|
|
151
|
-
for (i = 0; i < l; i++) {
|
|
152
|
-
if (/^ *-+: *$/.test(item.align[i])) {
|
|
153
|
-
item.align[i] = 'right';
|
|
154
|
-
} else if (/^ *:-+: *$/.test(item.align[i])) {
|
|
155
|
-
item.align[i] = 'center';
|
|
156
|
-
} else if (/^ *:-+ *$/.test(item.align[i])) {
|
|
157
|
-
item.align[i] = 'left';
|
|
158
|
-
} else {
|
|
159
|
-
item.align[i] = null;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
l = item.cells.length;
|
|
164
|
-
for (i = 0; i < l; i++) {
|
|
165
|
-
item.cells[i] = splitCells(item.cells[i], item.header.length);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
return item;
|
|
169
|
-
}
|
|
139
|
+
this.lexer.inline(token.text, token.tokens);
|
|
140
|
+
return token;
|
|
170
141
|
}
|
|
171
142
|
}
|
|
172
143
|
|
|
@@ -188,138 +159,155 @@ module.exports = class Tokenizer {
|
|
|
188
159
|
return {
|
|
189
160
|
type: 'blockquote',
|
|
190
161
|
raw: cap[0],
|
|
162
|
+
tokens: this.lexer.blockTokens(text, []),
|
|
191
163
|
text
|
|
192
164
|
};
|
|
193
165
|
}
|
|
194
166
|
}
|
|
195
167
|
|
|
196
168
|
list(src) {
|
|
197
|
-
|
|
169
|
+
let cap = this.rules.block.list.exec(src);
|
|
198
170
|
if (cap) {
|
|
199
|
-
let raw
|
|
200
|
-
|
|
171
|
+
let raw, istask, ischecked, indent, i, blankLine, endsWithBlankLine,
|
|
172
|
+
line, lines, itemContents;
|
|
173
|
+
|
|
174
|
+
let bull = cap[1].trim();
|
|
201
175
|
const isordered = bull.length > 1;
|
|
202
176
|
|
|
203
177
|
const list = {
|
|
204
178
|
type: 'list',
|
|
205
|
-
raw,
|
|
179
|
+
raw: '',
|
|
206
180
|
ordered: isordered,
|
|
207
181
|
start: isordered ? +bull.slice(0, -1) : '',
|
|
208
182
|
loose: false,
|
|
209
183
|
items: []
|
|
210
184
|
};
|
|
211
185
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
let l = itemMatch.length;
|
|
227
|
-
bcurr = this.rules.block.listItemStart.exec(itemMatch[0]);
|
|
228
|
-
for (let i = 0; i < l; i++) {
|
|
229
|
-
item = itemMatch[i];
|
|
230
|
-
raw = item;
|
|
231
|
-
|
|
232
|
-
if (!this.options.pedantic) {
|
|
233
|
-
// Determine if current item contains the end of the list
|
|
234
|
-
endMatch = item.match(new RegExp('\\n\\s*\\n {0,' + (bcurr[0].length - 1) + '}\\S'));
|
|
235
|
-
if (endMatch) {
|
|
236
|
-
addBack = item.length - endMatch.index + itemMatch.slice(i + 1).join('\n').length;
|
|
237
|
-
list.raw = list.raw.substring(0, list.raw.length - addBack);
|
|
238
|
-
|
|
239
|
-
item = item.substring(0, endMatch.index);
|
|
240
|
-
raw = item;
|
|
241
|
-
l = i + 1;
|
|
242
|
-
}
|
|
186
|
+
bull = isordered ? `\\d{1,9}\\${bull.slice(-1)}` : `\\${bull}`;
|
|
187
|
+
|
|
188
|
+
if (this.options.pedantic) {
|
|
189
|
+
bull = isordered ? bull : '[*+-]';
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// Get next list item
|
|
193
|
+
const itemRegex = new RegExp(`^( {0,3}${bull})((?: [^\\n]*| *)(?:\\n[^\\n]*)*(?:\\n|$))`);
|
|
194
|
+
|
|
195
|
+
// Get each top-level item
|
|
196
|
+
while (src) {
|
|
197
|
+
if (this.rules.block.hr.test(src)) { // End list if we encounter an HR (possibly move into itemRegex?)
|
|
198
|
+
break;
|
|
243
199
|
}
|
|
244
200
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
if (i !== l - 1) {
|
|
248
|
-
bnext = this.rules.block.listItemStart.exec(itemMatch[i + 1]);
|
|
249
|
-
if (
|
|
250
|
-
!this.options.pedantic
|
|
251
|
-
? bnext[1].length >= bcurr[0].length || bnext[1].length > 3
|
|
252
|
-
: bnext[1].length > bcurr[1].length
|
|
253
|
-
) {
|
|
254
|
-
// nested list or continuation
|
|
255
|
-
itemMatch.splice(i, 2, itemMatch[i] + (!this.options.pedantic && bnext[1].length < bcurr[0].length && !itemMatch[i].match(/\n$/) ? '' : '\n') + itemMatch[i + 1]);
|
|
256
|
-
i--;
|
|
257
|
-
l--;
|
|
258
|
-
continue;
|
|
259
|
-
} else if (
|
|
260
|
-
// different bullet style
|
|
261
|
-
!this.options.pedantic || this.options.smartLists
|
|
262
|
-
? bnext[2][bnext[2].length - 1] !== bull[bull.length - 1]
|
|
263
|
-
: isordered === (bnext[2].length === 1)
|
|
264
|
-
) {
|
|
265
|
-
addBack = itemMatch.slice(i + 1).join('\n').length;
|
|
266
|
-
list.raw = list.raw.substring(0, list.raw.length - addBack);
|
|
267
|
-
i = l - 1;
|
|
268
|
-
}
|
|
269
|
-
bcurr = bnext;
|
|
201
|
+
if (!(cap = itemRegex.exec(src))) {
|
|
202
|
+
break;
|
|
270
203
|
}
|
|
271
204
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
item = !this.options.pedantic
|
|
282
|
-
? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '')
|
|
283
|
-
: item.replace(/^ {1,4}/gm, '');
|
|
205
|
+
lines = cap[2].split('\n');
|
|
206
|
+
|
|
207
|
+
if (this.options.pedantic) {
|
|
208
|
+
indent = 2;
|
|
209
|
+
itemContents = lines[0].trimLeft();
|
|
210
|
+
} else {
|
|
211
|
+
indent = cap[2].search(/[^ ]/); // Find first non-space char
|
|
212
|
+
indent = cap[1].length + (indent > 4 ? 1 : indent); // intented code blocks after 4 spaces; indent is always 1
|
|
213
|
+
itemContents = lines[0].slice(indent - cap[1].length);
|
|
284
214
|
}
|
|
285
215
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
216
|
+
blankLine = false;
|
|
217
|
+
raw = cap[0];
|
|
218
|
+
|
|
219
|
+
if (!lines[0] && /^ *$/.test(lines[1])) { // items begin with at most one blank line
|
|
220
|
+
raw = cap[1] + lines.slice(0, 2).join('\n') + '\n';
|
|
221
|
+
list.loose = true;
|
|
222
|
+
lines = [];
|
|
290
223
|
}
|
|
291
224
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
225
|
+
const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\d{1,9}[.)])`);
|
|
226
|
+
|
|
227
|
+
for (i = 1; i < lines.length; i++) {
|
|
228
|
+
line = lines[i];
|
|
229
|
+
|
|
230
|
+
if (this.options.pedantic) { // Re-align to follow commonmark nesting rules
|
|
231
|
+
line = line.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' ');
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// End list item if found start of new bullet
|
|
235
|
+
if (nextBulletRegex.test(line)) {
|
|
236
|
+
raw = cap[1] + lines.slice(0, i).join('\n') + '\n';
|
|
237
|
+
break;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// Until we encounter a blank line, item contents do not need indentation
|
|
241
|
+
if (!blankLine) {
|
|
242
|
+
if (!line.trim()) { // Check if current line is empty
|
|
243
|
+
blankLine = true;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// Dedent if possible
|
|
247
|
+
if (line.search(/[^ ]/) >= indent) {
|
|
248
|
+
itemContents += '\n' + line.slice(indent);
|
|
249
|
+
} else {
|
|
250
|
+
itemContents += '\n' + line;
|
|
251
|
+
}
|
|
252
|
+
continue;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// Dedent this line
|
|
256
|
+
if (line.search(/[^ ]/) >= indent || !line.trim()) {
|
|
257
|
+
itemContents += '\n' + line.slice(indent);
|
|
258
|
+
continue;
|
|
259
|
+
} else { // Line was not properly indented; end of this item
|
|
260
|
+
raw = cap[1] + lines.slice(0, i).join('\n') + '\n';
|
|
261
|
+
break;
|
|
262
|
+
}
|
|
299
263
|
}
|
|
300
264
|
|
|
301
|
-
if (loose) {
|
|
302
|
-
list
|
|
265
|
+
if (!list.loose) {
|
|
266
|
+
// If the previous item ended with a blank line, the list is loose
|
|
267
|
+
if (endsWithBlankLine) {
|
|
268
|
+
list.loose = true;
|
|
269
|
+
} else if (/\n *\n *$/.test(raw)) {
|
|
270
|
+
endsWithBlankLine = true;
|
|
271
|
+
}
|
|
303
272
|
}
|
|
304
273
|
|
|
305
274
|
// Check for task list items
|
|
306
275
|
if (this.options.gfm) {
|
|
307
|
-
istask = /^\[[ xX]\] /.
|
|
308
|
-
ischecked = undefined;
|
|
276
|
+
istask = /^\[[ xX]\] /.exec(itemContents);
|
|
309
277
|
if (istask) {
|
|
310
|
-
ischecked =
|
|
311
|
-
|
|
278
|
+
ischecked = istask[0] !== '[ ] ';
|
|
279
|
+
itemContents = itemContents.replace(/^\[[ xX]\] +/, '');
|
|
312
280
|
}
|
|
313
281
|
}
|
|
314
282
|
|
|
315
283
|
list.items.push({
|
|
316
284
|
type: 'list_item',
|
|
317
|
-
raw,
|
|
318
|
-
task: istask,
|
|
285
|
+
raw: raw,
|
|
286
|
+
task: !!istask,
|
|
319
287
|
checked: ischecked,
|
|
320
|
-
loose:
|
|
321
|
-
text:
|
|
288
|
+
loose: false,
|
|
289
|
+
text: itemContents
|
|
322
290
|
});
|
|
291
|
+
|
|
292
|
+
list.raw += raw;
|
|
293
|
+
src = src.slice(raw.length);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic
|
|
297
|
+
list.items[list.items.length - 1].raw = raw.trimRight();
|
|
298
|
+
list.items[list.items.length - 1].text = itemContents.trimRight();
|
|
299
|
+
list.raw = list.raw.trimRight();
|
|
300
|
+
|
|
301
|
+
const l = list.items.length;
|
|
302
|
+
|
|
303
|
+
// Item child tokens handled here at end because we needed to have the final item to trim it first
|
|
304
|
+
for (i = 0; i < l; i++) {
|
|
305
|
+
this.lexer.state.top = false;
|
|
306
|
+
list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);
|
|
307
|
+
if (list.items[i].tokens.some(t => t.type === 'space')) {
|
|
308
|
+
list.loose = true;
|
|
309
|
+
list.items[i].loose = true;
|
|
310
|
+
}
|
|
323
311
|
}
|
|
324
312
|
|
|
325
313
|
return list;
|
|
@@ -329,15 +317,20 @@ module.exports = class Tokenizer {
|
|
|
329
317
|
html(src) {
|
|
330
318
|
const cap = this.rules.block.html.exec(src);
|
|
331
319
|
if (cap) {
|
|
332
|
-
|
|
333
|
-
type:
|
|
334
|
-
? 'paragraph'
|
|
335
|
-
: 'html',
|
|
320
|
+
const token = {
|
|
321
|
+
type: 'html',
|
|
336
322
|
raw: cap[0],
|
|
337
323
|
pre: !this.options.sanitizer
|
|
338
324
|
&& (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),
|
|
339
|
-
text:
|
|
325
|
+
text: cap[0]
|
|
340
326
|
};
|
|
327
|
+
if (this.options.sanitize) {
|
|
328
|
+
token.type = 'paragraph';
|
|
329
|
+
token.text = this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]);
|
|
330
|
+
token.tokens = [];
|
|
331
|
+
this.lexer.inline(token.text, token.tokens);
|
|
332
|
+
}
|
|
333
|
+
return token;
|
|
341
334
|
}
|
|
342
335
|
}
|
|
343
336
|
|
|
@@ -361,16 +354,16 @@ module.exports = class Tokenizer {
|
|
|
361
354
|
if (cap) {
|
|
362
355
|
const item = {
|
|
363
356
|
type: 'table',
|
|
364
|
-
header: splitCells(cap[1].
|
|
357
|
+
header: splitCells(cap[1]).map(c => { return { text: c }; }),
|
|
365
358
|
align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
|
|
366
|
-
|
|
359
|
+
rows: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : []
|
|
367
360
|
};
|
|
368
361
|
|
|
369
362
|
if (item.header.length === item.align.length) {
|
|
370
363
|
item.raw = cap[0];
|
|
371
364
|
|
|
372
365
|
let l = item.align.length;
|
|
373
|
-
let i;
|
|
366
|
+
let i, j, k, row;
|
|
374
367
|
for (i = 0; i < l; i++) {
|
|
375
368
|
if (/^ *-+: *$/.test(item.align[i])) {
|
|
376
369
|
item.align[i] = 'right';
|
|
@@ -383,11 +376,28 @@ module.exports = class Tokenizer {
|
|
|
383
376
|
}
|
|
384
377
|
}
|
|
385
378
|
|
|
386
|
-
l = item.
|
|
379
|
+
l = item.rows.length;
|
|
387
380
|
for (i = 0; i < l; i++) {
|
|
388
|
-
item.
|
|
389
|
-
|
|
390
|
-
|
|
381
|
+
item.rows[i] = splitCells(item.rows[i], item.header.length).map(c => { return { text: c }; });
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
// parse child tokens inside headers and cells
|
|
385
|
+
|
|
386
|
+
// header child tokens
|
|
387
|
+
l = item.header.length;
|
|
388
|
+
for (j = 0; j < l; j++) {
|
|
389
|
+
item.header[j].tokens = [];
|
|
390
|
+
this.lexer.inlineTokens(item.header[j].text, item.header[j].tokens);
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
// cell child tokens
|
|
394
|
+
l = item.rows.length;
|
|
395
|
+
for (j = 0; j < l; j++) {
|
|
396
|
+
row = item.rows[j];
|
|
397
|
+
for (k = 0; k < row.length; k++) {
|
|
398
|
+
row[k].tokens = [];
|
|
399
|
+
this.lexer.inlineTokens(row[k].text, row[k].tokens);
|
|
400
|
+
}
|
|
391
401
|
}
|
|
392
402
|
|
|
393
403
|
return item;
|
|
@@ -398,36 +408,45 @@ module.exports = class Tokenizer {
|
|
|
398
408
|
lheading(src) {
|
|
399
409
|
const cap = this.rules.block.lheading.exec(src);
|
|
400
410
|
if (cap) {
|
|
401
|
-
|
|
411
|
+
const token = {
|
|
402
412
|
type: 'heading',
|
|
403
413
|
raw: cap[0],
|
|
404
414
|
depth: cap[2].charAt(0) === '=' ? 1 : 2,
|
|
405
|
-
text: cap[1]
|
|
415
|
+
text: cap[1],
|
|
416
|
+
tokens: []
|
|
406
417
|
};
|
|
418
|
+
this.lexer.inline(token.text, token.tokens);
|
|
419
|
+
return token;
|
|
407
420
|
}
|
|
408
421
|
}
|
|
409
422
|
|
|
410
423
|
paragraph(src) {
|
|
411
424
|
const cap = this.rules.block.paragraph.exec(src);
|
|
412
425
|
if (cap) {
|
|
413
|
-
|
|
426
|
+
const token = {
|
|
414
427
|
type: 'paragraph',
|
|
415
428
|
raw: cap[0],
|
|
416
429
|
text: cap[1].charAt(cap[1].length - 1) === '\n'
|
|
417
430
|
? cap[1].slice(0, -1)
|
|
418
|
-
: cap[1]
|
|
431
|
+
: cap[1],
|
|
432
|
+
tokens: []
|
|
419
433
|
};
|
|
434
|
+
this.lexer.inline(token.text, token.tokens);
|
|
435
|
+
return token;
|
|
420
436
|
}
|
|
421
437
|
}
|
|
422
438
|
|
|
423
439
|
text(src) {
|
|
424
440
|
const cap = this.rules.block.text.exec(src);
|
|
425
441
|
if (cap) {
|
|
426
|
-
|
|
442
|
+
const token = {
|
|
427
443
|
type: 'text',
|
|
428
444
|
raw: cap[0],
|
|
429
|
-
text: cap[0]
|
|
445
|
+
text: cap[0],
|
|
446
|
+
tokens: []
|
|
430
447
|
};
|
|
448
|
+
this.lexer.inline(token.text, token.tokens);
|
|
449
|
+
return token;
|
|
431
450
|
}
|
|
432
451
|
}
|
|
433
452
|
|
|
@@ -442,18 +461,18 @@ module.exports = class Tokenizer {
|
|
|
442
461
|
}
|
|
443
462
|
}
|
|
444
463
|
|
|
445
|
-
tag(src
|
|
464
|
+
tag(src) {
|
|
446
465
|
const cap = this.rules.inline.tag.exec(src);
|
|
447
466
|
if (cap) {
|
|
448
|
-
if (!inLink && /^<a /i.test(cap[0])) {
|
|
449
|
-
inLink = true;
|
|
450
|
-
} else if (inLink && /^<\/a>/i.test(cap[0])) {
|
|
451
|
-
inLink = false;
|
|
467
|
+
if (!this.lexer.state.inLink && /^<a /i.test(cap[0])) {
|
|
468
|
+
this.lexer.state.inLink = true;
|
|
469
|
+
} else if (this.lexer.state.inLink && /^<\/a>/i.test(cap[0])) {
|
|
470
|
+
this.lexer.state.inLink = false;
|
|
452
471
|
}
|
|
453
|
-
if (!inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) {
|
|
454
|
-
inRawBlock = true;
|
|
455
|
-
} else if (inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) {
|
|
456
|
-
inRawBlock = false;
|
|
472
|
+
if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) {
|
|
473
|
+
this.lexer.state.inRawBlock = true;
|
|
474
|
+
} else if (this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) {
|
|
475
|
+
this.lexer.state.inRawBlock = false;
|
|
457
476
|
}
|
|
458
477
|
|
|
459
478
|
return {
|
|
@@ -461,8 +480,8 @@ module.exports = class Tokenizer {
|
|
|
461
480
|
? 'text'
|
|
462
481
|
: 'html',
|
|
463
482
|
raw: cap[0],
|
|
464
|
-
inLink,
|
|
465
|
-
inRawBlock,
|
|
483
|
+
inLink: this.lexer.state.inLink,
|
|
484
|
+
inRawBlock: this.lexer.state.inRawBlock,
|
|
466
485
|
text: this.options.sanitize
|
|
467
486
|
? (this.options.sanitizer
|
|
468
487
|
? this.options.sanitizer(cap[0])
|
|
@@ -524,7 +543,7 @@ module.exports = class Tokenizer {
|
|
|
524
543
|
return outputLink(cap, {
|
|
525
544
|
href: href ? href.replace(this.rules.inline._escapes, '$1') : href,
|
|
526
545
|
title: title ? title.replace(this.rules.inline._escapes, '$1') : title
|
|
527
|
-
}, cap[0]);
|
|
546
|
+
}, cap[0], this.lexer);
|
|
528
547
|
}
|
|
529
548
|
}
|
|
530
549
|
|
|
@@ -542,7 +561,7 @@ module.exports = class Tokenizer {
|
|
|
542
561
|
text
|
|
543
562
|
};
|
|
544
563
|
}
|
|
545
|
-
return outputLink(cap, link, cap[0]);
|
|
564
|
+
return outputLink(cap, link, cap[0], this.lexer);
|
|
546
565
|
}
|
|
547
566
|
}
|
|
548
567
|
|
|
@@ -550,7 +569,8 @@ module.exports = class Tokenizer {
|
|
|
550
569
|
let match = this.rules.inline.emStrong.lDelim.exec(src);
|
|
551
570
|
if (!match) return;
|
|
552
571
|
|
|
553
|
-
|
|
572
|
+
// _ can't be between two alphanumerics. \p{L}\p{N} includes non-english alphabet/numbers as well
|
|
573
|
+
if (match[3] && prevChar.match(/[\p{L}\p{N}]/u)) return;
|
|
554
574
|
|
|
555
575
|
const nextChar = match[1] || match[2] || '';
|
|
556
576
|
|
|
@@ -561,12 +581,13 @@ module.exports = class Tokenizer {
|
|
|
561
581
|
const endReg = match[0][0] === '*' ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd;
|
|
562
582
|
endReg.lastIndex = 0;
|
|
563
583
|
|
|
564
|
-
|
|
584
|
+
// Clip maskedSrc to same section of string as src (move to lexer?)
|
|
585
|
+
maskedSrc = maskedSrc.slice(-1 * src.length + lLength);
|
|
565
586
|
|
|
566
587
|
while ((match = endReg.exec(maskedSrc)) != null) {
|
|
567
588
|
rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];
|
|
568
589
|
|
|
569
|
-
if (!rDelim) continue; //
|
|
590
|
+
if (!rDelim) continue; // skip single * in __abc*abc__
|
|
570
591
|
|
|
571
592
|
rLength = rDelim.length;
|
|
572
593
|
|
|
@@ -584,25 +605,28 @@ module.exports = class Tokenizer {
|
|
|
584
605
|
|
|
585
606
|
if (delimTotal > 0) continue; // Haven't found enough closing delimiters
|
|
586
607
|
|
|
587
|
-
//
|
|
588
|
-
|
|
589
|
-
rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);
|
|
590
|
-
}
|
|
608
|
+
// Remove extra characters. *a*** -> *a*
|
|
609
|
+
rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);
|
|
591
610
|
|
|
611
|
+
// Create `em` if smallest delimiter has odd char count. *a***
|
|
592
612
|
if (Math.min(lLength, rLength) % 2) {
|
|
613
|
+
const text = src.slice(1, lLength + match.index + rLength);
|
|
593
614
|
return {
|
|
594
615
|
type: 'em',
|
|
595
616
|
raw: src.slice(0, lLength + match.index + rLength + 1),
|
|
596
|
-
text
|
|
597
|
-
|
|
598
|
-
}
|
|
599
|
-
if (Math.min(lLength, rLength) % 2 === 0) {
|
|
600
|
-
return {
|
|
601
|
-
type: 'strong',
|
|
602
|
-
raw: src.slice(0, lLength + match.index + rLength + 1),
|
|
603
|
-
text: src.slice(2, lLength + match.index + rLength - 1)
|
|
617
|
+
text,
|
|
618
|
+
tokens: this.lexer.inlineTokens(text, [])
|
|
604
619
|
};
|
|
605
620
|
}
|
|
621
|
+
|
|
622
|
+
// Create 'strong' if smallest delimiter has even char count. **a***
|
|
623
|
+
const text = src.slice(2, lLength + match.index + rLength - 1);
|
|
624
|
+
return {
|
|
625
|
+
type: 'strong',
|
|
626
|
+
raw: src.slice(0, lLength + match.index + rLength + 1),
|
|
627
|
+
text,
|
|
628
|
+
tokens: this.lexer.inlineTokens(text, [])
|
|
629
|
+
};
|
|
606
630
|
}
|
|
607
631
|
}
|
|
608
632
|
}
|
|
@@ -641,7 +665,8 @@ module.exports = class Tokenizer {
|
|
|
641
665
|
return {
|
|
642
666
|
type: 'del',
|
|
643
667
|
raw: cap[0],
|
|
644
|
-
text: cap[2]
|
|
668
|
+
text: cap[2],
|
|
669
|
+
tokens: this.lexer.inlineTokens(cap[2], [])
|
|
645
670
|
};
|
|
646
671
|
}
|
|
647
672
|
}
|
|
@@ -711,11 +736,11 @@ module.exports = class Tokenizer {
|
|
|
711
736
|
}
|
|
712
737
|
}
|
|
713
738
|
|
|
714
|
-
inlineText(src,
|
|
739
|
+
inlineText(src, smartypants) {
|
|
715
740
|
const cap = this.rules.inline.text.exec(src);
|
|
716
741
|
if (cap) {
|
|
717
742
|
let text;
|
|
718
|
-
if (inRawBlock) {
|
|
743
|
+
if (this.lexer.state.inRawBlock) {
|
|
719
744
|
text = this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0])) : cap[0];
|
|
720
745
|
} else {
|
|
721
746
|
text = escape(this.options.smartypants ? smartypants(cap[0]) : cap[0]);
|
|
@@ -727,4 +752,4 @@ module.exports = class Tokenizer {
|
|
|
727
752
|
};
|
|
728
753
|
}
|
|
729
754
|
}
|
|
730
|
-
}
|
|
755
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
function getDefaults() {
|
|
1
|
+
export function getDefaults() {
|
|
2
2
|
return {
|
|
3
3
|
baseUrl: null,
|
|
4
4
|
breaks: false,
|
|
5
|
+
extensions: null,
|
|
5
6
|
gfm: true,
|
|
6
7
|
headerIds: true,
|
|
7
8
|
headerPrefix: '',
|
|
@@ -21,12 +22,8 @@ function getDefaults() {
|
|
|
21
22
|
};
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
module.exports.defaults = newDefaults;
|
|
26
|
-
}
|
|
25
|
+
export let defaults = getDefaults();
|
|
27
26
|
|
|
28
|
-
|
|
29
|
-
defaults
|
|
30
|
-
|
|
31
|
-
changeDefaults
|
|
32
|
-
};
|
|
27
|
+
export function changeDefaults(newDefaults) {
|
|
28
|
+
defaults = newDefaults;
|
|
29
|
+
}
|