chrome-devtools-frontend 1.0.944427 → 1.0.945677

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.
Files changed (327) hide show
  1. package/config/gni/devtools_grd_files.gni +4 -0
  2. package/config/gni/devtools_image_files.gni +1 -0
  3. package/front_end/Images/src/circled_exclamation_icon.svg +3 -0
  4. package/front_end/core/common/ParsedURL.ts +1 -1
  5. package/front_end/core/host/UserMetrics.ts +3 -1
  6. package/front_end/core/i18n/i18nImpl.ts +7 -4
  7. package/front_end/core/i18n/locales/en-US.json +3 -60
  8. package/front_end/core/i18n/locales/en-XL.json +15 -72
  9. package/front_end/core/protocol_client/NodeURL.ts +1 -0
  10. package/front_end/core/sdk/CSSMetadata.ts +0 -1
  11. package/front_end/core/sdk/CSSStyleSheetHeader.ts +2 -3
  12. package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +2 -3
  13. package/front_end/core/sdk/Cookie.ts +17 -0
  14. package/front_end/core/sdk/CookieModel.ts +1 -0
  15. package/front_end/core/sdk/DebuggerModel.ts +5 -4
  16. package/front_end/core/sdk/NetworkManager.ts +4 -1
  17. package/front_end/core/sdk/NetworkRequest.ts +2 -2
  18. package/front_end/core/sdk/Resource.ts +2 -2
  19. package/front_end/core/sdk/Script.ts +2 -3
  20. package/front_end/entrypoints/main/MainImpl.ts +6 -0
  21. package/front_end/generated/protocol.d.ts +0 -4
  22. package/front_end/models/bindings/BreakpointManager.ts +3 -4
  23. package/front_end/models/bindings/ResourceMapping.ts +1 -2
  24. package/front_end/models/bindings/StylesSourceMapping.ts +1 -2
  25. package/front_end/models/emulation/EmulatedDevices.ts +2 -4
  26. package/front_end/models/persistence/IsolatedFileSystem.ts +7 -6
  27. package/front_end/models/persistence/PersistenceActions.ts +4 -1
  28. package/front_end/models/persistence/PlatformFileSystem.ts +3 -4
  29. package/front_end/models/text_utils/ContentProvider.ts +1 -2
  30. package/front_end/models/text_utils/StaticContentProvider.ts +2 -3
  31. package/front_end/models/timeline_model/TimelineJSProfile.ts +16 -3
  32. package/front_end/models/timeline_model/TimelineModel.ts +1 -0
  33. package/front_end/models/workspace/UISourceCode.ts +2 -2
  34. package/front_end/models/workspace_diff/WorkspaceDiff.ts +20 -6
  35. package/front_end/panels/animation/AnimationTimeline.ts +1 -1
  36. package/front_end/panels/animation/animationTimeline.css +2 -0
  37. package/front_end/panels/application/BackForwardCacheStrings.ts +15 -75
  38. package/front_end/panels/application/BackForwardCacheView.ts +8 -1
  39. package/front_end/panels/application/ReportingApiView.ts +15 -1
  40. package/front_end/panels/application/components/EndpointsGrid.ts +63 -4
  41. package/front_end/panels/application/components/FrameDetailsView.ts +21 -34
  42. package/front_end/panels/changes/ChangesView.ts +8 -7
  43. package/front_end/panels/elements/StyleEditorWidget.ts +7 -7
  44. package/front_end/panels/elements/StylePropertyTreeElement.ts +8 -15
  45. package/front_end/panels/elements/StylesSidebarPane.ts +35 -9
  46. package/front_end/panels/emulation/DeviceModeView.ts +3 -0
  47. package/front_end/panels/help/ReleaseNoteText.ts +3 -1
  48. package/front_end/panels/network/NetworkItemView.ts +7 -1
  49. package/front_end/panels/profiler/heapProfiler.css +2 -5
  50. package/front_end/panels/snippets/ScriptSnippetFileSystem.ts +1 -1
  51. package/front_end/panels/sources/DebuggerPlugin.ts +1 -1
  52. package/front_end/panels/sources/NavigatorView.ts +1 -1
  53. package/front_end/panels/sources/UISourceCodeFrame.ts +0 -1
  54. package/front_end/panels/timeline/TimelineController.ts +3 -0
  55. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +3 -34
  56. package/front_end/panels/timeline/TimelineUIUtils.ts +51 -3
  57. package/front_end/panels/webauthn/WebauthnPane.ts +31 -32
  58. package/front_end/services/window_bounds/WindowBoundsService.ts +27 -0
  59. package/front_end/services/window_bounds/window_bounds.ts +9 -0
  60. package/front_end/third_party/acorn/README.chromium +2 -2
  61. package/front_end/third_party/acorn/acorn.ts +1 -1
  62. package/front_end/third_party/acorn/package/CHANGELOG.md +31 -1
  63. package/front_end/third_party/acorn/package/README.md +1 -1
  64. package/front_end/third_party/acorn/package/dist/acorn.d.ts +3 -0
  65. package/front_end/third_party/acorn/package/dist/acorn.js +772 -708
  66. package/front_end/third_party/acorn/package/dist/acorn.mjs +767 -703
  67. package/front_end/third_party/acorn/package/dist/bin.js +47 -21
  68. package/front_end/third_party/acorn/package/package.json +1 -1
  69. package/front_end/third_party/acorn-loose/README.chromium +2 -2
  70. package/front_end/third_party/acorn-loose/package/CHANGELOG.md +12 -0
  71. package/front_end/third_party/acorn-loose/package/dist/acorn-loose.js +27 -7
  72. package/front_end/third_party/acorn-loose/package/dist/acorn-loose.mjs +28 -8
  73. package/front_end/third_party/acorn-loose/package/package.json +2 -2
  74. package/front_end/third_party/codemirror.next/bundle.ts +1 -1
  75. package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
  76. package/front_end/third_party/codemirror.next/codemirror.next.d.ts +8 -1
  77. package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
  78. package/front_end/third_party/codemirror.next/package.json +1 -1
  79. package/front_end/third_party/i18n/i18n-impl.ts +1 -1
  80. package/front_end/third_party/lit-html/README.chromium +2 -2
  81. package/front_end/third_party/lit-html/package/CHANGELOG.md +216 -28
  82. package/front_end/third_party/lit-html/package/LICENSE +9 -9
  83. package/front_end/third_party/lit-html/package/README.md +12 -162
  84. package/front_end/third_party/lit-html/package/async-directive.d.ts +23 -54
  85. package/front_end/third_party/lit-html/package/async-directive.d.ts.map +1 -1
  86. package/front_end/third_party/lit-html/package/async-directive.js +2 -7
  87. package/front_end/third_party/lit-html/package/async-directive.js.map +1 -1
  88. package/front_end/third_party/lit-html/package/development/async-directive.d.ts +23 -54
  89. package/front_end/third_party/lit-html/package/development/async-directive.d.ts.map +1 -1
  90. package/front_end/third_party/lit-html/package/development/async-directive.js +44 -194
  91. package/front_end/third_party/lit-html/package/development/async-directive.js.map +1 -1
  92. package/front_end/third_party/lit-html/package/development/directive-helpers.d.ts +6 -5
  93. package/front_end/third_party/lit-html/package/development/directive-helpers.d.ts.map +1 -1
  94. package/front_end/third_party/lit-html/package/development/directive-helpers.js +25 -9
  95. package/front_end/third_party/lit-html/package/development/directive-helpers.js.map +1 -1
  96. package/front_end/third_party/lit-html/package/development/directive.d.ts +3 -16
  97. package/front_end/third_party/lit-html/package/development/directive.d.ts.map +1 -1
  98. package/front_end/third_party/lit-html/package/development/directive.js +6 -1
  99. package/front_end/third_party/lit-html/package/development/directive.js.map +1 -1
  100. package/front_end/third_party/lit-html/package/development/directives/async-append.d.ts +7 -14
  101. package/front_end/third_party/lit-html/package/development/directives/async-append.d.ts.map +1 -1
  102. package/front_end/third_party/lit-html/package/development/directives/async-append.js +17 -58
  103. package/front_end/third_party/lit-html/package/development/directives/async-append.js.map +1 -1
  104. package/front_end/third_party/lit-html/package/development/directives/async-replace.d.ts +9 -14
  105. package/front_end/third_party/lit-html/package/development/directives/async-replace.d.ts.map +1 -1
  106. package/front_end/third_party/lit-html/package/development/directives/async-replace.js +57 -37
  107. package/front_end/third_party/lit-html/package/development/directives/async-replace.js.map +1 -1
  108. package/front_end/third_party/lit-html/package/development/directives/cache.d.ts +2 -3
  109. package/front_end/third_party/lit-html/package/development/directives/cache.d.ts.map +1 -1
  110. package/front_end/third_party/lit-html/package/development/directives/cache.js +4 -6
  111. package/front_end/third_party/lit-html/package/development/directives/cache.js.map +1 -1
  112. package/front_end/third_party/lit-html/package/development/directives/class-map.d.ts +2 -2
  113. package/front_end/third_party/lit-html/package/development/directives/class-map.d.ts.map +1 -1
  114. package/front_end/third_party/lit-html/package/development/directives/class-map.js +17 -7
  115. package/front_end/third_party/lit-html/package/development/directives/class-map.js.map +1 -1
  116. package/front_end/third_party/lit-html/package/development/directives/guard.d.ts +3 -2
  117. package/front_end/third_party/lit-html/package/development/directives/guard.d.ts.map +1 -1
  118. package/front_end/third_party/lit-html/package/development/directives/guard.js +3 -2
  119. package/front_end/third_party/lit-html/package/development/directives/guard.js.map +1 -1
  120. package/front_end/third_party/lit-html/package/development/directives/live.d.ts +4 -3
  121. package/front_end/third_party/lit-html/package/development/directives/live.d.ts.map +1 -1
  122. package/front_end/third_party/lit-html/package/development/directives/live.js +5 -7
  123. package/front_end/third_party/lit-html/package/development/directives/live.js.map +1 -1
  124. package/front_end/third_party/lit-html/package/development/directives/private-async-helpers.d.ts +58 -0
  125. package/front_end/third_party/lit-html/package/development/directives/private-async-helpers.d.ts.map +1 -0
  126. package/front_end/third_party/lit-html/package/development/directives/private-async-helpers.js +85 -0
  127. package/front_end/third_party/lit-html/package/development/directives/private-async-helpers.js.map +1 -0
  128. package/front_end/third_party/lit-html/package/development/directives/ref.d.ts +14 -11
  129. package/front_end/third_party/lit-html/package/development/directives/ref.d.ts.map +1 -1
  130. package/front_end/third_party/lit-html/package/development/directives/ref.js +13 -11
  131. package/front_end/third_party/lit-html/package/development/directives/ref.js.map +1 -1
  132. package/front_end/third_party/lit-html/package/development/directives/repeat.d.ts +8 -4
  133. package/front_end/third_party/lit-html/package/development/directives/repeat.d.ts.map +1 -1
  134. package/front_end/third_party/lit-html/package/development/directives/repeat.js +23 -9
  135. package/front_end/third_party/lit-html/package/development/directives/repeat.js.map +1 -1
  136. package/front_end/third_party/lit-html/package/development/directives/style-map.d.ts +1 -2
  137. package/front_end/third_party/lit-html/package/development/directives/style-map.d.ts.map +1 -1
  138. package/front_end/third_party/lit-html/package/development/directives/style-map.js +1 -2
  139. package/front_end/third_party/lit-html/package/development/directives/style-map.js.map +1 -1
  140. package/front_end/third_party/lit-html/package/development/directives/template-content.d.ts +1 -2
  141. package/front_end/third_party/lit-html/package/development/directives/template-content.js +1 -2
  142. package/front_end/third_party/lit-html/package/development/directives/unsafe-html.d.ts +6 -4
  143. package/front_end/third_party/lit-html/package/development/directives/unsafe-html.d.ts.map +1 -1
  144. package/front_end/third_party/lit-html/package/development/directives/unsafe-html.js +7 -5
  145. package/front_end/third_party/lit-html/package/development/directives/unsafe-html.js.map +1 -1
  146. package/front_end/third_party/lit-html/package/development/directives/unsafe-svg.d.ts +4 -1
  147. package/front_end/third_party/lit-html/package/development/directives/unsafe-svg.d.ts.map +1 -1
  148. package/front_end/third_party/lit-html/package/development/directives/unsafe-svg.js +3 -0
  149. package/front_end/third_party/lit-html/package/development/directives/unsafe-svg.js.map +1 -1
  150. package/front_end/third_party/lit-html/package/development/directives/until.d.ts +12 -8
  151. package/front_end/third_party/lit-html/package/development/directives/until.d.ts.map +1 -1
  152. package/front_end/third_party/lit-html/package/development/directives/until.js +63 -23
  153. package/front_end/third_party/lit-html/package/development/directives/until.js.map +1 -1
  154. package/front_end/third_party/lit-html/package/development/experimental-hydrate.d.ts.map +1 -1
  155. package/front_end/third_party/lit-html/package/development/experimental-hydrate.js +9 -8
  156. package/front_end/third_party/lit-html/package/development/experimental-hydrate.js.map +1 -1
  157. package/front_end/third_party/lit-html/package/development/lit-html.d.ts +81 -136
  158. package/front_end/third_party/lit-html/package/development/lit-html.d.ts.map +1 -1
  159. package/front_end/third_party/lit-html/package/development/lit-html.js +249 -76
  160. package/front_end/third_party/lit-html/package/development/lit-html.js.map +1 -1
  161. package/front_end/third_party/lit-html/package/development/polyfill-support.d.ts +1 -41
  162. package/front_end/third_party/lit-html/package/development/polyfill-support.d.ts.map +1 -1
  163. package/front_end/third_party/lit-html/package/development/polyfill-support.js +40 -21
  164. package/front_end/third_party/lit-html/package/development/polyfill-support.js.map +1 -1
  165. package/front_end/third_party/lit-html/package/development/private-ssr-support.d.ts +12 -10
  166. package/front_end/third_party/lit-html/package/development/private-ssr-support.d.ts.map +1 -1
  167. package/front_end/third_party/lit-html/package/development/private-ssr-support.js +11 -3
  168. package/front_end/third_party/lit-html/package/development/private-ssr-support.js.map +1 -1
  169. package/front_end/third_party/lit-html/package/development/static.d.ts.map +1 -1
  170. package/front_end/third_party/lit-html/package/development/static.js +6 -5
  171. package/front_end/third_party/lit-html/package/development/static.js.map +1 -1
  172. package/front_end/third_party/lit-html/package/directive-helpers.d.ts +6 -5
  173. package/front_end/third_party/lit-html/package/directive-helpers.d.ts.map +1 -1
  174. package/front_end/third_party/lit-html/package/directive-helpers.js +2 -2
  175. package/front_end/third_party/lit-html/package/directive-helpers.js.map +1 -1
  176. package/front_end/third_party/lit-html/package/directive.d.ts +3 -16
  177. package/front_end/third_party/lit-html/package/directive.d.ts.map +1 -1
  178. package/front_end/third_party/lit-html/package/directive.js +1 -1
  179. package/front_end/third_party/lit-html/package/directive.js.map +1 -1
  180. package/front_end/third_party/lit-html/package/directives/async-append.d.ts +7 -14
  181. package/front_end/third_party/lit-html/package/directives/async-append.d.ts.map +1 -1
  182. package/front_end/third_party/lit-html/package/directives/async-append.js +2 -6
  183. package/front_end/third_party/lit-html/package/directives/async-append.js.map +1 -1
  184. package/front_end/third_party/lit-html/package/directives/async-replace.d.ts +9 -14
  185. package/front_end/third_party/lit-html/package/directives/async-replace.d.ts.map +1 -1
  186. package/front_end/third_party/lit-html/package/directives/async-replace.js +2 -5
  187. package/front_end/third_party/lit-html/package/directives/async-replace.js.map +1 -1
  188. package/front_end/third_party/lit-html/package/directives/cache.d.ts +2 -3
  189. package/front_end/third_party/lit-html/package/directives/cache.d.ts.map +1 -1
  190. package/front_end/third_party/lit-html/package/directives/cache.js +2 -5
  191. package/front_end/third_party/lit-html/package/directives/cache.js.map +1 -1
  192. package/front_end/third_party/lit-html/package/directives/class-map.d.ts +2 -2
  193. package/front_end/third_party/lit-html/package/directives/class-map.d.ts.map +1 -1
  194. package/front_end/third_party/lit-html/package/directives/class-map.js +2 -4
  195. package/front_end/third_party/lit-html/package/directives/class-map.js.map +1 -1
  196. package/front_end/third_party/lit-html/package/directives/guard.d.ts +3 -2
  197. package/front_end/third_party/lit-html/package/directives/guard.d.ts.map +1 -1
  198. package/front_end/third_party/lit-html/package/directives/guard.js +2 -4
  199. package/front_end/third_party/lit-html/package/directives/guard.js.map +1 -1
  200. package/front_end/third_party/lit-html/package/directives/live.d.ts +4 -3
  201. package/front_end/third_party/lit-html/package/directives/live.d.ts.map +1 -1
  202. package/front_end/third_party/lit-html/package/directives/live.js +1 -4
  203. package/front_end/third_party/lit-html/package/directives/live.js.map +1 -1
  204. package/front_end/third_party/lit-html/package/directives/private-async-helpers.d.ts +58 -0
  205. package/front_end/third_party/lit-html/package/directives/private-async-helpers.d.ts.map +1 -0
  206. package/front_end/third_party/lit-html/package/directives/private-async-helpers.js +7 -0
  207. package/front_end/third_party/lit-html/package/directives/private-async-helpers.js.map +1 -0
  208. package/front_end/third_party/lit-html/package/directives/ref.d.ts +14 -11
  209. package/front_end/third_party/lit-html/package/directives/ref.d.ts.map +1 -1
  210. package/front_end/third_party/lit-html/package/directives/ref.js +2 -5
  211. package/front_end/third_party/lit-html/package/directives/ref.js.map +1 -1
  212. package/front_end/third_party/lit-html/package/directives/repeat.d.ts +8 -4
  213. package/front_end/third_party/lit-html/package/directives/repeat.d.ts.map +1 -1
  214. package/front_end/third_party/lit-html/package/directives/repeat.js +2 -5
  215. package/front_end/third_party/lit-html/package/directives/repeat.js.map +1 -1
  216. package/front_end/third_party/lit-html/package/directives/style-map.d.ts +1 -2
  217. package/front_end/third_party/lit-html/package/directives/style-map.d.ts.map +1 -1
  218. package/front_end/third_party/lit-html/package/directives/style-map.js +2 -4
  219. package/front_end/third_party/lit-html/package/directives/style-map.js.map +1 -1
  220. package/front_end/third_party/lit-html/package/directives/template-content.d.ts +1 -2
  221. package/front_end/third_party/lit-html/package/directives/template-content.js +2 -4
  222. package/front_end/third_party/lit-html/package/directives/template-content.js.map +1 -1
  223. package/front_end/third_party/lit-html/package/directives/unsafe-html.d.ts +6 -4
  224. package/front_end/third_party/lit-html/package/directives/unsafe-html.d.ts.map +1 -1
  225. package/front_end/third_party/lit-html/package/directives/unsafe-html.js +2 -4
  226. package/front_end/third_party/lit-html/package/directives/unsafe-html.js.map +1 -1
  227. package/front_end/third_party/lit-html/package/directives/unsafe-svg.d.ts +4 -1
  228. package/front_end/third_party/lit-html/package/directives/unsafe-svg.d.ts.map +1 -1
  229. package/front_end/third_party/lit-html/package/directives/unsafe-svg.js.map +1 -1
  230. package/front_end/third_party/lit-html/package/directives/until.d.ts +12 -8
  231. package/front_end/third_party/lit-html/package/directives/until.d.ts.map +1 -1
  232. package/front_end/third_party/lit-html/package/directives/until.js +2 -6
  233. package/front_end/third_party/lit-html/package/directives/until.js.map +1 -1
  234. package/front_end/third_party/lit-html/package/experimental-hydrate.d.ts.map +1 -1
  235. package/front_end/third_party/lit-html/package/experimental-hydrate.js +2 -5
  236. package/front_end/third_party/lit-html/package/experimental-hydrate.js.map +1 -1
  237. package/front_end/third_party/lit-html/package/lit-html.d.ts +81 -136
  238. package/front_end/third_party/lit-html/package/lit-html.d.ts.map +1 -1
  239. package/front_end/third_party/lit-html/package/lit-html.js +1 -1
  240. package/front_end/third_party/lit-html/package/lit-html.js.map +1 -1
  241. package/front_end/third_party/lit-html/package/package.json +75 -24
  242. package/front_end/third_party/lit-html/package/polyfill-support.d.ts +1 -41
  243. package/front_end/third_party/lit-html/package/polyfill-support.d.ts.map +1 -1
  244. package/front_end/third_party/lit-html/package/polyfill-support.js +1 -1
  245. package/front_end/third_party/lit-html/package/polyfill-support.js.map +1 -1
  246. package/front_end/third_party/lit-html/package/private-ssr-support.d.ts +12 -10
  247. package/front_end/third_party/lit-html/package/private-ssr-support.d.ts.map +1 -1
  248. package/front_end/third_party/lit-html/package/private-ssr-support.js +2 -2
  249. package/front_end/third_party/lit-html/package/private-ssr-support.js.map +1 -1
  250. package/front_end/third_party/lit-html/package/static.d.ts.map +1 -1
  251. package/front_end/third_party/lit-html/package/static.js +1 -1
  252. package/front_end/third_party/lit-html/package/static.js.map +1 -1
  253. package/front_end/third_party/marked/README.chromium +2 -2
  254. package/front_end/third_party/marked/marked.ts +2 -2
  255. package/front_end/third_party/marked/package/README.md +7 -1
  256. package/front_end/third_party/marked/package/bin/marked.js +214 -0
  257. package/front_end/third_party/marked/package/lib/marked.cjs +2907 -0
  258. package/front_end/third_party/marked/package/lib/marked.esm.d.ts +1 -3
  259. package/front_end/third_party/marked/package/lib/marked.esm.js +627 -586
  260. package/front_end/third_party/marked/package/lib/marked.umd.js +2913 -0
  261. package/front_end/third_party/marked/package/man/marked.1 +5 -24
  262. package/front_end/third_party/marked/package/man/marked.1.txt +21 -31
  263. package/front_end/third_party/marked/package/marked.min.js +1 -1
  264. package/front_end/third_party/marked/package/package.json +41 -32
  265. package/front_end/third_party/marked/package/src/Lexer.js +109 -108
  266. package/front_end/third_party/marked/package/src/Parser.js +38 -15
  267. package/front_end/third_party/marked/package/src/Renderer.js +5 -5
  268. package/front_end/third_party/marked/package/src/Slugger.js +2 -2
  269. package/front_end/third_party/marked/package/src/TextRenderer.js +2 -2
  270. package/front_end/third_party/marked/package/src/Tokenizer.js +215 -190
  271. package/front_end/third_party/marked/package/src/defaults.js +6 -9
  272. package/front_end/third_party/marked/package/src/helpers.js +16 -27
  273. package/front_end/third_party/marked/package/src/marked.js +146 -63
  274. package/front_end/third_party/marked/package/src/rules.js +20 -45
  275. package/front_end/third_party/wasmparser/README.chromium +2 -2
  276. package/front_end/third_party/wasmparser/package/.github/workflows/main.yml +47 -0
  277. package/front_end/third_party/wasmparser/package/CHANGELOG.md +12 -0
  278. package/front_end/third_party/wasmparser/package/dist/cjs/WasmParser.js +53 -53
  279. package/front_end/third_party/wasmparser/package/dist/cjs/WasmParser.js.map +1 -1
  280. package/front_end/third_party/wasmparser/package/dist/esm/WasmParser.js +53 -53
  281. package/front_end/third_party/wasmparser/package/dist/esm/WasmParser.js.map +1 -1
  282. package/front_end/third_party/wasmparser/package/package.json +1 -1
  283. package/front_end/third_party/wasmparser/package/src/WasmParser.ts +53 -53
  284. package/front_end/ui/components/adorners/Adorner.ts +14 -14
  285. package/front_end/ui/components/buttons/Button.ts +133 -42
  286. package/front_end/ui/components/buttons/button.css +31 -0
  287. package/front_end/ui/components/data_grid/DataGrid.ts +131 -122
  288. package/front_end/ui/components/data_grid/DataGridController.ts +42 -42
  289. package/front_end/ui/components/diff_view/DiffView.ts +4 -4
  290. package/front_end/ui/components/docs/button/basic.html +3 -0
  291. package/front_end/ui/components/docs/button/basic.ts +58 -0
  292. package/front_end/ui/components/expandable_list/ExpandableList.ts +11 -11
  293. package/front_end/ui/components/icon_button/Icon.ts +24 -21
  294. package/front_end/ui/components/icon_button/IconButton.ts +31 -31
  295. package/front_end/ui/components/issue_counter/IssueCounter.ts +52 -52
  296. package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +42 -42
  297. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspector.ts +67 -67
  298. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorController.ts +22 -22
  299. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorPane.ts +36 -36
  300. package/front_end/ui/components/linear_memory_inspector/LinearMemoryNavigator.ts +19 -19
  301. package/front_end/ui/components/linear_memory_inspector/LinearMemoryValueInterpreter.ts +25 -25
  302. package/front_end/ui/components/linear_memory_inspector/LinearMemoryViewer.ts +52 -52
  303. package/front_end/ui/components/linear_memory_inspector/ValueInterpreterDisplay.ts +21 -21
  304. package/front_end/ui/components/linear_memory_inspector/ValueInterpreterSettings.ts +6 -6
  305. package/front_end/ui/components/markdown_view/MarkdownImage.ts +14 -14
  306. package/front_end/ui/components/markdown_view/MarkdownLink.ts +8 -8
  307. package/front_end/ui/components/markdown_view/MarkdownView.ts +6 -6
  308. package/front_end/ui/components/render_coordinator/RenderCoordinator.ts +33 -33
  309. package/front_end/ui/components/report_view/ReportView.ts +18 -18
  310. package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +53 -53
  311. package/front_end/ui/components/settings/SettingCheckbox.ts +15 -15
  312. package/front_end/ui/components/survey_link/SurveyLink.ts +28 -28
  313. package/front_end/ui/components/text_editor/TextEditor.ts +68 -36
  314. package/front_end/ui/components/text_editor/config.ts +4 -2
  315. package/front_end/ui/components/text_editor/javascript.ts +6 -6
  316. package/front_end/ui/components/text_prompt/TextPrompt.ts +19 -19
  317. package/front_end/ui/components/tree_outline/TreeOutline.ts +56 -56
  318. package/front_end/ui/legacy/Infobar.ts +9 -0
  319. package/front_end/ui/legacy/InspectorView.ts +1 -1
  320. package/front_end/ui/legacy/ListWidget.ts +2 -2
  321. package/front_end/ui/legacy/ViewManager.ts +6 -0
  322. package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +20 -0
  323. package/front_end/ui/legacy/tabbedPane.css +1 -1
  324. package/inspector_overlay/main.ts +3 -0
  325. package/package.json +1 -1
  326. package/scripts/eslint_rules/lib/l10n_filename_matches.js +17 -4
  327. package/scripts/eslint_rules/tests/l10n_filename_matches_test.js +21 -0
