chrome-devtools-frontend 1.0.1636056 → 1.0.1640418
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/front_end/core/common/Color.ts +0 -4
- package/front_end/core/host/AidaClientTypes.ts +8 -6
- package/front_end/core/root/Runtime.ts +2 -2
- package/front_end/core/sdk/DOMStorageModel.ts +1 -1
- package/front_end/core/sdk/SourceMap.ts +8 -3
- package/front_end/core/sdk/TargetManager.ts +14 -1
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +147 -0
- package/front_end/generated/ARIAProperties.js +17 -4
- package/front_end/generated/InspectorBackendCommands.ts +13 -7
- package/front_end/generated/SupportedCSSProperties.js +1 -0
- package/front_end/generated/protocol-mapping.d.ts +7 -0
- package/front_end/generated/protocol-proxy-api.d.ts +14 -0
- package/front_end/generated/protocol.ts +120 -2
- package/front_end/global_typings/global_defs.d.ts +13 -0
- package/front_end/models/ai_assistance/AiAgent2.ts +116 -0
- package/front_end/models/ai_assistance/AiConversation.ts +22 -36
- package/front_end/models/ai_assistance/AiHistoryStorage.ts +0 -1
- package/front_end/models/ai_assistance/AiOrigins.ts +46 -0
- package/front_end/models/ai_assistance/AiUtils.ts +9 -0
- package/front_end/models/ai_assistance/README.md +16 -0
- package/front_end/models/ai_assistance/StorageItem.ts +30 -26
- package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +12 -5
- package/front_end/models/ai_assistance/agents/AiAgent.ts +86 -32
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +31 -10
- package/front_end/models/ai_assistance/agents/ConversationSummaryAgent.ts +1 -1
- package/front_end/models/ai_assistance/agents/FileAgent.ts +2 -2
- package/front_end/models/ai_assistance/agents/GreenDevAgent.ts +1 -3
- package/front_end/models/ai_assistance/agents/NetworkAgent.snapshot.txt +19 -0
- package/front_end/models/ai_assistance/agents/NetworkAgent.ts +9 -4
- package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +41 -12
- package/front_end/models/ai_assistance/agents/StorageAgent.ts +442 -122
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +2 -2
- package/front_end/models/ai_assistance/ai_assistance.ts +4 -2
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/performance/AIContext.ts +7 -8
- package/front_end/models/ai_assistance/skills/README.md +40 -0
- package/front_end/models/ai_assistance/skills/Skill.ts +13 -0
- package/front_end/models/ai_assistance/skills/SkillRegistry.ts +10 -0
- package/front_end/models/ai_assistance/skills/styling.md +6 -0
- package/front_end/models/bindings/CompilerScriptMapping.ts +12 -4
- package/front_end/models/breakpoints/BreakpointManager.ts +54 -2
- package/front_end/models/greendev/Prototypes.ts +0 -7
- package/front_end/models/heap_snapshot/HeapSnapshotModel.ts +20 -0
- package/front_end/models/heap_snapshot/HeapSnapshotProxy.ts +5 -0
- package/front_end/models/issues_manager/EmailVerificationRequestIssue.ts +293 -0
- package/front_end/models/issues_manager/IssuesManager.ts +5 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestDnsFetchFailed.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestDnsInvalidRecord.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestInvalidEmail.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestKeyBindingSigningFailed.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestRpOriginIsOpaque.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestTokenHttpNotFound.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestTokenInvalidContentType.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestTokenInvalidResponse.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestTokenInvalidSdJwt.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestTokenMalformedSdJwt.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestTokenNoResponse.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestUserLoggedOut.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownAccountsEndpointCrossOrigin.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownHttpNotFound.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownInvalidContentType.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownInvalidResponse.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownIssuanceEndpointCrossOrigin.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownListEmpty.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownMissingAccountsEndpoint.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownMissingIssuanceEndpoint.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownNoResponse.md +1 -0
- package/front_end/models/issues_manager/descriptions/emailVerificationRequestWellKnownUnsupportedSigningAlgorithm.md +1 -0
- package/front_end/models/issues_manager/issues_manager.ts +2 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +1748 -1739
- package/front_end/models/live-metrics/web-vitals-injected/web-vitals-injected.ts +1 -1
- package/front_end/models/stack_trace/DetailedErrorStackParser.ts +9 -1
- package/front_end/models/stack_trace/StackTraceImpl.ts +29 -9
- package/front_end/models/stack_trace/StackTraceModel.ts +23 -11
- package/front_end/models/stack_trace/Trie.ts +11 -1
- package/front_end/models/trace/extras/TraceTree.ts +20 -1
- package/front_end/models/trace/insights/Common.ts +9 -0
- package/front_end/models/trace/lantern/core/NetworkAnalyzer.ts +21 -25
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +19 -75
- package/front_end/panels/ai_assistance/components/AccessibilityAgentMarkdownRenderer.ts +10 -3
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +148 -2
- package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +2 -3
- package/front_end/panels/ai_assistance/components/chatMessage.css +27 -0
- package/front_end/panels/application/CookieItemsView.ts +24 -0
- package/front_end/panels/application/DOMStorageItemsView.ts +9 -4
- package/front_end/panels/application/preloading/components/PreloadingString.ts +6 -0
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +4 -4
- package/front_end/panels/console/ConsoleViewMessage.ts +13 -102
- package/front_end/panels/elements/StandaloneStylesContainer.ts +10 -0
- package/front_end/panels/elements/StylePropertiesSection.ts +6 -2
- package/front_end/panels/elements/StylePropertyTreeElement.ts +30 -1
- package/front_end/panels/elements/StylesContainer.ts +3 -0
- package/front_end/panels/elements/StylesSidebarPane.ts +54 -4
- package/front_end/panels/elements/elements-meta.ts +14 -0
- package/front_end/panels/layer_viewer/layerDetailsView.css +1 -1
- package/front_end/panels/lighthouse/LighthouseController.ts +1 -1
- package/front_end/panels/lighthouse/LighthouseProtocolService.ts +4 -4
- package/front_end/panels/network/NetworkDataGridNode.ts +14 -0
- package/front_end/panels/network/NetworkLogViewColumns.ts +2 -2
- package/front_end/panels/network/RequestHeadersView.ts +55 -19
- package/front_end/panels/network/networkTimingTable.css +2 -4
- package/front_end/panels/recorder/components/ReplaySection.ts +28 -16
- package/front_end/panels/recorder/converters/LighthouseConverter.snapshot.txt +47 -0
- package/front_end/panels/recorder/converters/PuppeteerConverter.snapshot.txt +49 -0
- package/front_end/panels/recorder/converters/PuppeteerReplayConverter.snapshot.txt +33 -0
- package/front_end/panels/settings/SettingsScreen.ts +1 -2
- package/front_end/panels/sources/BreakpointsView.ts +23 -42
- package/front_end/panels/sources/DebuggerPlugin.ts +12 -5
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +169 -106
- package/front_end/panels/timeline/components/IgnoreListSetting.ts +1 -0
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +2 -2
- package/front_end/third_party/marked/README.chromium +3 -6
- package/front_end/third_party/marked/package/README.md +5 -5
- package/front_end/third_party/marked/package/bin/main.js +27 -22
- package/front_end/third_party/marked/package/bin/marked.js +2 -1
- package/front_end/third_party/marked/package/lib/marked.esm.d.ts +346 -256
- package/front_end/third_party/marked/package/lib/marked.esm.js +67 -2698
- package/front_end/third_party/marked/package/lib/marked.esm.js.map +7 -1
- package/front_end/third_party/marked/package/lib/marked.umd.js +69 -2722
- package/front_end/third_party/marked/package/lib/marked.umd.js.map +7 -1
- package/front_end/third_party/marked/package/man/marked.1 +4 -2
- package/front_end/third_party/marked/package/man/marked.1.md +2 -1
- package/front_end/third_party/marked/package/package.json +49 -57
- package/front_end/third_party/puppeteer-replay/README.chromium +2 -2
- package/front_end/third_party/puppeteer-replay/package/lib/cli.js +84 -80
- package/front_end/third_party/puppeteer-replay/package/lib/cli.js.map +1 -1
- package/front_end/third_party/puppeteer-replay/package/lib/extension-test.js +79 -83
- package/front_end/third_party/puppeteer-replay/package/lib/extension-test.js.map +1 -1
- package/front_end/third_party/puppeteer-replay/package/lib/main.d.ts +43 -171
- package/front_end/third_party/puppeteer-replay/package/lib/main.js +51 -206
- package/front_end/third_party/puppeteer-replay/package/lib/main.js.map +1 -1
- package/front_end/third_party/puppeteer-replay/package/package.json +37 -67
- package/front_end/tsconfig.json +1 -1
- package/front_end/ui/components/markdown_view/CodeBlock.ts +17 -6
- package/front_end/ui/components/markdown_view/MarkdownView.ts +39 -3
- package/front_end/ui/components/markdown_view/codeBlock.css +11 -0
- package/front_end/ui/components/markdown_view/markdownView.css +17 -0
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +0 -79
- package/front_end/ui/legacy/components/object_ui/RemoteObjectPreviewFormatter.ts +16 -4
- package/front_end/ui/visual_logging/KnownContextValues.ts +4 -0
- package/inspector_overlay/testing/InspectorOverlayHelpers.ts +2 -0
- package/mcp/mcp.ts +1 -6
- package/package.json +14 -16
- package/front_end/models/ai_assistance/agents/BreakpointDebuggerAgent.ts +0 -1015
- package/front_end/models/ai_assistance/agents/BreakpointDebuggerAgentOverlay.ts +0 -87
- package/front_end/third_party/marked/package/bin/marked +0 -215
- package/front_end/third_party/marked/package/lib/marked.cjs +0 -2726
- package/front_end/third_party/marked/package/lib/marked.cjs.map +0 -1
- package/front_end/third_party/marked/package/lib/marked.d.cts +0 -670
- package/front_end/third_party/marked/package/lib/marked.js +0 -2780
- package/front_end/third_party/marked/package/man/marked.1.txt +0 -86
- package/front_end/third_party/marked/package/marked.min.js +0 -6
- package/front_end/third_party/marked/package/src/Lexer.js +0 -492
- package/front_end/third_party/marked/package/src/Parser.js +0 -286
- package/front_end/third_party/marked/package/src/Renderer.js +0 -166
- package/front_end/third_party/marked/package/src/Slugger.js +0 -49
- package/front_end/third_party/marked/package/src/TextRenderer.js +0 -42
- package/front_end/third_party/marked/package/src/Tokenizer.js +0 -755
- package/front_end/third_party/marked/package/src/defaults.js +0 -29
- package/front_end/third_party/marked/package/src/helpers.js +0 -249
- package/front_end/third_party/marked/package/src/marked.js +0 -350
- package/front_end/third_party/marked/package/src/rules.js +0 -285
- package/front_end/third_party/puppeteer-replay/package/lib/cjs/main.cjs +0 -2099
- package/front_end/third_party/puppeteer-replay/package/lib/cjs/main.cjs.map +0 -1
- package/front_end/third_party/puppeteer-replay/package/lib/cjs/main.d.cts +0 -686
- package/front_end/third_party/puppeteer-replay/package/lib/cjs/main.d.ts +0 -35
- package/mcp/HostBindings.ts +0 -319
- /package/front_end/third_party/marked/package/{LICENSE.md → LICENSE} +0 -0
|
@@ -1,285 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
edit,
|
|
3
|
-
merge
|
|
4
|
-
,
|
|
5
|
-
noopTest} from './helpers.js';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Block-Level Grammar
|
|
9
|
-
*/
|
|
10
|
-
export const block = {
|
|
11
|
-
newline: /^(?: *(?:\n|$))+/,
|
|
12
|
-
code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,
|
|
13
|
-
fences: /^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,
|
|
14
|
-
hr: /^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,
|
|
15
|
-
heading: /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,
|
|
16
|
-
blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,
|
|
17
|
-
list: /^( {0,3}bull)( [^\n]+?)?(?:\n|$)/,
|
|
18
|
-
html: '^ {0,3}(?:' // optional indentation
|
|
19
|
-
+ '<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)' // (1)
|
|
20
|
-
+ '|comment[^\\n]*(\\n+|$)' // (2)
|
|
21
|
-
+ '|<\\?[\\s\\S]*?(?:\\?>\\n*|$)' // (3)
|
|
22
|
-
+ '|<![A-Z][\\s\\S]*?(?:>\\n*|$)' // (4)
|
|
23
|
-
+ '|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)' // (5)
|
|
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
|
-
+ ')',
|
|
28
|
-
def: /^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,
|
|
29
|
-
table: noopTest,
|
|
30
|
-
lheading: /^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
31
|
-
// regex template, placeholders will be replaced according to different paragraph
|
|
32
|
-
// interruption rules of commonmark and the original markdown spec:
|
|
33
|
-
_paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,
|
|
34
|
-
text: /^[^\n]+/
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
block._label = /(?!\s*\])(?:\\[\[\]]|[^\[\]])+/;
|
|
38
|
-
block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;
|
|
39
|
-
block.def = edit(block.def)
|
|
40
|
-
.replace('label', block._label)
|
|
41
|
-
.replace('title', block._title)
|
|
42
|
-
.getRegex();
|
|
43
|
-
|
|
44
|
-
block.bullet = /(?:[*+-]|\d{1,9}[.)])/;
|
|
45
|
-
block.listItemStart = edit(/^( *)(bull) */)
|
|
46
|
-
.replace('bull', block.bullet)
|
|
47
|
-
.getRegex();
|
|
48
|
-
|
|
49
|
-
block.list = edit(block.list)
|
|
50
|
-
.replace(/bull/g, block.bullet)
|
|
51
|
-
.replace('hr', '\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))')
|
|
52
|
-
.replace('def', '\\n+(?=' + block.def.source + ')')
|
|
53
|
-
.getRegex();
|
|
54
|
-
|
|
55
|
-
block._tag = 'address|article|aside|base|basefont|blockquote|body|caption'
|
|
56
|
-
+ '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'
|
|
57
|
-
+ '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'
|
|
58
|
-
+ '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'
|
|
59
|
-
+ '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr'
|
|
60
|
-
+ '|track|ul';
|
|
61
|
-
block._comment = /<!--(?!-?>)[\s\S]*?(?:-->|$)/;
|
|
62
|
-
block.html = edit(block.html, 'i')
|
|
63
|
-
.replace('comment', block._comment)
|
|
64
|
-
.replace('tag', block._tag)
|
|
65
|
-
.replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/)
|
|
66
|
-
.getRegex();
|
|
67
|
-
|
|
68
|
-
block.paragraph = edit(block._paragraph)
|
|
69
|
-
.replace('hr', block.hr)
|
|
70
|
-
.replace('heading', ' {0,3}#{1,6} ')
|
|
71
|
-
.replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs
|
|
72
|
-
.replace('blockquote', ' {0,3}>')
|
|
73
|
-
.replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n')
|
|
74
|
-
.replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
|
|
75
|
-
.replace('html', '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)')
|
|
76
|
-
.replace('tag', block._tag) // pars can be interrupted by type (6) html blocks
|
|
77
|
-
.getRegex();
|
|
78
|
-
|
|
79
|
-
block.blockquote = edit(block.blockquote)
|
|
80
|
-
.replace('paragraph', block.paragraph)
|
|
81
|
-
.getRegex();
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Normal Block Grammar
|
|
85
|
-
*/
|
|
86
|
-
|
|
87
|
-
block.normal = merge({}, block);
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* GFM Block Grammar
|
|
91
|
-
*/
|
|
92
|
-
|
|
93
|
-
block.gfm = merge({}, block.normal, {
|
|
94
|
-
table: '^ *([^\\n ].*\\|.*)\\n' // Header
|
|
95
|
-
+ ' {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?' // Align
|
|
96
|
-
+ '(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
block.gfm.table = edit(block.gfm.table)
|
|
100
|
-
.replace('hr', block.hr)
|
|
101
|
-
.replace('heading', ' {0,3}#{1,6} ')
|
|
102
|
-
.replace('blockquote', ' {0,3}>')
|
|
103
|
-
.replace('code', ' {4}[^\\n]')
|
|
104
|
-
.replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n')
|
|
105
|
-
.replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
|
|
106
|
-
.replace('html', '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)')
|
|
107
|
-
.replace('tag', block._tag) // tables can be interrupted by type (6) html blocks
|
|
108
|
-
.getRegex();
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Pedantic grammar (original John Gruber's loose markdown specification)
|
|
112
|
-
*/
|
|
113
|
-
|
|
114
|
-
block.pedantic = merge({}, block.normal, {
|
|
115
|
-
html: edit(
|
|
116
|
-
'^ *(?:comment *(?:\\n|\\s*$)'
|
|
117
|
-
+ '|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)' // closed tag
|
|
118
|
-
+ '|<tag(?:"[^"]*"|\'[^\']*\'|\\s[^\'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))')
|
|
119
|
-
.replace('comment', block._comment)
|
|
120
|
-
.replace(/tag/g, '(?!(?:'
|
|
121
|
-
+ 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'
|
|
122
|
-
+ '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'
|
|
123
|
-
+ '\\b)\\w+(?!:|[^\\w\\s@]*@)\\b')
|
|
124
|
-
.getRegex(),
|
|
125
|
-
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
|
|
126
|
-
heading: /^(#{1,6})(.*)(?:\n+|$)/,
|
|
127
|
-
fences: noopTest, // fences not supported
|
|
128
|
-
paragraph: edit(block.normal._paragraph)
|
|
129
|
-
.replace('hr', block.hr)
|
|
130
|
-
.replace('heading', ' *#{1,6} *[^\n]')
|
|
131
|
-
.replace('lheading', block.lheading)
|
|
132
|
-
.replace('blockquote', ' {0,3}>')
|
|
133
|
-
.replace('|fences', '')
|
|
134
|
-
.replace('|list', '')
|
|
135
|
-
.replace('|html', '')
|
|
136
|
-
.getRegex()
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* Inline-Level Grammar
|
|
141
|
-
*/
|
|
142
|
-
export const inline = {
|
|
143
|
-
escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
|
|
144
|
-
autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/,
|
|
145
|
-
url: noopTest,
|
|
146
|
-
tag: '^comment'
|
|
147
|
-
+ '|^</[a-zA-Z][\\w:-]*\\s*>' // self-closing tag
|
|
148
|
-
+ '|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>' // open tag
|
|
149
|
-
+ '|^<\\?[\\s\\S]*?\\?>' // processing instruction, e.g. <?php ?>
|
|
150
|
-
+ '|^<![a-zA-Z]+\\s[\\s\\S]*?>' // declaration, e.g. <!DOCTYPE html>
|
|
151
|
-
+ '|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>', // CDATA section
|
|
152
|
-
link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,
|
|
153
|
-
reflink: /^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,
|
|
154
|
-
nolink: /^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,
|
|
155
|
-
reflinkSearch: 'reflink|nolink(?!\\()',
|
|
156
|
-
emStrong: {
|
|
157
|
-
lDelim: /^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,
|
|
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.
|
|
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 _
|
|
162
|
-
},
|
|
163
|
-
code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,
|
|
164
|
-
br: /^( {2,}|\\)\n(?!\s*$)/,
|
|
165
|
-
del: noopTest,
|
|
166
|
-
text: /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,
|
|
167
|
-
punctuation: /^([\spunctuation])/
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
// list of punctuation marks from CommonMark spec
|
|
171
|
-
// without * and _ to handle the different emphasis markers * and _
|
|
172
|
-
inline._punctuation = '!"#$%&\'()+\\-.,/:;<=>?@\\[\\]`^{|}~';
|
|
173
|
-
inline.punctuation = edit(inline.punctuation).replace(/punctuation/g, inline._punctuation).getRegex();
|
|
174
|
-
|
|
175
|
-
// sequences em should skip over [title](link), `code`, <html>
|
|
176
|
-
inline.blockSkip = /\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;
|
|
177
|
-
inline.escapedEmSt = /\\\*|\\_/g;
|
|
178
|
-
|
|
179
|
-
inline._comment = edit(block._comment).replace('(?:-->|$)', '-->').getRegex();
|
|
180
|
-
|
|
181
|
-
inline.emStrong.lDelim = edit(inline.emStrong.lDelim)
|
|
182
|
-
.replace(/punct/g, inline._punctuation)
|
|
183
|
-
.getRegex();
|
|
184
|
-
|
|
185
|
-
inline.emStrong.rDelimAst = edit(inline.emStrong.rDelimAst, 'g')
|
|
186
|
-
.replace(/punct/g, inline._punctuation)
|
|
187
|
-
.getRegex();
|
|
188
|
-
|
|
189
|
-
inline.emStrong.rDelimUnd = edit(inline.emStrong.rDelimUnd, 'g')
|
|
190
|
-
.replace(/punct/g, inline._punctuation)
|
|
191
|
-
.getRegex();
|
|
192
|
-
|
|
193
|
-
inline._escapes = /\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;
|
|
194
|
-
|
|
195
|
-
inline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;
|
|
196
|
-
inline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;
|
|
197
|
-
inline.autolink = edit(inline.autolink)
|
|
198
|
-
.replace('scheme', inline._scheme)
|
|
199
|
-
.replace('email', inline._email)
|
|
200
|
-
.getRegex();
|
|
201
|
-
|
|
202
|
-
inline._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;
|
|
203
|
-
|
|
204
|
-
inline.tag = edit(inline.tag)
|
|
205
|
-
.replace('comment', inline._comment)
|
|
206
|
-
.replace('attribute', inline._attribute)
|
|
207
|
-
.getRegex();
|
|
208
|
-
|
|
209
|
-
inline._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
|
|
210
|
-
inline._href = /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;
|
|
211
|
-
inline._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;
|
|
212
|
-
|
|
213
|
-
inline.link = edit(inline.link)
|
|
214
|
-
.replace('label', inline._label)
|
|
215
|
-
.replace('href', inline._href)
|
|
216
|
-
.replace('title', inline._title)
|
|
217
|
-
.getRegex();
|
|
218
|
-
|
|
219
|
-
inline.reflink = edit(inline.reflink)
|
|
220
|
-
.replace('label', inline._label)
|
|
221
|
-
.getRegex();
|
|
222
|
-
|
|
223
|
-
inline.reflinkSearch = edit(inline.reflinkSearch, 'g')
|
|
224
|
-
.replace('reflink', inline.reflink)
|
|
225
|
-
.replace('nolink', inline.nolink)
|
|
226
|
-
.getRegex();
|
|
227
|
-
|
|
228
|
-
/**
|
|
229
|
-
* Normal Inline Grammar
|
|
230
|
-
*/
|
|
231
|
-
|
|
232
|
-
inline.normal = merge({}, inline);
|
|
233
|
-
|
|
234
|
-
/**
|
|
235
|
-
* Pedantic Inline Grammar
|
|
236
|
-
*/
|
|
237
|
-
|
|
238
|
-
inline.pedantic = merge({}, inline.normal, {
|
|
239
|
-
strong: {
|
|
240
|
-
start: /^__|\*\*/,
|
|
241
|
-
middle: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
|
|
242
|
-
endAst: /\*\*(?!\*)/g,
|
|
243
|
-
endUnd: /__(?!_)/g
|
|
244
|
-
},
|
|
245
|
-
em: {
|
|
246
|
-
start: /^_|\*/,
|
|
247
|
-
middle: /^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,
|
|
248
|
-
endAst: /\*(?!\*)/g,
|
|
249
|
-
endUnd: /_(?!_)/g
|
|
250
|
-
},
|
|
251
|
-
link: edit(/^!?\[(label)\]\((.*?)\)/)
|
|
252
|
-
.replace('label', inline._label)
|
|
253
|
-
.getRegex(),
|
|
254
|
-
reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/)
|
|
255
|
-
.replace('label', inline._label)
|
|
256
|
-
.getRegex()
|
|
257
|
-
});
|
|
258
|
-
|
|
259
|
-
/**
|
|
260
|
-
* GFM Inline Grammar
|
|
261
|
-
*/
|
|
262
|
-
|
|
263
|
-
inline.gfm = merge({}, inline.normal, {
|
|
264
|
-
escape: edit(inline.escape).replace('])', '~|])').getRegex(),
|
|
265
|
-
_extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,
|
|
266
|
-
url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,
|
|
267
|
-
_backpedal: /(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,
|
|
268
|
-
del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,
|
|
269
|
-
text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
|
|
270
|
-
});
|
|
271
|
-
|
|
272
|
-
inline.gfm.url = edit(inline.gfm.url, 'i')
|
|
273
|
-
.replace('email', inline.gfm._extended_email)
|
|
274
|
-
.getRegex();
|
|
275
|
-
/**
|
|
276
|
-
* GFM + Line Breaks Inline Grammar
|
|
277
|
-
*/
|
|
278
|
-
|
|
279
|
-
inline.breaks = merge({}, inline.gfm, {
|
|
280
|
-
br: edit(inline.br).replace('{2,}', '*').getRegex(),
|
|
281
|
-
text: edit(inline.gfm.text)
|
|
282
|
-
.replace('\\b_', '\\b_| {2,}\\n')
|
|
283
|
-
.replace(/\{2,\}/g, '*')
|
|
284
|
-
.getRegex()
|
|
285
|
-
});
|