@@ -1,24 +1,28 @@
1
- const { defaults } = require('./defaults.js');
2
- const {
3
- rtrim,
4
- splitCells,
1
+ import { defaults } from './defaults.js';
2
+ import {
5
3
  escape,
6
4
  findClosingBracket
7
- } = require('./helpers.js');
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
- return {
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
- module.exports = class Tokenizer {
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
- return {
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
- const cap = this.rules.block.list.exec(src);
169
+ let cap = this.rules.block.list.exec(src);
198
170
  if (cap) {
199
- let raw = cap[0];
200
- const bull = cap[2];
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
- // Get each top-level item.
213
- const itemMatch = cap[0].match(this.rules.block.item);
214
-
215
- let next = false,
216
- item,
217
- space,
218
- bcurr,
219
- bnext,
220
- addBack,
221
- loose,
222
- istask,
223
- ischecked,
224
- endMatch;
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
- // Determine whether the next list item belongs here.
246
- // Backpedal if it does not belong in this list.
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
- // Remove the list item's bullet
273
- // so it is seen as the next token.
274
- space = item.length;
275
- item = item.replace(/^ *([*+-]|\d+[.)]) ?/, '');
276
-
277
- // Outdent whatever the
278
- // list item contains. Hacky.
279
- if (~item.indexOf('\n ')) {
280
- space -= item.length;
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
- // trim item newlines at end
287
- item = rtrim(item, '\n');
288
- if (i !== l - 1) {
289
- raw = raw + '\n';
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
- // Determine whether item is loose or not.
293
- // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/
294
- // for discount behavior.
295
- loose = next || /\n\n(?!\s*$)/.test(raw);
296
- if (i !== l - 1) {
297
- next = raw.slice(-2) === '\n\n';
298
- if (!loose) loose = next;
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.loose = true;
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]\] /.test(item);
308
- ischecked = undefined;
276
+ istask = /^\[[ xX]\] /.exec(itemContents);
309
277
  if (istask) {
310
- ischecked = item[1] !== ' ';
311
- item = item.replace(/^\[[ xX]\] +/, '');
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: loose,
321
- text: item
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
- return {
333
- type: this.options.sanitize
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: this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0])) : cap[0]
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].replace(/^ *| *\| *$/g, '')),
357
+ header: splitCells(cap[1]).map(c => { return { text: c }; }),
365
358
  align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
366
- cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : []
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.cells.length;
379
+ l = item.rows.length;
387
380
  for (i = 0; i < l; i++) {
388
- item.cells[i] = splitCells(
389
- item.cells[i].replace(/^ *\| *| *\| *$/g, ''),
390
- item.header.length);
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
- return {
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
- return {
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
- return {
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, inLink, inRawBlock) {
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
- if (match[3] && prevChar.match(/[\p{L}\p{N}]/u)) return; // _ can't be between two alphanumerics. \p{L}\p{N} includes non-english alphabet/numbers as well
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
- maskedSrc = maskedSrc.slice(-1 * src.length + lLength); // Bump maskedSrc to same section of string as src (move to lexer?)
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; // matched the first alternative in rules.js (skip the * in __abc*abc__)
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
- // If this is the last rDelimiter, remove extra characters. *a*** -> *a*
588
- if (delimTotal + midDelimTotal - rLength <= 0 && !maskedSrc.slice(endReg.lastIndex).match(endReg)) {
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: src.slice(1, lLength + match.index + rLength)
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, inRawBlock, smartypants) {
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
- function changeDefaults(newDefaults) {
25
- module.exports.defaults = newDefaults;
26
- }
25
+ export let defaults = getDefaults();
27
26
 
28
- module.exports = {
29
- defaults: getDefaults(),
30
- getDefaults,
31
- changeDefaults
32
- };
27
+ export function changeDefaults(newDefaults) {
28
+ defaults = newDefaults;
29
+ }