@browserless.io/browserless 2.2.0-beta-8 → 2.2.0
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/CHANGELOG.md +21 -2
- package/bin/browserless.js +1 -1
- package/bin/scaffold/README.md +8 -7
- package/build/browserless.js +7 -6
- package/build/browsers/chrome.cdp.d.ts +6 -0
- package/build/browsers/chrome.cdp.js +6 -0
- package/build/browsers/chrome.playwright.d.ts +6 -0
- package/build/browsers/chrome.playwright.js +6 -0
- package/build/browsers/{cdp-chromium.d.ts → chromium.cdp.d.ts} +3 -2
- package/build/browsers/{cdp-chromium.js → chromium.cdp.js} +16 -10
- package/build/browsers/{playwright-chromium.d.ts → chromium.playwright.d.ts} +3 -2
- package/build/browsers/{playwright-chromium.js → chromium.playwright.js} +6 -5
- package/build/browsers/{playwright-firefox.d.ts → firefox.playwright.d.ts} +2 -2
- package/build/browsers/{playwright-firefox.js → firefox.playwright.js} +4 -4
- package/build/browsers/index.d.ts +20 -10
- package/build/browsers/index.js +110 -11
- package/build/browsers/{playwright-webkit.d.ts → webkit.playwright.d.ts} +2 -2
- package/build/browsers/{playwright-webkit.js → webkit.playwright.js} +4 -4
- package/build/data/selectors.json +1 -1
- package/build/exports.d.ts +6 -4
- package/build/exports.js +6 -4
- package/build/hooks.d.ts +4 -5
- package/build/hooks.js +4 -6
- package/build/http.d.ts +22 -1
- package/build/http.js +21 -0
- package/build/router.js +19 -3
- package/build/routes/{chromium/http/content-post.body.json → chrome/http/content.post.body.json} +8 -8
- package/build/routes/chrome/http/content.post.d.ts +7 -0
- package/build/routes/chrome/http/content.post.js +6 -0
- package/build/routes/chrome/http/download.post.d.ts +7 -0
- package/build/routes/chrome/http/download.post.js +6 -0
- package/build/routes/chrome/http/function.post.d.ts +7 -0
- package/build/routes/chrome/http/function.post.js +6 -0
- package/build/routes/chrome/http/json-list.get.d.ts +1 -0
- package/build/routes/chrome/http/json-list.get.js +1 -0
- package/build/routes/chrome/http/json-new.put.d.ts +1 -0
- package/build/routes/chrome/http/json-new.put.js +1 -0
- package/build/routes/chrome/http/json-protocol.get.d.ts +1 -0
- package/build/routes/chrome/http/json-protocol.get.js +1 -0
- package/build/routes/chrome/http/json-version.get.d.ts +1 -0
- package/build/routes/chrome/http/json-version.get.js +1 -0
- package/build/routes/chrome/http/json-version.get.response.json +44 -0
- package/build/routes/{chromium/http/pdf-post.body.json → chrome/http/pdf.post.body.json} +8 -8
- package/build/routes/chrome/http/pdf.post.d.ts +7 -0
- package/build/routes/chrome/http/pdf.post.js +6 -0
- package/build/routes/chrome/http/performance.post.d.ts +7 -0
- package/build/routes/chrome/http/performance.post.js +6 -0
- package/build/routes/{chromium/http/scrape-post.body.json → chrome/http/scrape.post.body.json} +8 -8
- package/build/routes/chrome/http/scrape.post.d.ts +7 -0
- package/build/routes/chrome/http/scrape.post.js +6 -0
- package/build/routes/{chromium/http/screenshot-post.body.json → chrome/http/screenshot.post.body.json} +8 -8
- package/build/routes/chrome/http/screenshot.post.d.ts +7 -0
- package/build/routes/chrome/http/screenshot.post.js +6 -0
- package/build/routes/chrome/tests/content.spec.js +311 -0
- package/build/routes/chrome/tests/download.spec.js +67 -0
- package/build/routes/chrome/tests/function.spec.d.ts +1 -0
- package/build/routes/chrome/tests/function.spec.js +245 -0
- package/build/routes/chrome/tests/json-version.spec.d.ts +1 -0
- package/build/routes/chrome/tests/json-version.spec.js +37 -0
- package/build/routes/chrome/tests/page-websocket.spec.d.ts +1 -0
- package/build/routes/chrome/tests/page-websocket.spec.js +97 -0
- package/build/routes/chrome/tests/pdf.spec.d.ts +1 -0
- package/build/routes/chrome/tests/pdf.spec.js +333 -0
- package/build/routes/chrome/tests/performance.spec.d.ts +1 -0
- package/build/routes/chrome/tests/performance.spec.js +124 -0
- package/build/routes/chrome/tests/scrape.spec.d.ts +1 -0
- package/build/routes/chrome/tests/scrape.spec.js +354 -0
- package/build/routes/chrome/tests/screenshot.spec.d.ts +1 -0
- package/build/routes/chrome/tests/screenshot.spec.js +339 -0
- package/build/routes/chrome/tests/websocket.spec.d.ts +1 -0
- package/build/routes/chrome/tests/websocket.spec.js +371 -0
- package/build/routes/chrome/ws/browser.d.ts +6 -0
- package/build/routes/chrome/ws/browser.js +5 -0
- package/build/routes/chrome/ws/cdp.d.ts +7 -0
- package/build/routes/chrome/ws/cdp.js +6 -0
- package/build/routes/chrome/ws/cdp.query.json +120 -0
- package/build/routes/chrome/ws/page.d.ts +6 -0
- package/build/routes/chrome/ws/page.js +5 -0
- package/build/routes/chrome/ws/page.query.json +120 -0
- package/build/routes/chrome/ws/playwright.d.ts +7 -0
- package/build/routes/chrome/ws/playwright.js +6 -0
- package/build/routes/chromium/http/content.post.body.json +510 -0
- package/build/routes/chromium/http/content.post.d.ts +1 -0
- package/build/routes/chromium/http/content.post.js +1 -0
- package/build/routes/chromium/http/content.post.query.json +183 -0
- package/build/routes/chromium/http/content.post.response.json +5 -0
- package/build/routes/chromium/http/download.post.body.json +32 -0
- package/build/routes/chromium/http/download.post.d.ts +1 -0
- package/build/routes/chromium/http/download.post.js +1 -0
- package/build/routes/chromium/http/download.post.query.json +120 -0
- package/build/routes/chromium/http/download.post.response.json +4 -0
- package/build/routes/chromium/http/function.post.body.json +32 -0
- package/build/routes/chromium/http/function.post.d.ts +1 -0
- package/build/routes/chromium/http/function.post.js +1 -0
- package/build/routes/chromium/http/function.post.query.json +120 -0
- package/build/routes/chromium/http/function.post.response.json +4 -0
- package/build/routes/chromium/http/json-list.get.d.ts +1 -0
- package/build/routes/chromium/http/json-list.get.js +1 -0
- package/build/routes/chromium/http/json-list.get.response.json +52 -0
- package/build/routes/chromium/http/json-new.put.d.ts +1 -0
- package/build/routes/chromium/http/json-new.put.js +1 -0
- package/build/routes/chromium/http/json-new.put.response.json +44 -0
- package/build/routes/chromium/http/json-protocol.get.d.ts +1 -0
- package/build/routes/chromium/http/json-protocol.get.js +1 -0
- package/build/routes/chromium/http/json-protocol.get.response.json +6 -0
- package/build/routes/chromium/http/json-version.get.d.ts +1 -0
- package/build/routes/chromium/http/json-version.get.js +1 -0
- package/build/routes/chromium/http/json-version.get.response.json +44 -0
- package/build/routes/chromium/http/pdf.post.body.json +654 -0
- package/build/routes/chromium/http/pdf.post.d.ts +1 -0
- package/build/routes/chromium/http/pdf.post.js +1 -0
- package/build/routes/chromium/http/pdf.post.query.json +120 -0
- package/build/routes/chromium/http/pdf.post.response.json +5 -0
- package/build/routes/chromium/http/performance.post.body.json +26 -0
- package/build/routes/chromium/http/performance.post.d.ts +1 -0
- package/build/routes/chromium/http/performance.post.js +1 -0
- package/build/routes/chromium/http/performance.post.query.json +120 -0
- package/build/routes/chromium/http/performance.post.response.json +7 -0
- package/build/routes/chromium/http/scrape.post.body.json +557 -0
- package/build/routes/chromium/http/scrape.post.d.ts +1 -0
- package/build/routes/chromium/http/scrape.post.js +1 -0
- package/build/routes/chromium/http/scrape.post.query.json +183 -0
- package/build/routes/chromium/http/scrape.post.response.json +309 -0
- package/build/routes/chromium/http/screenshot.post.body.json +600 -0
- package/build/routes/chromium/http/screenshot.post.d.ts +1 -0
- package/build/routes/chromium/http/screenshot.post.js +1 -0
- package/build/routes/chromium/http/screenshot.post.query.json +120 -0
- package/build/routes/chromium/http/screenshot.post.response.json +5 -0
- package/build/routes/chromium/tests/content.spec.js +16 -16
- package/build/routes/chromium/tests/download.spec.js +3 -3
- package/build/routes/chromium/tests/function.spec.js +10 -10
- package/build/routes/chromium/tests/page-websocket.spec.d.ts +1 -0
- package/build/routes/chromium/tests/page-websocket.spec.js +97 -0
- package/build/routes/chromium/tests/pdf.spec.js +16 -16
- package/build/routes/chromium/tests/performance.spec.js +7 -7
- package/build/routes/chromium/tests/scrape.spec.js +15 -15
- package/build/routes/chromium/tests/screenshot.spec.js +17 -17
- package/build/routes/chromium/tests/websocket.spec.js +31 -37
- package/build/routes/chromium/ws/browser.d.ts +1 -16
- package/build/routes/chromium/ws/browser.js +1 -10
- package/build/routes/chromium/ws/cdp.d.ts +1 -0
- package/build/routes/chromium/ws/cdp.js +1 -0
- package/build/routes/chromium/ws/cdp.query.json +120 -0
- package/build/routes/chromium/ws/page.d.ts +1 -16
- package/build/routes/chromium/ws/page.js +1 -10
- package/build/routes/chromium/ws/playwright.d.ts +1 -0
- package/build/routes/chromium/ws/playwright.js +1 -0
- package/build/routes/firefox/ws/{playwright-firefox.d.ts → playwright.d.ts} +5 -5
- package/build/routes/firefox/ws/{playwright-firefox.js → playwright.js} +4 -4
- package/build/routes/management/http/{sessions-get.response.json → sessions.get.response.json} +11 -1
- package/build/routes/management/http/{static-get.js → static.get.js} +2 -2
- package/build/routes/webkit/ws/{playwright-webkit.d.ts → playwright.d.ts} +5 -5
- package/build/routes/webkit/ws/{playwright-webkit.js → playwright.js} +4 -4
- package/build/routes/webkit/ws/playwright.query.json +100 -0
- package/build/{routes/chromium/ws/cdp-chromium.d.ts → shared/browser.ws.d.ts} +4 -4
- package/build/shared/browser.ws.js +12 -0
- package/build/{routes/chromium/ws/playwright-chromium.d.ts → shared/chromium.playwright.ws.d.ts} +4 -4
- package/build/{routes/chromium/ws/playwright-chromium.js → shared/chromium.playwright.ws.js} +6 -3
- package/build/shared/chromium.ws.d.ts +16 -0
- package/build/shared/chromium.ws.js +10 -0
- package/build/{routes/chromium/http/content-post.d.ts → shared/content.http.d.ts} +3 -3
- package/build/{routes/chromium/http/content-post.js → shared/content.http.js} +3 -3
- package/build/{routes/chromium/http/download-post.d.ts → shared/download.http.d.ts} +3 -3
- package/build/{routes/chromium/http/download-post.js → shared/download.http.js} +4 -4
- package/build/{routes/chromium/http/function-post.d.ts → shared/function.http.d.ts} +3 -3
- package/build/{routes/chromium/http/function-post.js → shared/function.http.js} +4 -4
- package/build/{routes/chromium/http/json-new.d.ts → shared/json-list.http.d.ts} +2 -3
- package/build/{routes/chromium/http/json-list.js → shared/json-list.http.js} +5 -8
- package/build/{routes/chromium/http/json-list.d.ts → shared/json-new.http.d.ts} +2 -3
- package/build/shared/json-new.http.js +34 -0
- package/build/{routes/chromium/http/json-protocol-get.js → shared/json-protocol.http.js} +2 -2
- package/build/{routes/chromium/http/json-version-get.js → shared/json-version.http.js} +3 -3
- package/build/shared/page.ws.d.ts +16 -0
- package/build/shared/page.ws.js +13 -0
- package/build/{routes/chromium/http/pdf-post.d.ts → shared/pdf.http.d.ts} +3 -3
- package/build/{routes/chromium/http/pdf-post.js → shared/pdf.http.js} +3 -3
- package/build/{routes/chromium/http/performance.d.ts → shared/performance.http.d.ts} +3 -3
- package/build/{routes/chromium/http/performance.js → shared/performance.http.js} +4 -4
- package/build/{routes/chromium/http/scrape-post.d.ts → shared/scrape.http.d.ts} +3 -3
- package/build/{routes/chromium/http/scrape-post.js → shared/scrape.http.js} +3 -3
- package/build/{routes/chromium/http/screenshot-post.d.ts → shared/screenshot.http.d.ts} +3 -3
- package/build/{routes/chromium/http/screenshot-post.js → shared/screenshot.http.js} +3 -3
- package/build/shared/utils/performance/child.d.ts +1 -0
- package/build/{routes/chromium → shared}/utils/performance/main.js +1 -1
- package/build/shared/utils/performance/types.js +1 -0
- package/build/shim.js +2 -1
- package/build/types.d.ts +10 -8
- package/build/utils.d.ts +8 -3
- package/build/utils.js +24 -11
- package/docker/base/Dockerfile +1 -1
- package/docker/chrome/Dockerfile +4 -4
- package/docker/chromium/.dockerignore +16 -0
- package/docker/chromium/Dockerfile +40 -0
- package/docker/firefox/Dockerfile +1 -1
- package/docker/multi/Dockerfile +13 -1
- package/docker/webkit/Dockerfile +1 -1
- package/extensions/ublock/3p-filters.html +1 -1
- package/extensions/ublock/_locales/ar/messages.json +4 -0
- package/extensions/ublock/_locales/az/messages.json +4 -0
- package/extensions/ublock/_locales/be/messages.json +4 -0
- package/extensions/ublock/_locales/bg/messages.json +5 -1
- package/extensions/ublock/_locales/bn/messages.json +4 -0
- package/extensions/ublock/_locales/br_FR/messages.json +6 -2
- package/extensions/ublock/_locales/bs/messages.json +4 -0
- package/extensions/ublock/_locales/ca/messages.json +4 -0
- package/extensions/ublock/_locales/cs/messages.json +4 -0
- package/extensions/ublock/_locales/cv/messages.json +4 -0
- package/extensions/ublock/_locales/cy/messages.json +1294 -0
- package/extensions/ublock/_locales/da/messages.json +4 -0
- package/extensions/ublock/_locales/de/messages.json +5 -1
- package/extensions/ublock/_locales/el/messages.json +4 -0
- package/extensions/ublock/_locales/en/messages.json +4 -0
- package/extensions/ublock/_locales/en_GB/messages.json +4 -0
- package/extensions/ublock/_locales/eo/messages.json +9 -5
- package/extensions/ublock/_locales/es/messages.json +4 -0
- package/extensions/ublock/_locales/et/messages.json +4 -0
- package/extensions/ublock/_locales/eu/messages.json +8 -4
- package/extensions/ublock/_locales/fa/messages.json +4 -0
- package/extensions/ublock/_locales/fi/messages.json +4 -0
- package/extensions/ublock/_locales/fil/messages.json +4 -0
- package/extensions/ublock/_locales/fr/messages.json +4 -0
- package/extensions/ublock/_locales/fy/messages.json +4 -0
- package/extensions/ublock/_locales/gl/messages.json +4 -0
- package/extensions/ublock/_locales/gu/messages.json +4 -0
- package/extensions/ublock/_locales/he/messages.json +4 -0
- package/extensions/ublock/_locales/hi/messages.json +4 -0
- package/extensions/ublock/_locales/hr/messages.json +4 -0
- package/extensions/ublock/_locales/hu/messages.json +4 -0
- package/extensions/ublock/_locales/hy/messages.json +4 -0
- package/extensions/ublock/_locales/id/messages.json +5 -1
- package/extensions/ublock/_locales/it/messages.json +4 -0
- package/extensions/ublock/_locales/ja/messages.json +4 -0
- package/extensions/ublock/_locales/ka/messages.json +34 -30
- package/extensions/ublock/_locales/kk/messages.json +4 -0
- package/extensions/ublock/_locales/kn/messages.json +4 -0
- package/extensions/ublock/_locales/ko/messages.json +4 -0
- package/extensions/ublock/_locales/ku/messages.json +4 -0
- package/extensions/ublock/_locales/lt/messages.json +4 -0
- package/extensions/ublock/_locales/lv/messages.json +4 -0
- package/extensions/ublock/_locales/mk/messages.json +4 -0
- package/extensions/ublock/_locales/ml/messages.json +4 -0
- package/extensions/ublock/_locales/mr/messages.json +4 -0
- package/extensions/ublock/_locales/ms/messages.json +13 -9
- package/extensions/ublock/_locales/nb/messages.json +4 -0
- package/extensions/ublock/_locales/nl/messages.json +4 -0
- package/extensions/ublock/_locales/no/messages.json +4 -0
- package/extensions/ublock/_locales/oc/messages.json +4 -0
- package/extensions/ublock/_locales/pa/messages.json +4 -0
- package/extensions/ublock/_locales/pl/messages.json +5 -1
- package/extensions/ublock/_locales/pt_BR/messages.json +4 -0
- package/extensions/ublock/_locales/pt_PT/messages.json +4 -0
- package/extensions/ublock/_locales/ro/messages.json +5 -1
- package/extensions/ublock/_locales/ru/messages.json +4 -0
- package/extensions/ublock/_locales/si/messages.json +4 -0
- package/extensions/ublock/_locales/sk/messages.json +4 -0
- package/extensions/ublock/_locales/sl/messages.json +4 -0
- package/extensions/ublock/_locales/so/messages.json +4 -0
- package/extensions/ublock/_locales/sq/messages.json +4 -0
- package/extensions/ublock/_locales/sr/messages.json +4 -0
- package/extensions/ublock/_locales/sv/messages.json +4 -0
- package/extensions/ublock/_locales/sw/messages.json +4 -0
- package/extensions/ublock/_locales/ta/messages.json +4 -0
- package/extensions/ublock/_locales/te/messages.json +4 -0
- package/extensions/ublock/_locales/th/messages.json +12 -8
- package/extensions/ublock/_locales/tr/messages.json +4 -0
- package/extensions/ublock/_locales/uk/messages.json +4 -0
- package/extensions/ublock/_locales/ur/messages.json +4 -0
- package/extensions/ublock/_locales/vi/messages.json +4 -0
- package/extensions/ublock/_locales/zh_CN/messages.json +6 -2
- package/extensions/ublock/_locales/zh_TW/messages.json +6 -2
- package/extensions/ublock/assets/assets.json +11 -11
- package/extensions/ublock/assets/resources/scriptlets.js +660 -378
- package/extensions/ublock/assets/thirdparties/easylist/easylist.txt +7173 -3455
- package/extensions/ublock/assets/thirdparties/easylist/easyprivacy.txt +18829 -1918
- package/extensions/ublock/assets/thirdparties/pgl.yoyo.org/as/serverlist +21 -26
- package/extensions/ublock/assets/thirdparties/publicsuffix.org/list/effective_tld_names.dat +118 -46
- package/extensions/ublock/assets/thirdparties/urlhaus-filter/urlhaus-filter-online.txt +710 -1117
- package/extensions/ublock/assets/ublock/badlists.txt +0 -4
- package/extensions/ublock/assets/ublock/badware.min.txt +116 -105
- package/extensions/ublock/assets/ublock/filters.min.txt +1443 -1097
- package/extensions/ublock/assets/ublock/privacy.min.txt +50 -31
- package/extensions/ublock/assets/ublock/quick-fixes.min.txt +97 -108
- package/extensions/ublock/assets/ublock/unbreak.min.txt +64 -21
- package/extensions/ublock/css/1p-filters.css +4 -0
- package/extensions/ublock/css/3p-filters.css +6 -4
- package/extensions/ublock/css/common.css +1 -1
- package/extensions/ublock/css/fa-icons.css +1 -0
- package/extensions/ublock/css/logger-ui.css +72 -52
- package/extensions/ublock/css/popup-fenix.css +1 -1
- package/extensions/ublock/img/fontawesome/fontawesome-defs.svg +1 -0
- package/extensions/ublock/js/3p-filters.js +3 -3
- package/extensions/ublock/js/assets.js +7 -4
- package/extensions/ublock/js/background.js +1 -3
- package/extensions/ublock/js/benchmarks.js +1 -0
- package/extensions/ublock/js/broadcast.js +12 -0
- package/extensions/ublock/js/click2load.js +2 -3
- package/extensions/ublock/js/codemirror/ubo-static-filtering.js +1 -0
- package/extensions/ublock/js/commands.js +10 -0
- package/extensions/ublock/js/contentscript-extra.js +13 -11
- package/extensions/ublock/js/contentscript.js +0 -31
- package/extensions/ublock/js/contextmenu.js +5 -1
- package/extensions/ublock/js/dyna-rules.js +83 -52
- package/extensions/ublock/js/fa-icons.js +1 -0
- package/extensions/ublock/js/filtering-context.js +0 -2
- package/extensions/ublock/js/i18n.js +1 -5
- package/extensions/ublock/js/logger-ui.js +71 -38
- package/extensions/ublock/js/logger.js +18 -14
- package/extensions/ublock/js/messaging.js +17 -5
- package/extensions/ublock/js/popup-fenix.js +6 -6
- package/extensions/ublock/js/scriptlet-filtering-core.js +14 -12
- package/extensions/ublock/js/scriptlet-filtering.js +149 -53
- package/extensions/ublock/js/scriptlets/scriptlet-loglevel-1.js +49 -0
- package/extensions/ublock/js/scriptlets/scriptlet-loglevel-2.js +49 -0
- package/extensions/ublock/js/scriptlets/should-inject-contentscript.js +1 -1
- package/extensions/ublock/js/static-dnr-filtering.js +4 -2
- package/extensions/ublock/js/static-filtering-parser.js +14 -8
- package/extensions/ublock/js/static-net-filtering.js +32 -30
- package/extensions/ublock/js/storage.js +18 -4
- package/extensions/ublock/js/traffic.js +3 -3
- package/extensions/ublock/js/ublock.js +1 -1
- package/extensions/ublock/js/vapi-background.js +15 -7
- package/extensions/ublock/logger-ui.html +18 -10
- package/extensions/ublock/manifest.json +4 -1
- package/extensions/ublock/web_accessible_resources/chartbeat.js +3 -0
- package/package.json +12 -11
- package/scripts/build-function.js +1 -1
- package/scripts/build-open-api.js +3 -2
- package/scripts/clean.js +6 -1
- package/scripts/install-debugger.js +20 -0
- package/scripts/install-devtools.js +40 -0
- package/src/browserless.ts +11 -9
- package/src/browsers/chrome.cdp.ts +10 -0
- package/src/browsers/chrome.playwright.ts +10 -0
- package/src/browsers/{cdp-chromium.ts → chromium.cdp.ts} +20 -13
- package/src/browsers/{playwright-chromium.ts → chromium.playwright.ts} +7 -6
- package/src/browsers/{playwright-firefox.ts → firefox.playwright.ts} +5 -5
- package/src/browsers/index.ts +160 -23
- package/src/browsers/{playwright-webkit.ts → webkit.playwright.ts} +5 -5
- package/src/exports.ts +6 -4
- package/src/hooks.ts +4 -12
- package/src/http.ts +21 -0
- package/src/router.ts +21 -5
- package/src/routes/chrome/http/content.post.ts +14 -0
- package/src/routes/chrome/http/download.post.ts +14 -0
- package/src/routes/chrome/http/function.post.ts +14 -0
- package/src/routes/chrome/http/json-list.get.ts +1 -0
- package/src/routes/chrome/http/json-new.put.ts +1 -0
- package/src/routes/chrome/http/json-protocol.get.ts +1 -0
- package/src/routes/chrome/http/json-version.get.ts +1 -0
- package/src/routes/chrome/http/pdf.post.ts +14 -0
- package/src/routes/chrome/http/performance.post.ts +14 -0
- package/src/routes/chrome/http/scrape.post.ts +14 -0
- package/src/routes/chrome/http/screenshot.post.ts +14 -0
- package/src/routes/chrome/tests/content.spec.ts +375 -0
- package/src/routes/chrome/tests/download.spec.ts +77 -0
- package/src/routes/chrome/tests/function.spec.ts +282 -0
- package/src/routes/chrome/tests/json-version.spec.ts +52 -0
- package/src/routes/chrome/tests/page-websocket.spec.ts +129 -0
- package/src/routes/chrome/tests/pdf.spec.ts +380 -0
- package/src/routes/chrome/tests/performance.spec.ts +155 -0
- package/src/routes/chrome/tests/scrape.spec.ts +417 -0
- package/src/routes/chrome/tests/screenshot.spec.ts +387 -0
- package/src/routes/chrome/tests/websocket.spec.ts +491 -0
- package/src/routes/chrome/ws/browser.ts +8 -0
- package/src/routes/chrome/ws/cdp.ts +12 -0
- package/src/routes/chrome/ws/page.ts +8 -0
- package/src/routes/chrome/ws/playwright.ts +12 -0
- package/src/routes/chromium/http/content.post.ts +6 -0
- package/src/routes/chromium/http/download.post.ts +6 -0
- package/src/routes/chromium/http/function.post.ts +6 -0
- package/src/routes/chromium/http/json-list.get.ts +1 -0
- package/src/routes/chromium/http/json-new.put.ts +1 -0
- package/src/routes/chromium/http/json-protocol.get.ts +1 -0
- package/src/routes/chromium/http/json-version.get.ts +1 -0
- package/src/routes/chromium/http/pdf.post.ts +6 -0
- package/src/routes/chromium/http/performance.post.ts +6 -0
- package/src/routes/chromium/http/scrape.post.ts +6 -0
- package/src/routes/chromium/http/screenshot.post.ts +6 -0
- package/src/routes/chromium/tests/content.spec.ts +36 -28
- package/src/routes/chromium/tests/download.spec.ts +3 -3
- package/src/routes/chromium/tests/function.spec.ts +18 -15
- package/src/routes/chromium/tests/page-websocket.spec.ts +129 -0
- package/src/routes/chromium/tests/pdf.spec.ts +31 -26
- package/src/routes/chromium/tests/performance.spec.ts +46 -34
- package/src/routes/chromium/tests/scrape.spec.ts +23 -20
- package/src/routes/chromium/tests/screenshot.spec.ts +24 -24
- package/src/routes/chromium/tests/websocket.spec.ts +31 -40
- package/src/routes/chromium/ws/browser.ts +1 -29
- package/src/routes/chromium/ws/cdp.ts +1 -0
- package/src/routes/chromium/ws/page.ts +1 -29
- package/src/routes/chromium/ws/playwright.ts +4 -0
- package/src/routes/firefox/ws/{playwright-firefox.ts → playwright.ts} +5 -5
- package/src/routes/management/http/{static-get.ts → static.get.ts} +2 -2
- package/src/routes/webkit/ws/{playwright-webkit.ts → playwright.ts} +5 -5
- package/src/shared/browser.ws.ts +34 -0
- package/src/{routes/chromium/ws/playwright-chromium.ts → shared/chromium.playwright.ws.ts} +7 -4
- package/src/{routes/chromium/ws/cdp-chromium.ts → shared/chromium.ws.ts} +6 -6
- package/src/{routes/chromium/http/content-post.ts → shared/content.http.ts} +4 -4
- package/src/{routes/chromium/http/download-post.ts → shared/download.http.ts} +4 -4
- package/src/{routes/chromium/http/function-post.ts → shared/function.http.ts} +4 -4
- package/src/shared/json-list.http.ts +35 -0
- package/src/{routes/chromium/http/json-new.ts → shared/json-new.http.ts} +23 -7
- package/src/{routes/chromium/http/json-protocol-get.ts → shared/json-protocol.http.ts} +3 -5
- package/src/{routes/chromium/http/json-version-get.ts → shared/json-version.http.ts} +4 -5
- package/src/shared/page.ws.ts +35 -0
- package/src/{routes/chromium/http/pdf-post.ts → shared/pdf.http.ts} +4 -4
- package/src/{routes/chromium/http/performance.ts → shared/performance.http.ts} +4 -4
- package/src/{routes/chromium/http/scrape-post.ts → shared/scrape.http.ts} +4 -4
- package/src/{routes/chromium/http/screenshot-post.ts → shared/screenshot.http.ts} +4 -4
- package/src/{routes/chromium → shared}/utils/function/handler.ts +2 -2
- package/src/{routes/chromium → shared}/utils/performance/main.ts +1 -2
- package/src/shim.ts +2 -1
- package/src/types.ts +27 -20
- package/src/utils.ts +32 -14
- package/static/devtools/Images/accelerometer-back.svg +1 -0
- package/static/devtools/Images/accelerometer-bottom.png +0 -0
- package/static/devtools/Images/accelerometer-front.svg +1 -0
- package/static/devtools/Images/accelerometer-left.png +0 -0
- package/static/devtools/Images/accelerometer-right.png +0 -0
- package/static/devtools/Images/accelerometer-top.png +0 -0
- package/static/devtools/Images/baseline-icon.svg +1 -0
- package/static/devtools/Images/breaking_change_icon.svg +1 -0
- package/static/devtools/Images/checkboxCheckmark.svg +1 -0
- package/static/devtools/Images/checker.png +0 -0
- package/static/devtools/Images/chevrons.svg +1 -0
- package/static/devtools/Images/chromeDisabledSelect.png +0 -0
- package/static/devtools/Images/chromeDisabledSelect_2x.png +0 -0
- package/static/devtools/Images/chromeLeft.avif +0 -0
- package/static/devtools/Images/chromeMiddle.avif +0 -0
- package/static/devtools/Images/chromeRight.avif +0 -0
- package/static/devtools/Images/chromeSelect.svg +1 -0
- package/static/devtools/Images/chromeSelectDark.svg +1 -0
- package/static/devtools/Images/cssoverview_icons_2x.avif +0 -0
- package/static/devtools/Images/dropdown_7x6_icon.svg +1 -0
- package/static/devtools/Images/elements_panel_icon.svg +1 -0
- package/static/devtools/Images/errorWave.svg +1 -0
- package/static/devtools/Images/error_icon.svg +1 -0
- package/static/devtools/Images/feedback_thin_16x16_icon.svg +1 -0
- package/static/devtools/Images/flex-align-content-center-icon.svg +1 -0
- package/static/devtools/Images/flex-align-content-end-icon.svg +1 -0
- package/static/devtools/Images/flex-align-content-space-around-icon.svg +1 -0
- package/static/devtools/Images/flex-align-content-space-between-icon.svg +1 -0
- package/static/devtools/Images/flex-align-content-space-evenly-icon.svg +1 -0
- package/static/devtools/Images/flex-align-content-start-icon.svg +1 -0
- package/static/devtools/Images/flex-align-content-stretch-icon.svg +1 -0
- package/static/devtools/Images/flex-align-items-center-icon.svg +1 -0
- package/static/devtools/Images/flex-align-items-flex-end-icon.svg +1 -0
- package/static/devtools/Images/flex-align-items-flex-start-icon.svg +1 -0
- package/static/devtools/Images/flex-align-items-stretch-icon.svg +1 -0
- package/static/devtools/Images/flex-align-self-center-icon.svg +1 -0
- package/static/devtools/Images/flex-align-self-flex-end-icon.svg +1 -0
- package/static/devtools/Images/flex-align-self-flex-start-icon.svg +1 -0
- package/static/devtools/Images/flex-align-self-stretch-icon.svg +1 -0
- package/static/devtools/Images/flex-direction-icon.svg +1 -0
- package/static/devtools/Images/flex-justify-content-center-icon.svg +1 -0
- package/static/devtools/Images/flex-justify-content-flex-end-icon.svg +1 -0
- package/static/devtools/Images/flex-justify-content-flex-start-icon.svg +1 -0
- package/static/devtools/Images/flex-justify-content-space-around-icon.svg +1 -0
- package/static/devtools/Images/flex-justify-content-space-between-icon.svg +1 -0
- package/static/devtools/Images/flex-justify-content-space-evenly-icon.svg +1 -0
- package/static/devtools/Images/ic_checkmark_16x16.svg +3 -0
- package/static/devtools/Images/ic_delete_filter.svg +1 -0
- package/static/devtools/Images/ic_delete_list.svg +1 -0
- package/static/devtools/Images/ic_info_black_18dp.svg +1 -0
- package/static/devtools/Images/ic_page_next_16x16_icon.svg +1 -0
- package/static/devtools/Images/ic_page_prev_16x16_icon.svg +1 -0
- package/static/devtools/Images/ic_redo_16x16_icon.svg +1 -0
- package/static/devtools/Images/ic_show_node_16x16.svg +4 -0
- package/static/devtools/Images/ic_suggest_color.svg +6 -0
- package/static/devtools/Images/ic_undo_16x16_icon.svg +1 -0
- package/static/devtools/Images/ic_warning_black_18dp.svg +1 -0
- package/static/devtools/Images/issue-text-icon.svg +1 -0
- package/static/devtools/Images/largeIcons.svg +1 -0
- package/static/devtools/Images/lighthouse_logo.svg +1 -0
- package/static/devtools/Images/link_icon.svg +1 -0
- package/static/devtools/Images/mediumIcons.svg +1 -0
- package/static/devtools/Images/navigationControls.png +0 -0
- package/static/devtools/Images/navigationControls_2x.png +0 -0
- package/static/devtools/Images/network_panel_icon.svg +1 -0
- package/static/devtools/Images/nodeIcon.avif +0 -0
- package/static/devtools/Images/node_search_icon.svg +1 -0
- package/static/devtools/Images/popoverArrows.png +0 -0
- package/static/devtools/Images/profileGroupIcon.png +0 -0
- package/static/devtools/Images/profileIcon.png +0 -0
- package/static/devtools/Images/profileSmallIcon.png +0 -0
- package/static/devtools/Images/radioDot-dark-theme.png +0 -0
- package/static/devtools/Images/radioDot.png +0 -0
- package/static/devtools/Images/refresh_12x12_icon.svg +1 -0
- package/static/devtools/Images/resizeDiagonal.svg +1 -0
- package/static/devtools/Images/resizeHorizontal.svg +1 -0
- package/static/devtools/Images/resizeVertical.svg +1 -0
- package/static/devtools/Images/resourceCSSIcon.png +0 -0
- package/static/devtools/Images/resourceDocumentIcon.png +0 -0
- package/static/devtools/Images/resourceDocumentIconSmall.png +0 -0
- package/static/devtools/Images/resourceJSIcon.png +0 -0
- package/static/devtools/Images/resourcePlainIcon.png +0 -0
- package/static/devtools/Images/resourcePlainIconSmall.png +0 -0
- package/static/devtools/Images/resourcesTimeGraphIcon.avif +0 -0
- package/static/devtools/Images/searchNext.png +0 -0
- package/static/devtools/Images/searchPrev.png +0 -0
- package/static/devtools/Images/securityIcons.svg +1 -0
- package/static/devtools/Images/settings_14x14_icon.svg +1 -0
- package/static/devtools/Images/smallIcons.svg +1 -0
- package/static/devtools/Images/sources_panel_icon.svg +1 -0
- package/static/devtools/Images/speech.png +0 -0
- package/static/devtools/Images/toolbarResizerVertical.png +0 -0
- package/static/devtools/Images/touchCursor.png +0 -0
- package/static/devtools/Images/touchCursor_2x.png +0 -0
- package/static/devtools/Images/treeoutlineTriangles.svg +1 -0
- package/static/devtools/Images/warning_icon.svg +1 -0
- package/static/devtools/Images/whatsnew.avif +0 -0
- package/static/devtools/Tests.js +1654 -0
- package/static/devtools/accessibility/accessibility-legacy.js +1 -0
- package/static/devtools/accessibility/accessibility-meta.js +1 -0
- package/static/devtools/accessibility/accessibility.js +1 -0
- package/static/devtools/accessibility/accessibility_module.js +1 -0
- package/static/devtools/accessibility_test_runner/accessibility_test_runner.js +77 -0
- package/static/devtools/accessibility_test_runner/accessibility_test_runner_module.js +0 -0
- package/static/devtools/animation/animation-legacy.js +1 -0
- package/static/devtools/animation/animation-meta.js +1 -0
- package/static/devtools/animation/animation.js +1 -0
- package/static/devtools/animation/animation_module.js +1 -0
- package/static/devtools/application_test_runner/AppcacheTestRunner.js +220 -0
- package/static/devtools/application_test_runner/CacheStorageTestRunner.js +286 -0
- package/static/devtools/application_test_runner/IndexedDBTestRunner.js +476 -0
- package/static/devtools/application_test_runner/ResourceTreeTestRunner.js +99 -0
- package/static/devtools/application_test_runner/ResourcesTestRunner.js +167 -0
- package/static/devtools/application_test_runner/ServiceWorkersTestRunner.js +131 -0
- package/static/devtools/application_test_runner/application_test_runner.js +10 -0
- package/static/devtools/application_test_runner/application_test_runner_module.js +0 -0
- package/static/devtools/axe_core_test_runner/axe_core_test_runner.js +174 -0
- package/static/devtools/axe_core_test_runner/axe_core_test_runner_module.js +0 -0
- package/static/devtools/bindings/bindings-legacy.js +1 -0
- package/static/devtools/bindings/bindings.js +1 -0
- package/static/devtools/bindings_test_runner/AutomappingTestRunner.js +130 -0
- package/static/devtools/bindings_test_runner/BindingsTestRunner.js +238 -0
- package/static/devtools/bindings_test_runner/IsolatedFilesystemTestRunner.js +287 -0
- package/static/devtools/bindings_test_runner/OverridesTestRunner.js +26 -0
- package/static/devtools/bindings_test_runner/PersistenceTestRunner.js +109 -0
- package/static/devtools/bindings_test_runner/bindings_test_runner.js +9 -0
- package/static/devtools/bindings_test_runner/bindings_test_runner_module.js +0 -0
- package/static/devtools/browser_debugger/browser_debugger-legacy.js +1 -0
- package/static/devtools/browser_debugger/browser_debugger-meta.js +1 -0
- package/static/devtools/browser_debugger/browser_debugger.js +1 -0
- package/static/devtools/browser_debugger/browser_debugger_module.js +1 -0
- package/static/devtools/browser_sdk/browser_sdk-meta.js +1 -0
- package/static/devtools/browser_sdk/browser_sdk.js +1 -0
- package/static/devtools/changes/changes-legacy.js +1 -0
- package/static/devtools/changes/changes-meta.js +1 -0
- package/static/devtools/changes/changes.js +1 -0
- package/static/devtools/changes/changes_module.js +1 -0
- package/static/devtools/client_variations/client_variations.js +1 -0
- package/static/devtools/client_variations/client_variations_module.js +0 -0
- package/static/devtools/cm/cm.js +1 -0
- package/static/devtools/cm/cm_module.js +1 -0
- package/static/devtools/cm_headless/cm_headless.js +1 -0
- package/static/devtools/color_picker/color_picker-legacy.js +1 -0
- package/static/devtools/color_picker/color_picker.js +1 -0
- package/static/devtools/color_picker/color_picker_module.js +1 -0
- package/static/devtools/common/common-legacy.js +1 -0
- package/static/devtools/common/common.js +1 -0
- package/static/devtools/component_helpers/component_helpers.js +1 -0
- package/static/devtools/components/components-legacy.js +1 -0
- package/static/devtools/components/components.js +1 -0
- package/static/devtools/console/console-legacy.js +1 -0
- package/static/devtools/console/console-meta.js +1 -0
- package/static/devtools/console/console.js +6 -0
- package/static/devtools/console/console_module.js +1 -0
- package/static/devtools/console_counters/console_counters-legacy.js +1 -0
- package/static/devtools/console_counters/console_counters.js +1 -0
- package/static/devtools/console_test_runner/console_test_runner.js +696 -0
- package/static/devtools/console_test_runner/console_test_runner_module.js +0 -0
- package/static/devtools/cookie_table/cookie_table-legacy.js +1 -0
- package/static/devtools/cookie_table/cookie_table.js +1 -0
- package/static/devtools/cookie_table/cookie_table_module.js +1 -0
- package/static/devtools/coverage/coverage-legacy.js +1 -0
- package/static/devtools/coverage/coverage-meta.js +1 -0
- package/static/devtools/coverage/coverage.js +1 -0
- package/static/devtools/coverage/coverage_module.js +1 -0
- package/static/devtools/coverage_test_runner/coverage_test_runner.js +151 -0
- package/static/devtools/coverage_test_runner/coverage_test_runner_module.js +0 -0
- package/static/devtools/cpu_profiler_test_runner/cpu_profiler_test_runner.js +72 -0
- package/static/devtools/cpu_profiler_test_runner/cpu_profiler_test_runner_module.js +0 -0
- package/static/devtools/css_overview/css_overview-meta.js +1 -0
- package/static/devtools/css_overview/css_overview.js +146 -0
- package/static/devtools/css_overview/css_overview_module.js +1 -0
- package/static/devtools/data_grid/data_grid-legacy.js +1 -0
- package/static/devtools/data_grid/data_grid.js +1 -0
- package/static/devtools/data_grid/data_grid_module.js +1 -0
- package/static/devtools/data_grid_test_runner/data_grid_test_runner.js +78 -0
- package/static/devtools/data_grid_test_runner/data_grid_test_runner_module.js +0 -0
- package/static/devtools/developer_resources/developer_resources-legacy.js +1 -0
- package/static/devtools/developer_resources/developer_resources-meta.js +1 -0
- package/static/devtools/developer_resources/developer_resources.js +1 -0
- package/static/devtools/developer_resources/developer_resources_module.js +1 -0
- package/static/devtools/device_mode_test_runner/device_mode_test_runner.js +45 -0
- package/static/devtools/device_mode_test_runner/device_mode_test_runner_module.js +0 -0
- package/static/devtools/devtools_app.html +20 -0
- package/static/devtools/devtools_app.js +1 -0
- package/static/devtools/devtools_compatibility.js +1546 -0
- package/static/devtools/diff/diff-legacy.js +1 -0
- package/static/devtools/diff/diff.js +1 -0
- package/static/devtools/diff/diff_module.js +0 -0
- package/static/devtools/dom_extension/dom_extension.js +1 -0
- package/static/devtools/elements/elements-legacy.js +1 -0
- package/static/devtools/elements/elements-meta.js +1 -0
- package/static/devtools/elements/elements.js +469 -0
- package/static/devtools/elements/elements_module.js +1 -0
- package/static/devtools/elements_test_runner/EditDOMTestRunner.js +78 -0
- package/static/devtools/elements_test_runner/ElementsPanelShadowSelectionOnRefreshTestRunner.js +39 -0
- package/static/devtools/elements_test_runner/ElementsTestRunner.js +1280 -0
- package/static/devtools/elements_test_runner/SetOuterHTMLTestRunner.js +115 -0
- package/static/devtools/elements_test_runner/StylesUpdateLinksTestRunner.js +134 -0
- package/static/devtools/elements_test_runner/elements_test_runner.js +9 -0
- package/static/devtools/elements_test_runner/elements_test_runner_module.js +0 -0
- package/static/devtools/emulated_devices/emulated_devices_module.js +0 -0
- package/static/devtools/emulated_devices/optimized/MotoG4-landscape.avif +0 -0
- package/static/devtools/emulated_devices/optimized/MotoG4-portrait.avif +0 -0
- package/static/devtools/emulated_devices/optimized/Nexus5X-landscape.avif +0 -0
- package/static/devtools/emulated_devices/optimized/Nexus5X-portrait.avif +0 -0
- package/static/devtools/emulated_devices/optimized/Nexus6P-landscape.avif +0 -0
- package/static/devtools/emulated_devices/optimized/Nexus6P-portrait.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5-horizontal-default-1x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5-horizontal-default-2x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5-horizontal-keyboard-1x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5-horizontal-keyboard-2x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5-horizontal-navigation-1x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5-horizontal-navigation-2x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5-vertical-default-1x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5-vertical-default-2x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5-vertical-keyboard-1x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5-vertical-keyboard-2x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5-vertical-navigation-1x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5-vertical-navigation-2x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5x-horizontal-default-1x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5x-horizontal-default-2x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5x-horizontal-keyboard-1x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5x-horizontal-keyboard-2x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5x-horizontal-navigation-1x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5x-horizontal-navigation-2x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5x-vertical-default-1x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5x-vertical-default-2x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5x-vertical-keyboard-1x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5x-vertical-keyboard-2x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5x-vertical-navigation-1x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/google-nexus-5x-vertical-navigation-2x.avif +0 -0
- package/static/devtools/emulated_devices/optimized/iPad-landscape.avif +0 -0
- package/static/devtools/emulated_devices/optimized/iPad-portrait.avif +0 -0
- package/static/devtools/emulated_devices/optimized/iPhone5-landscape.avif +0 -0
- package/static/devtools/emulated_devices/optimized/iPhone5-portrait.avif +0 -0
- package/static/devtools/emulated_devices/optimized/iPhone6-landscape.avif +0 -0
- package/static/devtools/emulated_devices/optimized/iPhone6-portrait.avif +0 -0
- package/static/devtools/emulated_devices/optimized/iPhone6Plus-landscape.avif +0 -0
- package/static/devtools/emulated_devices/optimized/iPhone6Plus-portrait.avif +0 -0
- package/static/devtools/emulation/emulation-legacy.js +1 -0
- package/static/devtools/emulation/emulation-meta.js +1 -0
- package/static/devtools/emulation/emulation.js +1 -0
- package/static/devtools/event_listeners/event_listeners-legacy.js +1 -0
- package/static/devtools/event_listeners/event_listeners.js +1 -0
- package/static/devtools/event_listeners/event_listeners_module.js +1 -0
- package/static/devtools/extensions/extensions-legacy.js +1 -0
- package/static/devtools/extensions/extensions.js +1 -0
- package/static/devtools/extensions_test_runner/ExtensionsNetworkTestRunner.js +27 -0
- package/static/devtools/extensions_test_runner/ExtensionsTestRunner.js +68 -0
- package/static/devtools/extensions_test_runner/extensions_test_runner.js +6 -0
- package/static/devtools/extensions_test_runner/extensions_test_runner_module.js +0 -0
- package/static/devtools/formatter/formatter-legacy.js +1 -0
- package/static/devtools/formatter/formatter.js +1 -0
- package/static/devtools/formatter/formatter_module.js +0 -0
- package/static/devtools/formatter_worker/FormatterActions.js +1 -0
- package/static/devtools/formatter_worker/formatter_worker-entrypoint.js +1 -0
- package/static/devtools/formatter_worker/formatter_worker.js +1 -0
- package/static/devtools/har_importer/har_importer-legacy.js +1 -0
- package/static/devtools/har_importer/har_importer.js +1 -0
- package/static/devtools/har_importer/har_importer_module.js +0 -0
- package/static/devtools/heap_profiler_test_runner/heap_profiler_test_runner.js +740 -0
- package/static/devtools/heap_profiler_test_runner/heap_profiler_test_runner_module.js +0 -0
- package/static/devtools/heap_snapshot_model/heap_snapshot_model-legacy.js +1 -0
- package/static/devtools/heap_snapshot_model/heap_snapshot_model.js +1 -0
- package/static/devtools/heap_snapshot_model/heap_snapshot_model_module.js +0 -0
- package/static/devtools/heap_snapshot_worker/heap_snapshot_worker-entrypoint.js +1 -0
- package/static/devtools/heap_snapshot_worker/heap_snapshot_worker-legacy.js +1 -0
- package/static/devtools/heap_snapshot_worker/heap_snapshot_worker.js +1 -0
- package/static/devtools/heap_snapshot_worker/heap_snapshot_worker_module.js +0 -0
- package/static/devtools/help/help-legacy.js +1 -0
- package/static/devtools/help/help-meta.js +1 -0
- package/static/devtools/help/help.js +1 -0
- package/static/devtools/help/help_module.js +1 -0
- package/static/devtools/host/host-legacy.js +1 -0
- package/static/devtools/host/host.js +1 -0
- package/static/devtools/i18n/i18n.js +1 -0
- package/static/devtools/i18n/i18n_locales-tsconfig.json +8 -0
- package/static/devtools/i18n/locales/en-US.json +3566 -0
- package/static/devtools/inline_editor/inline_editor-legacy.js +1 -0
- package/static/devtools/inline_editor/inline_editor.js +203 -0
- package/static/devtools/inline_editor/inline_editor_module.js +1 -0
- package/static/devtools/input/input-legacy.js +1 -0
- package/static/devtools/input/input-meta.js +1 -0
- package/static/devtools/input/input.js +1 -0
- package/static/devtools/input/input_module.js +1 -0
- package/static/devtools/inspector.html +20 -0
- package/static/devtools/inspector.js +1 -0
- package/static/devtools/inspector_main/inspector_main-legacy.js +1 -0
- package/static/devtools/inspector_main/inspector_main-meta.js +1 -0
- package/static/devtools/inspector_main/inspector_main.js +1 -0
- package/static/devtools/integration_test_runner.html +14 -0
- package/static/devtools/integration_test_runner.js +2 -0
- package/static/devtools/issues/issues-legacy.js +1 -0
- package/static/devtools/issues/issues-meta.js +1 -0
- package/static/devtools/issues/issues.js +67 -0
- package/static/devtools/issues/issues_module.js +1 -0
- package/static/devtools/javascript_metadata/javascript_metadata-legacy.js +1 -0
- package/static/devtools/javascript_metadata/javascript_metadata.js +1 -0
- package/static/devtools/javascript_metadata/javascript_metadata_module.js +0 -0
- package/static/devtools/js_app.html +20 -0
- package/static/devtools/js_app.js +1 -0
- package/static/devtools/js_main/js_main-legacy.js +1 -0
- package/static/devtools/js_main/js_main.js +1 -0
- package/static/devtools/js_profiler/js_profiler-meta.js +1 -0
- package/static/devtools/js_profiler/js_profiler.js +1 -0
- package/static/devtools/js_profiler/js_profiler_module.js +0 -0
- package/static/devtools/layer_viewer/layer_viewer-legacy.js +1 -0
- package/static/devtools/layer_viewer/layer_viewer.js +1 -0
- package/static/devtools/layer_viewer/layer_viewer_module.js +1 -0
- package/static/devtools/layers/layers-legacy.js +1 -0
- package/static/devtools/layers/layers-meta.js +1 -0
- package/static/devtools/layers/layers.js +1 -0
- package/static/devtools/layers/layers_module.js +0 -0
- package/static/devtools/layers_test_runner/layers_test_runner.js +156 -0
- package/static/devtools/layers_test_runner/layers_test_runner_module.js +0 -0
- package/static/devtools/lighthouse/lighthouse-legacy.js +1 -0
- package/static/devtools/lighthouse/lighthouse-meta.js +1 -0
- package/static/devtools/lighthouse/lighthouse.js +70 -0
- package/static/devtools/lighthouse/lighthouse_module.js +1 -0
- package/static/devtools/lighthouse_test_runner/lighthouse_test_runner.js +136 -0
- package/static/devtools/lighthouse_test_runner/lighthouse_test_runner_module.js +0 -0
- package/static/devtools/lighthouse_worker/LighthouseService.js +195 -0
- package/static/devtools/lighthouse_worker/lighthouse_worker.js +6 -0
- package/static/devtools/lighthouse_worker.js +1 -0
- package/static/devtools/linear_memory_inspector/linear_memory_inspector-legacy.js +1 -0
- package/static/devtools/linear_memory_inspector/linear_memory_inspector-meta.js +1 -0
- package/static/devtools/linear_memory_inspector/linear_memory_inspector.js +399 -0
- package/static/devtools/linear_memory_inspector/linear_memory_inspector_module.js +0 -0
- package/static/devtools/main/main-legacy.js +1 -0
- package/static/devtools/main/main.js +1 -0
- package/static/devtools/media/media-legacy.js +1 -0
- package/static/devtools/media/media-meta.js +1 -0
- package/static/devtools/media/media.js +1 -0
- package/static/devtools/media/media_module.js +1 -0
- package/static/devtools/mobile_throttling/mobile_throttling-legacy.js +1 -0
- package/static/devtools/mobile_throttling/mobile_throttling-meta.js +1 -0
- package/static/devtools/mobile_throttling/mobile_throttling.js +1 -0
- package/static/devtools/ndb_app.html +20 -0
- package/static/devtools/ndb_app.js +1 -0
- package/static/devtools/network/network-legacy.js +1 -0
- package/static/devtools/network/network-meta.js +1 -0
- package/static/devtools/network/network.js +72 -0
- package/static/devtools/network/network_module.js +1 -0
- package/static/devtools/network_test_runner/network_test_runner.js +280 -0
- package/static/devtools/network_test_runner/network_test_runner_module.js +0 -0
- package/static/devtools/node_app.html +20 -0
- package/static/devtools/node_app.js +1 -0
- package/static/devtools/node_debugger/node_debugger-meta.js +1 -0
- package/static/devtools/node_debugger/node_debugger.js +1 -0
- package/static/devtools/node_debugger/node_debugger_module.js +0 -0
- package/static/devtools/node_main/node_main-legacy.js +1 -0
- package/static/devtools/node_main/node_main-meta.js +1 -0
- package/static/devtools/node_main/node_main.js +1 -0
- package/static/devtools/object_ui/object_ui-legacy.js +1 -0
- package/static/devtools/object_ui/object_ui.js +3 -0
- package/static/devtools/object_ui/object_ui_module.js +1 -0
- package/static/devtools/perf_ui/perf_ui-legacy.js +1 -0
- package/static/devtools/perf_ui/perf_ui.js +152 -0
- package/static/devtools/perf_ui/perf_ui_module.js +1 -0
- package/static/devtools/performance_monitor/performance_monitor-legacy.js +1 -0
- package/static/devtools/performance_monitor/performance_monitor-meta.js +1 -0
- package/static/devtools/performance_monitor/performance_monitor.js +1 -0
- package/static/devtools/performance_monitor/performance_monitor_module.js +1 -0
- package/static/devtools/performance_test_runner/TimelineDataTestRunner.js +5375 -0
- package/static/devtools/performance_test_runner/TimelineTestRunner.js +446 -0
- package/static/devtools/performance_test_runner/performance_test_runner.js +6 -0
- package/static/devtools/performance_test_runner/performance_test_runner_module.js +0 -0
- package/static/devtools/persistence/persistence-legacy.js +1 -0
- package/static/devtools/persistence/persistence-meta.js +1 -0
- package/static/devtools/persistence/persistence.js +1 -0
- package/static/devtools/platform/platform.js +1 -0
- package/static/devtools/profiler/profiler-legacy.js +1 -0
- package/static/devtools/profiler/profiler-meta.js +1 -0
- package/static/devtools/profiler/profiler.js +8 -0
- package/static/devtools/profiler/profiler_module.js +1 -0
- package/static/devtools/protocol_client/protocol_client-legacy.js +1 -0
- package/static/devtools/protocol_client/protocol_client.js +1 -0
- package/static/devtools/protocol_monitor/protocol_monitor-legacy.js +1 -0
- package/static/devtools/protocol_monitor/protocol_monitor-meta.js +1 -0
- package/static/devtools/protocol_monitor/protocol_monitor.js +1 -0
- package/static/devtools/protocol_monitor/protocol_monitor_module.js +1 -0
- package/static/devtools/quick_open/quick_open-legacy.js +1 -0
- package/static/devtools/quick_open/quick_open.js +1 -0
- package/static/devtools/quick_open/quick_open_module.js +1 -0
- package/static/devtools/recorder/recorder.js +1 -0
- package/static/devtools/resources/resources-legacy.js +1 -0
- package/static/devtools/resources/resources-meta.js +1 -0
- package/static/devtools/resources/resources.js +28 -0
- package/static/devtools/resources/resources_module.js +1 -0
- package/static/devtools/root/root-legacy.js +1 -0
- package/static/devtools/root/root.js +1 -0
- package/static/devtools/screencast/screencast-legacy.js +1 -0
- package/static/devtools/screencast/screencast.js +1 -0
- package/static/devtools/sdk/sdk-legacy.js +1 -0
- package/static/devtools/sdk/sdk.js +2 -0
- package/static/devtools/sdk_test_runner/sdk_test_runner.js +297 -0
- package/static/devtools/sdk_test_runner/sdk_test_runner_module.js +0 -0
- package/static/devtools/search/search-legacy.js +1 -0
- package/static/devtools/search/search.js +1 -0
- package/static/devtools/search/search_module.js +1 -0
- package/static/devtools/security/security-legacy.js +1 -0
- package/static/devtools/security/security-meta.js +1 -0
- package/static/devtools/security/security.js +1 -0
- package/static/devtools/security/security_module.js +1 -0
- package/static/devtools/security_test_runner/security_test_runner.js +32 -0
- package/static/devtools/security_test_runner/security_test_runner_module.js +0 -0
- package/static/devtools/services/services-legacy.js +1 -0
- package/static/devtools/services/services.js +1 -0
- package/static/devtools/settings/settings-legacy.js +1 -0
- package/static/devtools/settings/settings-meta.js +1 -0
- package/static/devtools/settings/settings.js +1 -0
- package/static/devtools/settings/settings_module.js +1 -0
- package/static/devtools/shell.js +1 -0
- package/static/devtools/snippets/snippets-legacy.js +1 -0
- package/static/devtools/snippets/snippets.js +1 -0
- package/static/devtools/snippets/snippets_module.js +0 -0
- package/static/devtools/source_frame/source_frame-legacy.js +1 -0
- package/static/devtools/source_frame/source_frame.js +1 -0
- package/static/devtools/source_frame/source_frame_module.js +1 -0
- package/static/devtools/sources/sources-legacy.js +1 -0
- package/static/devtools/sources/sources-meta.js +1 -0
- package/static/devtools/sources/sources.js +13 -0
- package/static/devtools/sources/sources_module.js +1 -0
- package/static/devtools/sources_test_runner/AutocompleteTestRunner.js +46 -0
- package/static/devtools/sources_test_runner/DebuggerTestRunner.js +895 -0
- package/static/devtools/sources_test_runner/EditorTestRunner.js +237 -0
- package/static/devtools/sources_test_runner/LiveEditTestRunner.js +33 -0
- package/static/devtools/sources_test_runner/SearchTestRunner.js +158 -0
- package/static/devtools/sources_test_runner/SourcesTestRunner.js +173 -0
- package/static/devtools/sources_test_runner/sources_test_runner.js +10 -0
- package/static/devtools/sources_test_runner/sources_test_runner_module.js +0 -0
- package/static/devtools/startup/startup.js +1 -0
- package/static/devtools/test_runner/test_runner.js +1 -0
- package/static/devtools/text_editor/text_editor-legacy.js +1 -0
- package/static/devtools/text_editor/text_editor.js +1 -0
- package/static/devtools/text_editor/text_editor_module.js +1 -0
- package/static/devtools/text_utils/text_utils-legacy.js +1 -0
- package/static/devtools/text_utils/text_utils.js +1 -0
- package/static/devtools/theme_support/theme_support.js +1 -0
- package/static/devtools/third_party/acorn/acorn-tsconfig.json +8 -0
- package/static/devtools/third_party/acorn/acorn.js +1 -0
- package/static/devtools/third_party/acorn/package/dist/acorn.d.ts +209 -0
- package/static/devtools/third_party/acorn/package/dist/acorn.mjs +5261 -0
- package/static/devtools/third_party/acorn/package/dist/acorn.mjs.d.ts +2 -0
- package/static/devtools/third_party/acorn/package/dist/acorn.mjs.map +1 -0
- package/static/devtools/third_party/acorn-loose/acorn-loose-tsconfig.json +8 -0
- package/static/devtools/third_party/acorn-loose/package/dist/acorn-loose.d.ts +16 -0
- package/static/devtools/third_party/acorn-loose/package/dist/acorn-loose.mjs +1418 -0
- package/static/devtools/third_party/axe-core/axe.js +16423 -0
- package/static/devtools/third_party/chromium/chromium-tsconfig.json +8 -0
- package/static/devtools/third_party/chromium/client-variations/ClientVariations.d.ts +13 -0
- package/static/devtools/third_party/chromium/client-variations/ClientVariations.js +27 -0
- package/static/devtools/third_party/codemirror/codemirror-tsconfig.json +72 -0
- package/static/devtools/third_party/codemirror/package/addon/comment/comment.d.ts +4 -0
- package/static/devtools/third_party/codemirror/package/addon/comment/comment.js +211 -0
- package/static/devtools/third_party/codemirror/package/addon/edit/closebrackets.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/addon/edit/closebrackets.js +201 -0
- package/static/devtools/third_party/codemirror/package/addon/edit/matchbrackets.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/addon/edit/matchbrackets.js +158 -0
- package/static/devtools/third_party/codemirror/package/addon/fold/brace-fold.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/addon/fold/brace-fold.js +105 -0
- package/static/devtools/third_party/codemirror/package/addon/fold/foldcode.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/addon/fold/foldcode.js +157 -0
- package/static/devtools/third_party/codemirror/package/addon/fold/foldgutter.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/addon/fold/foldgutter.js +163 -0
- package/static/devtools/third_party/codemirror/package/addon/mode/multiplex.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/addon/mode/multiplex.js +131 -0
- package/static/devtools/third_party/codemirror/package/addon/mode/overlay.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/addon/mode/overlay.js +90 -0
- package/static/devtools/third_party/codemirror/package/addon/mode/simple.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/addon/mode/simple.js +216 -0
- package/static/devtools/third_party/codemirror/package/addon/runmode/runmode-standalone.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/addon/runmode/runmode-standalone.js +333 -0
- package/static/devtools/third_party/codemirror/package/addon/selection/active-line.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/addon/selection/active-line.js +72 -0
- package/static/devtools/third_party/codemirror/package/addon/selection/mark-selection.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/addon/selection/mark-selection.js +119 -0
- package/static/devtools/third_party/codemirror/package/lib/codemirror.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/lib/codemirror.js +9800 -0
- package/static/devtools/third_party/codemirror/package/mode/clike/clike.d.ts +4 -0
- package/static/devtools/third_party/codemirror/package/mode/clike/clike.js +935 -0
- package/static/devtools/third_party/codemirror/package/mode/clojure/clojure.d.ts +4 -0
- package/static/devtools/third_party/codemirror/package/mode/clojure/clojure.js +292 -0
- package/static/devtools/third_party/codemirror/package/mode/coffeescript/coffeescript.d.ts +4 -0
- package/static/devtools/third_party/codemirror/package/mode/coffeescript/coffeescript.js +359 -0
- package/static/devtools/third_party/codemirror/package/mode/css/css.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/mode/css/css.js +864 -0
- package/static/devtools/third_party/codemirror/package/mode/htmlembedded/htmlembedded.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/mode/htmlembedded/htmlembedded.js +37 -0
- package/static/devtools/third_party/codemirror/package/mode/htmlmixed/htmlmixed.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/mode/htmlmixed/htmlmixed.js +153 -0
- package/static/devtools/third_party/codemirror/package/mode/javascript/javascript.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/mode/javascript/javascript.js +942 -0
- package/static/devtools/third_party/codemirror/package/mode/jsx/jsx.d.ts +4 -0
- package/static/devtools/third_party/codemirror/package/mode/jsx/jsx.js +148 -0
- package/static/devtools/third_party/codemirror/package/mode/livescript/livescript.d.ts +4 -0
- package/static/devtools/third_party/codemirror/package/mode/livescript/livescript.js +280 -0
- package/static/devtools/third_party/codemirror/package/mode/markdown/markdown.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/mode/markdown/markdown.js +886 -0
- package/static/devtools/third_party/codemirror/package/mode/php/php.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/mode/php/php.js +234 -0
- package/static/devtools/third_party/codemirror/package/mode/python/python.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/mode/python/python.js +399 -0
- package/static/devtools/third_party/codemirror/package/mode/shell/shell.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/mode/shell/shell.js +168 -0
- package/static/devtools/third_party/codemirror/package/mode/wast/wast.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/mode/wast/wast.js +41 -0
- package/static/devtools/third_party/codemirror/package/mode/xml/xml.d.ts +1 -0
- package/static/devtools/third_party/codemirror/package/mode/xml/xml.js +413 -0
- package/static/devtools/third_party/i18n/bundle-tsconfig.json +8 -0
- package/static/devtools/third_party/i18n/i18n.d.ts +108 -0
- package/static/devtools/third_party/i18n/i18n.js +4336 -0
- package/static/devtools/third_party/lighthouse/lighthouse-dt-bundle.d.ts +1 -0
- package/static/devtools/third_party/lighthouse/lighthouse-dt-bundle.js +1140 -0
- package/static/devtools/third_party/lighthouse/lighthouse-tsconfig.json +10 -0
- package/static/devtools/third_party/lighthouse/locales/ar-XB.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/ar.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/bg.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/ca.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/cs.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/da.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/de.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/el.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/en-GB.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/en-US.json +2297 -0
- package/static/devtools/third_party/lighthouse/locales/en-XA.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/en-XL.json +2297 -0
- package/static/devtools/third_party/lighthouse/locales/es-419.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/es.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/fi.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/fil.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/fr.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/he.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/hi.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/hr.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/hu.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/id.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/it.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/ja.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/ko.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/lt.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/lv.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/nl.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/no.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/pl.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/pt-PT.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/pt.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/ro.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/ru.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/sk.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/sl.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/sr-Latn.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/sr.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/sv.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/ta.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/te.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/th.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/tr.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/uk.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/vi.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/zh-HK.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/zh-TW.json +2066 -0
- package/static/devtools/third_party/lighthouse/locales/zh.json +2066 -0
- package/static/devtools/third_party/lighthouse/report-assets/report-generator.d.ts +1 -0
- package/static/devtools/third_party/lighthouse/report-assets/report-generator.js +167 -0
- package/static/devtools/third_party/lighthouse/report-assets/report.d.ts +1 -0
- package/static/devtools/third_party/lighthouse/report-assets/report.js +5032 -0
- package/static/devtools/third_party/lit-html/lit-html-tsconfig.json +22 -0
- package/static/devtools/third_party/lit-html/lit-html.js +120 -0
- package/static/devtools/third_party/lit-html/package/directives/class-map.d.ts +28 -0
- package/static/devtools/third_party/lit-html/package/directives/class-map.js +101 -0
- package/static/devtools/third_party/lit-html/package/directives/class-map.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/directives/if-defined.d.ts +22 -0
- package/static/devtools/third_party/lit-html/package/directives/if-defined.js +37 -0
- package/static/devtools/third_party/lit-html/package/directives/if-defined.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/directives/live.d.ts +38 -0
- package/static/devtools/third_party/lit-html/package/directives/live.js +73 -0
- package/static/devtools/third_party/lit-html/package/directives/live.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/directives/repeat.d.ts +37 -0
- package/static/devtools/third_party/lit-html/package/directives/repeat.js +415 -0
- package/static/devtools/third_party/lit-html/package/directives/repeat.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/directives/style-map.d.ts +36 -0
- package/static/devtools/third_party/lit-html/package/directives/style-map.js +78 -0
- package/static/devtools/third_party/lit-html/package/directives/style-map.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/lib/default-template-processor.d.ts +39 -0
- package/static/devtools/third_party/lit-html/package/lib/default-template-processor.js +52 -0
- package/static/devtools/third_party/lit-html/package/lib/default-template-processor.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/lib/directive.d.ts +59 -0
- package/static/devtools/third_party/lit-html/package/lib/directive.js +63 -0
- package/static/devtools/third_party/lit-html/package/lib/directive.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/lib/dom.d.ts +29 -0
- package/static/devtools/third_party/lit-html/package/lib/dom.js +44 -0
- package/static/devtools/third_party/lit-html/package/lib/dom.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/lib/part.d.ts +46 -0
- package/static/devtools/third_party/lit-html/package/lib/part.js +23 -0
- package/static/devtools/third_party/lit-html/package/lib/part.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/lib/parts.d.ts +148 -0
- package/static/devtools/third_party/lit-html/package/lib/parts.js +476 -0
- package/static/devtools/third_party/lit-html/package/lib/parts.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/lib/render.d.ts +33 -0
- package/static/devtools/third_party/lit-html/package/lib/render.js +43 -0
- package/static/devtools/third_party/lit-html/package/lib/render.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/lib/template-factory.d.ts +57 -0
- package/static/devtools/third_party/lit-html/package/lib/template-factory.js +48 -0
- package/static/devtools/third_party/lit-html/package/lib/template-factory.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/lib/template-instance.d.ts +30 -0
- package/static/devtools/third_party/lit-html/package/lib/template-instance.js +134 -0
- package/static/devtools/third_party/lit-html/package/lib/template-instance.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/lib/template-result.d.ts +42 -0
- package/static/devtools/third_party/lit-html/package/lib/template-result.js +131 -0
- package/static/devtools/third_party/lit-html/package/lib/template-result.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/lib/template.d.ts +92 -0
- package/static/devtools/third_party/lit-html/package/lib/template.js +215 -0
- package/static/devtools/third_party/lit-html/package/lib/template.js.map +1 -0
- package/static/devtools/third_party/lit-html/package/lit-html.d.ts +42 -0
- package/static/devtools/third_party/lit-html/package/lit-html.js +59 -0
- package/static/devtools/third_party/lit-html/package/lit-html.js.map +1 -0
- package/static/devtools/third_party/marked/marked-tsconfig.json +8 -0
- package/static/devtools/third_party/marked/marked.js +1 -0
- package/static/devtools/third_party/marked/package/lib/marked.esm.d.ts +1 -0
- package/static/devtools/third_party/marked/package/lib/marked.esm.js +2584 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/api-docs-entry.d.ts +53 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/api-docs-entry.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/api-docs-entry.js +64 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Accessibility.d.ts +176 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Accessibility.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Accessibility.js +356 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.d.ts +21 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.js +81 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.d.ts +423 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.js +516 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.d.ts +39 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js +76 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserWebSocketTransport.d.ts +26 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserWebSocketTransport.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserWebSocketTransport.js +30 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.d.ts +120 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.js +266 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectionTransport.d.ts +22 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectionTransport.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectionTransport.js +15 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.d.ts +72 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.js +60 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.d.ts +181 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.js +316 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.d.ts +174 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.js +647 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Debug.d.ts +53 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Debug.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Debug.js +77 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/DeviceDescriptors.d.ts +33 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/DeviceDescriptors.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/DeviceDescriptors.js +873 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Dialog.d.ts +76 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Dialog.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Dialog.js +92 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/EmulationManager.d.ts +25 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/EmulationManager.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/EmulationManager.js +33 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.d.ts +34 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.js +37 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/EvalTypes.d.ts +59 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/EvalTypes.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/EvalTypes.js +15 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/EventEmitter.d.ts +89 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/EventEmitter.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/EventEmitter.js +109 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Events.d.ts +82 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Events.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Events.js +83 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/ExecutionContext.d.ts +189 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/ExecutionContext.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/ExecutionContext.js +313 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/FileChooser.d.ts +60 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/FileChooser.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/FileChooser.js +66 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.d.ts +735 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.js +962 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.d.ts +276 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.js +421 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.d.ts +128 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.js +150 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Input.d.ts +322 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Input.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Input.js +463 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.d.ts +439 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.js +724 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.d.ts +62 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.js +145 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.d.ts +80 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.js +262 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/PDFOptions.d.ts +152 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/PDFOptions.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/PDFOptions.js +31 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.d.ts +910 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.js +1343 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Product.d.ts +21 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Product.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Product.js +15 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Puppeteer.d.ts +135 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Puppeteer.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Puppeteer.js +133 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/PuppeteerViewport.d.ts +24 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/PuppeteerViewport.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/PuppeteerViewport.js +0 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/QueryHandler.d.ts +66 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/QueryHandler.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/QueryHandler.js +157 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/SecurityDetails.d.ts +61 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/SecurityDetails.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/SecurityDetails.js +72 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Target.d.ts +98 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Target.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Target.js +137 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/TimeoutSettings.d.ts +28 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/TimeoutSettings.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/TimeoutSettings.js +43 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Tracing.d.ts +47 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Tracing.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Tracing.js +94 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/USKeyboardLayout.d.ts +40 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/USKeyboardLayout.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/USKeyboardLayout.js +403 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/WebWorker.d.ts +102 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/WebWorker.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/WebWorker.js +109 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/assert.d.ts +22 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/assert.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/assert.js +24 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/fetch.d.ts +17 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/fetch.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/fetch.js +20 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/helper.d.ts +66 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/helper.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/helper.js +288 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/environment.d.ts +17 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/environment.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/environment.js +16 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/initialize-node.d.ts +18 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/initialize-node.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/initialize-node.js +39 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/initialize-web.d.ts +18 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/initialize-web.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/initialize-web.js +22 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserFetcher.d.ts +132 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserFetcher.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserFetcher.js +468 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.d.ts +40 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.js +197 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.d.ts +42 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.js +0 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.d.ts +16 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.js +469 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/NodeWebSocketTransport.d.ts +29 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/NodeWebSocketTransport.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/NodeWebSocketTransport.js +34 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/PipeTransport.d.ts +31 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/PipeTransport.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/PipeTransport.js +61 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.d.ts +156 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.js +183 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/install.d.ts +18 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/install.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/install.js +151 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node-puppeteer-core.d.ts +18 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node-puppeteer-core.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node-puppeteer-core.js +23 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node.d.ts +18 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node.js +22 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +22 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +19 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/web.d.ts +18 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/web.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/web.js +22 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/vendor/mitt/src/index.d.ts +22 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/vendor/mitt/src/index.d.ts.map +1 -0
- package/static/devtools/third_party/puppeteer/package/lib/esm/vendor/mitt/src/index.js +53 -0
- package/static/devtools/third_party/puppeteer/puppeteer-tsconfig.json +58 -0
- package/static/devtools/third_party/puppeteer/puppeteer.js +1 -0
- package/static/devtools/third_party/wasmparser/package/dist/esm/WasmDis.js +1595 -0
- package/static/devtools/third_party/wasmparser/package/dist/esm/WasmParser.js +3120 -0
- package/static/devtools/third_party/wasmparser/wasmparser-tsconfig.json +9 -0
- package/static/devtools/timeline/timeline-legacy.js +1 -0
- package/static/devtools/timeline/timeline-meta.js +1 -0
- package/static/devtools/timeline/timeline.js +1 -0
- package/static/devtools/timeline/timeline_module.js +1 -0
- package/static/devtools/timeline_model/timeline_model-legacy.js +1 -0
- package/static/devtools/timeline_model/timeline_model.js +1 -0
- package/static/devtools/timeline_model/timeline_model_module.js +0 -0
- package/static/devtools/toolbox.html +20 -0
- package/static/devtools/toolbox.js +1 -0
- package/static/devtools/toolbox_bootstrap/toolbox_bootstrap.js +1 -0
- package/static/devtools/ui/components/components.js +378 -0
- package/static/devtools/ui/ui-legacy.js +1 -0
- package/static/devtools/ui/ui.js +3 -0
- package/static/devtools/ui/utils/utils.js +1 -0
- package/static/devtools/wasmparser_worker/wasmparser_worker-entrypoint.js +1 -0
- package/static/devtools/wasmparser_worker/wasmparser_worker.js +1 -0
- package/static/devtools/web_audio/graph_visualizer/graph_visualizer.js +1 -0
- package/static/devtools/web_audio/web_audio-legacy.js +1 -0
- package/static/devtools/web_audio/web_audio-meta.js +1 -0
- package/static/devtools/web_audio/web_audio.js +23 -0
- package/static/devtools/web_audio/web_audio_module.js +1 -0
- package/static/devtools/webauthn/webauthn-legacy.js +1 -0
- package/static/devtools/webauthn/webauthn-meta.js +1 -0
- package/static/devtools/webauthn/webauthn.js +6 -0
- package/static/devtools/webauthn/webauthn_module.js +1 -0
- package/static/devtools/worker_app.html +20 -0
- package/static/devtools/worker_app.js +1 -0
- package/static/devtools/worker_main/worker_main-legacy.js +1 -0
- package/static/devtools/worker_main/worker_main.js +1 -0
- package/static/devtools/worker_service/worker_service.js +1 -0
- package/static/devtools/workspace/workspace-legacy.js +1 -0
- package/static/devtools/workspace/workspace.js +1 -0
- package/static/devtools/workspace_diff/workspace_diff-legacy.js +1 -0
- package/static/devtools/workspace_diff/workspace_diff.js +1 -0
- package/static/devtools/workspace_diff/workspace_diff_module.js +0 -0
- package/static/docs/swagger.json +2337 -279
- package/static/function/client.js +1037 -992
- package/build/routes/chromium/http/json-new.js +0 -23
- package/build/routes/chromium/http/json-version-get.response.json +0 -37
- package/build/routes/chromium/utils/cdp.d.ts +0 -2
- package/build/routes/chromium/utils/cdp.js +0 -14
- package/build/routes/chromium/ws/cdp-chromium.js +0 -10
- package/src/routes/chromium/http/json-list.ts +0 -50
- package/src/routes/chromium/utils/cdp.ts +0 -19
- package/build/routes/{chromium/http/content-post.query.json → chrome/http/content.post.query.json} +0 -0
- package/build/routes/{chromium/http/content-post.response.json → chrome/http/content.post.response.json} +0 -0
- package/build/routes/{chromium/http/download-post.body.json → chrome/http/download.post.body.json} +0 -0
- package/build/routes/{chromium/http/download-post.query.json → chrome/http/download.post.query.json} +0 -0
- package/build/routes/{chromium/http/download-post.response.json → chrome/http/download.post.response.json} +0 -0
- package/build/routes/{chromium/http/function-post.body.json → chrome/http/function.post.body.json} +0 -0
- package/build/routes/{chromium/http/function-post.query.json → chrome/http/function.post.query.json} +0 -0
- package/build/routes/{chromium/http/function-post.response.json → chrome/http/function.post.response.json} +0 -0
- package/build/routes/{chromium/http/json-list.response.json → chrome/http/json-list.get.response.json} +0 -0
- package/build/routes/{chromium/http/json-new.response.json → chrome/http/json-new.put.response.json} +0 -0
- package/build/routes/{chromium/http/json-protocol-get.response.json → chrome/http/json-protocol.get.response.json} +0 -0
- package/build/routes/{chromium/http/pdf-post.query.json → chrome/http/pdf.post.query.json} +0 -0
- package/build/routes/{chromium/http/pdf-post.response.json → chrome/http/pdf.post.response.json} +0 -0
- package/build/routes/{chromium/http/performance.body.json → chrome/http/performance.post.body.json} +0 -0
- package/build/routes/{chromium/http/performance.query.json → chrome/http/performance.post.query.json} +0 -0
- package/build/routes/{chromium/http/performance.response.json → chrome/http/performance.post.response.json} +0 -0
- package/build/routes/{chromium/http/scrape-post.query.json → chrome/http/scrape.post.query.json} +0 -0
- package/build/routes/{chromium/http/scrape-post.response.json → chrome/http/scrape.post.response.json} +0 -0
- package/build/routes/{chromium/http/screenshot-post.query.json → chrome/http/screenshot.post.query.json} +0 -0
- package/build/routes/{chromium/http/screenshot-post.response.json → chrome/http/screenshot.post.response.json} +0 -0
- package/build/routes/{chromium/utils/performance/child.d.ts → chrome/tests/content.spec.d.ts} +0 -0
- package/build/routes/{chromium/utils/performance/types.js → chrome/tests/download.spec.d.ts} +0 -0
- package/build/routes/{chromium/ws/cdp-chromium.query.json → chrome/ws/browser.query.json} +0 -0
- package/build/routes/{chromium/ws/playwright-chromium.query.json → chrome/ws/playwright.query.json} +0 -0
- package/build/routes/{firefox/ws/playwright-firefox.query.json → chromium/ws/playwright.query.json} +0 -0
- package/build/routes/{webkit/ws/playwright-webkit.query.json → firefox/ws/playwright.query.json} +0 -0
- package/build/routes/management/http/{config-get.d.ts → config.get.d.ts} +0 -0
- package/build/routes/management/http/{config-get.js → config.get.js} +0 -0
- package/build/routes/management/http/{config-get.response.json → config.get.response.json} +0 -0
- package/build/routes/management/http/{metrics-total-get.d.ts → metrics-total.get.d.ts} +0 -0
- package/build/routes/management/http/{metrics-total-get.js → metrics-total.get.js} +0 -0
- package/build/routes/management/http/{metrics-total-get.response.json → metrics-total.get.response.json} +0 -0
- package/build/routes/management/http/{metrics-get.d.ts → metrics.get.d.ts} +0 -0
- package/build/routes/management/http/{metrics-get.js → metrics.get.js} +0 -0
- package/build/routes/management/http/{metrics-get.response.json → metrics.get.response.json} +0 -0
- package/build/routes/management/http/{sessions-get.d.ts → sessions.get.d.ts} +0 -0
- package/build/routes/management/http/{sessions-get.js → sessions.get.js} +0 -0
- package/build/routes/management/http/{static-get.d.ts → static.get.d.ts} +0 -0
- package/build/{routes/chromium/http/json-protocol-get.d.ts → shared/json-protocol.http.d.ts} +1 -1
- package/build/{routes/chromium/http/json-version-get.d.ts → shared/json-version.http.d.ts} +1 -1
- /package/build/{routes/chromium → shared}/utils/function/client.d.ts +0 -0
- /package/build/{routes/chromium → shared}/utils/function/client.js +0 -0
- /package/build/{routes/chromium → shared}/utils/function/handler.d.ts +0 -0
- /package/build/{routes/chromium → shared}/utils/function/handler.js +0 -0
- /package/build/{routes/chromium → shared}/utils/performance/child.js +0 -0
- /package/build/{routes/chromium → shared}/utils/performance/main.d.ts +0 -0
- /package/build/{routes/chromium → shared}/utils/performance/types.d.ts +0 -0
- /package/src/routes/management/http/{config-get.ts → config.get.ts} +0 -0
- /package/src/routes/management/http/{metrics-total-get.ts → metrics-total.get.ts} +0 -0
- /package/src/routes/management/http/{metrics-get.ts → metrics.get.ts} +0 -0
- /package/src/routes/management/http/{sessions-get.ts → sessions.get.ts} +0 -0
- /package/src/{routes/chromium → shared}/utils/function/client.ts +0 -0
- /package/src/{routes/chromium → shared}/utils/performance/child.ts +0 -0
- /package/src/{routes/chromium → shared}/utils/performance/types.ts +0 -0
|
@@ -0,0 +1,2584 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* marked - a markdown parser
|
|
3
|
+
* Copyright (c) 2011-2020, Christopher Jeffrey. (MIT Licensed)
|
|
4
|
+
* https://github.com/markedjs/marked
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* DO NOT EDIT THIS FILE
|
|
9
|
+
* The code in this file is generated from files in ./src/
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
function createCommonjsModule(fn, module) {
|
|
13
|
+
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
var defaults = createCommonjsModule(function (module) {
|
|
17
|
+
function getDefaults() {
|
|
18
|
+
return {
|
|
19
|
+
baseUrl: null,
|
|
20
|
+
breaks: false,
|
|
21
|
+
gfm: true,
|
|
22
|
+
headerIds: true,
|
|
23
|
+
headerPrefix: '',
|
|
24
|
+
highlight: null,
|
|
25
|
+
langPrefix: 'language-',
|
|
26
|
+
mangle: true,
|
|
27
|
+
pedantic: false,
|
|
28
|
+
renderer: null,
|
|
29
|
+
sanitize: false,
|
|
30
|
+
sanitizer: null,
|
|
31
|
+
silent: false,
|
|
32
|
+
smartLists: false,
|
|
33
|
+
smartypants: false,
|
|
34
|
+
tokenizer: null,
|
|
35
|
+
walkTokens: null,
|
|
36
|
+
xhtml: false
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function changeDefaults(newDefaults) {
|
|
41
|
+
module.exports.defaults = newDefaults;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
module.exports = {
|
|
45
|
+
defaults: getDefaults(),
|
|
46
|
+
getDefaults,
|
|
47
|
+
changeDefaults
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
var defaults_1 = defaults.defaults;
|
|
51
|
+
var defaults_2 = defaults.getDefaults;
|
|
52
|
+
var defaults_3 = defaults.changeDefaults;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Helpers
|
|
56
|
+
*/
|
|
57
|
+
const escapeTest = /[&<>"']/;
|
|
58
|
+
const escapeReplace = /[&<>"']/g;
|
|
59
|
+
const escapeTestNoEncode = /[<>"']|&(?!#?\w+;)/;
|
|
60
|
+
const escapeReplaceNoEncode = /[<>"']|&(?!#?\w+;)/g;
|
|
61
|
+
const escapeReplacements = {
|
|
62
|
+
'&': '&',
|
|
63
|
+
'<': '<',
|
|
64
|
+
'>': '>',
|
|
65
|
+
'"': '"',
|
|
66
|
+
"'": '''
|
|
67
|
+
};
|
|
68
|
+
const getEscapeReplacement = (ch) => escapeReplacements[ch];
|
|
69
|
+
function escape(html, encode) {
|
|
70
|
+
if (encode) {
|
|
71
|
+
if (escapeTest.test(html)) {
|
|
72
|
+
return html.replace(escapeReplace, getEscapeReplacement);
|
|
73
|
+
}
|
|
74
|
+
} else {
|
|
75
|
+
if (escapeTestNoEncode.test(html)) {
|
|
76
|
+
return html.replace(escapeReplaceNoEncode, getEscapeReplacement);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return html;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const unescapeTest = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;
|
|
84
|
+
|
|
85
|
+
function unescape(html) {
|
|
86
|
+
// explicitly match decimal, hex, and named HTML entities
|
|
87
|
+
return html.replace(unescapeTest, (_, n) => {
|
|
88
|
+
n = n.toLowerCase();
|
|
89
|
+
if (n === 'colon') return ':';
|
|
90
|
+
if (n.charAt(0) === '#') {
|
|
91
|
+
return n.charAt(1) === 'x'
|
|
92
|
+
? String.fromCharCode(parseInt(n.substring(2), 16))
|
|
93
|
+
: String.fromCharCode(+n.substring(1));
|
|
94
|
+
}
|
|
95
|
+
return '';
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const caret = /(^|[^\[])\^/g;
|
|
100
|
+
function edit(regex, opt) {
|
|
101
|
+
regex = regex.source || regex;
|
|
102
|
+
opt = opt || '';
|
|
103
|
+
const obj = {
|
|
104
|
+
replace: (name, val) => {
|
|
105
|
+
val = val.source || val;
|
|
106
|
+
val = val.replace(caret, '$1');
|
|
107
|
+
regex = regex.replace(name, val);
|
|
108
|
+
return obj;
|
|
109
|
+
},
|
|
110
|
+
getRegex: () => {
|
|
111
|
+
return new RegExp(regex, opt);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
return obj;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const nonWordAndColonTest = /[^\w:]/g;
|
|
118
|
+
const originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;
|
|
119
|
+
function cleanUrl(sanitize, base, href) {
|
|
120
|
+
if (sanitize) {
|
|
121
|
+
let prot;
|
|
122
|
+
try {
|
|
123
|
+
prot = decodeURIComponent(unescape(href))
|
|
124
|
+
.replace(nonWordAndColonTest, '')
|
|
125
|
+
.toLowerCase();
|
|
126
|
+
} catch (e) {
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) {
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
if (base && !originIndependentUrl.test(href)) {
|
|
134
|
+
href = resolveUrl(base, href);
|
|
135
|
+
}
|
|
136
|
+
try {
|
|
137
|
+
href = encodeURI(href).replace(/%25/g, '%');
|
|
138
|
+
} catch (e) {
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
return href;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const baseUrls = {};
|
|
145
|
+
const justDomain = /^[^:]+:\/*[^/]*$/;
|
|
146
|
+
const protocol = /^([^:]+:)[\s\S]*$/;
|
|
147
|
+
const domain = /^([^:]+:\/*[^/]*)[\s\S]*$/;
|
|
148
|
+
|
|
149
|
+
function resolveUrl(base, href) {
|
|
150
|
+
if (!baseUrls[' ' + base]) {
|
|
151
|
+
// we can ignore everything in base after the last slash of its path component,
|
|
152
|
+
// but we might need to add _that_
|
|
153
|
+
// https://tools.ietf.org/html/rfc3986#section-3
|
|
154
|
+
if (justDomain.test(base)) {
|
|
155
|
+
baseUrls[' ' + base] = base + '/';
|
|
156
|
+
} else {
|
|
157
|
+
baseUrls[' ' + base] = rtrim(base, '/', true);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
base = baseUrls[' ' + base];
|
|
161
|
+
const relativeBase = base.indexOf(':') === -1;
|
|
162
|
+
|
|
163
|
+
if (href.substring(0, 2) === '//') {
|
|
164
|
+
if (relativeBase) {
|
|
165
|
+
return href;
|
|
166
|
+
}
|
|
167
|
+
return base.replace(protocol, '$1') + href;
|
|
168
|
+
} else if (href.charAt(0) === '/') {
|
|
169
|
+
if (relativeBase) {
|
|
170
|
+
return href;
|
|
171
|
+
}
|
|
172
|
+
return base.replace(domain, '$1') + href;
|
|
173
|
+
} else {
|
|
174
|
+
return base + href;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
const noopTest = { exec: function noopTest() {} };
|
|
179
|
+
|
|
180
|
+
function merge(obj) {
|
|
181
|
+
let i = 1,
|
|
182
|
+
target,
|
|
183
|
+
key;
|
|
184
|
+
|
|
185
|
+
for (; i < arguments.length; i++) {
|
|
186
|
+
target = arguments[i];
|
|
187
|
+
for (key in target) {
|
|
188
|
+
if (Object.prototype.hasOwnProperty.call(target, key)) {
|
|
189
|
+
obj[key] = target[key];
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
return obj;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function splitCells(tableRow, count) {
|
|
198
|
+
// ensure that every cell-delimiting pipe has a space
|
|
199
|
+
// before it to distinguish it from an escaped pipe
|
|
200
|
+
const row = tableRow.replace(/\|/g, (match, offset, str) => {
|
|
201
|
+
let escaped = false,
|
|
202
|
+
curr = offset;
|
|
203
|
+
while (--curr >= 0 && str[curr] === '\\') escaped = !escaped;
|
|
204
|
+
if (escaped) {
|
|
205
|
+
// odd number of slashes means | is escaped
|
|
206
|
+
// so we leave it alone
|
|
207
|
+
return '|';
|
|
208
|
+
} else {
|
|
209
|
+
// add space before unescaped |
|
|
210
|
+
return ' |';
|
|
211
|
+
}
|
|
212
|
+
}),
|
|
213
|
+
cells = row.split(/ \|/);
|
|
214
|
+
let i = 0;
|
|
215
|
+
|
|
216
|
+
if (cells.length > count) {
|
|
217
|
+
cells.splice(count);
|
|
218
|
+
} else {
|
|
219
|
+
while (cells.length < count) cells.push('');
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
for (; i < cells.length; i++) {
|
|
223
|
+
// leading or trailing whitespace is ignored per the gfm spec
|
|
224
|
+
cells[i] = cells[i].trim().replace(/\\\|/g, '|');
|
|
225
|
+
}
|
|
226
|
+
return cells;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').
|
|
230
|
+
// /c*$/ is vulnerable to REDOS.
|
|
231
|
+
// invert: Remove suffix of non-c chars instead. Default falsey.
|
|
232
|
+
function rtrim(str, c, invert) {
|
|
233
|
+
const l = str.length;
|
|
234
|
+
if (l === 0) {
|
|
235
|
+
return '';
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// Length of suffix matching the invert condition.
|
|
239
|
+
let suffLen = 0;
|
|
240
|
+
|
|
241
|
+
// Step left until we fail to match the invert condition.
|
|
242
|
+
while (suffLen < l) {
|
|
243
|
+
const currChar = str.charAt(l - suffLen - 1);
|
|
244
|
+
if (currChar === c && !invert) {
|
|
245
|
+
suffLen++;
|
|
246
|
+
} else if (currChar !== c && invert) {
|
|
247
|
+
suffLen++;
|
|
248
|
+
} else {
|
|
249
|
+
break;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
return str.substr(0, l - suffLen);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
function findClosingBracket(str, b) {
|
|
257
|
+
if (str.indexOf(b[1]) === -1) {
|
|
258
|
+
return -1;
|
|
259
|
+
}
|
|
260
|
+
const l = str.length;
|
|
261
|
+
let level = 0,
|
|
262
|
+
i = 0;
|
|
263
|
+
for (; i < l; i++) {
|
|
264
|
+
if (str[i] === '\\') {
|
|
265
|
+
i++;
|
|
266
|
+
} else if (str[i] === b[0]) {
|
|
267
|
+
level++;
|
|
268
|
+
} else if (str[i] === b[1]) {
|
|
269
|
+
level--;
|
|
270
|
+
if (level < 0) {
|
|
271
|
+
return i;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
return -1;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
function checkSanitizeDeprecation(opt) {
|
|
279
|
+
if (opt && opt.sanitize && !opt.silent) {
|
|
280
|
+
console.warn('marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options');
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
// copied from https://stackoverflow.com/a/5450113/806777
|
|
285
|
+
function repeatString(pattern, count) {
|
|
286
|
+
if (count < 1) {
|
|
287
|
+
return '';
|
|
288
|
+
}
|
|
289
|
+
let result = '';
|
|
290
|
+
while (count > 1) {
|
|
291
|
+
if (count & 1) {
|
|
292
|
+
result += pattern;
|
|
293
|
+
}
|
|
294
|
+
count >>= 1;
|
|
295
|
+
pattern += pattern;
|
|
296
|
+
}
|
|
297
|
+
return result + pattern;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
var helpers = {
|
|
301
|
+
escape,
|
|
302
|
+
unescape,
|
|
303
|
+
edit,
|
|
304
|
+
cleanUrl,
|
|
305
|
+
resolveUrl,
|
|
306
|
+
noopTest,
|
|
307
|
+
merge,
|
|
308
|
+
splitCells,
|
|
309
|
+
rtrim,
|
|
310
|
+
findClosingBracket,
|
|
311
|
+
checkSanitizeDeprecation,
|
|
312
|
+
repeatString
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
const { defaults: defaults$1 } = defaults;
|
|
316
|
+
const {
|
|
317
|
+
rtrim: rtrim$1,
|
|
318
|
+
splitCells: splitCells$1,
|
|
319
|
+
escape: escape$1,
|
|
320
|
+
findClosingBracket: findClosingBracket$1
|
|
321
|
+
} = helpers;
|
|
322
|
+
|
|
323
|
+
function outputLink(cap, link, raw) {
|
|
324
|
+
const href = link.href;
|
|
325
|
+
const title = link.title ? escape$1(link.title) : null;
|
|
326
|
+
const text = cap[1].replace(/\\([\[\]])/g, '$1');
|
|
327
|
+
|
|
328
|
+
if (cap[0].charAt(0) !== '!') {
|
|
329
|
+
return {
|
|
330
|
+
type: 'link',
|
|
331
|
+
raw,
|
|
332
|
+
href,
|
|
333
|
+
title,
|
|
334
|
+
text
|
|
335
|
+
};
|
|
336
|
+
} else {
|
|
337
|
+
return {
|
|
338
|
+
type: 'image',
|
|
339
|
+
raw,
|
|
340
|
+
href,
|
|
341
|
+
title,
|
|
342
|
+
text: escape$1(text)
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
function indentCodeCompensation(raw, text) {
|
|
348
|
+
const matchIndentToCode = raw.match(/^(\s+)(?:```)/);
|
|
349
|
+
|
|
350
|
+
if (matchIndentToCode === null) {
|
|
351
|
+
return text;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
const indentToCode = matchIndentToCode[1];
|
|
355
|
+
|
|
356
|
+
return text
|
|
357
|
+
.split('\n')
|
|
358
|
+
.map(node => {
|
|
359
|
+
const matchIndentInNode = node.match(/^\s+/);
|
|
360
|
+
if (matchIndentInNode === null) {
|
|
361
|
+
return node;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
const [indentInNode] = matchIndentInNode;
|
|
365
|
+
|
|
366
|
+
if (indentInNode.length >= indentToCode.length) {
|
|
367
|
+
return node.slice(indentToCode.length);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
return node;
|
|
371
|
+
})
|
|
372
|
+
.join('\n');
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Tokenizer
|
|
377
|
+
*/
|
|
378
|
+
var Tokenizer_1 = class Tokenizer {
|
|
379
|
+
constructor(options) {
|
|
380
|
+
this.options = options || defaults$1;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
space(src) {
|
|
384
|
+
const cap = this.rules.block.newline.exec(src);
|
|
385
|
+
if (cap) {
|
|
386
|
+
if (cap[0].length > 1) {
|
|
387
|
+
return {
|
|
388
|
+
type: 'space',
|
|
389
|
+
raw: cap[0]
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
return { raw: '\n' };
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
code(src, tokens) {
|
|
397
|
+
const cap = this.rules.block.code.exec(src);
|
|
398
|
+
if (cap) {
|
|
399
|
+
const lastToken = tokens[tokens.length - 1];
|
|
400
|
+
// An indented code block cannot interrupt a paragraph.
|
|
401
|
+
if (lastToken && lastToken.type === 'paragraph') {
|
|
402
|
+
return {
|
|
403
|
+
raw: cap[0],
|
|
404
|
+
text: cap[0].trimRight()
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
const text = cap[0].replace(/^ {4}/gm, '');
|
|
409
|
+
return {
|
|
410
|
+
type: 'code',
|
|
411
|
+
raw: cap[0],
|
|
412
|
+
codeBlockStyle: 'indented',
|
|
413
|
+
text: !this.options.pedantic
|
|
414
|
+
? rtrim$1(text, '\n')
|
|
415
|
+
: text
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
fences(src) {
|
|
421
|
+
const cap = this.rules.block.fences.exec(src);
|
|
422
|
+
if (cap) {
|
|
423
|
+
const raw = cap[0];
|
|
424
|
+
const text = indentCodeCompensation(raw, cap[3] || '');
|
|
425
|
+
|
|
426
|
+
return {
|
|
427
|
+
type: 'code',
|
|
428
|
+
raw,
|
|
429
|
+
lang: cap[2] ? cap[2].trim() : cap[2],
|
|
430
|
+
text
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
heading(src) {
|
|
436
|
+
const cap = this.rules.block.heading.exec(src);
|
|
437
|
+
if (cap) {
|
|
438
|
+
return {
|
|
439
|
+
type: 'heading',
|
|
440
|
+
raw: cap[0],
|
|
441
|
+
depth: cap[1].length,
|
|
442
|
+
text: cap[2]
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
nptable(src) {
|
|
448
|
+
const cap = this.rules.block.nptable.exec(src);
|
|
449
|
+
if (cap) {
|
|
450
|
+
const item = {
|
|
451
|
+
type: 'table',
|
|
452
|
+
header: splitCells$1(cap[1].replace(/^ *| *\| *$/g, '')),
|
|
453
|
+
align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
|
|
454
|
+
cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : [],
|
|
455
|
+
raw: cap[0]
|
|
456
|
+
};
|
|
457
|
+
|
|
458
|
+
if (item.header.length === item.align.length) {
|
|
459
|
+
let l = item.align.length;
|
|
460
|
+
let i;
|
|
461
|
+
for (i = 0; i < l; i++) {
|
|
462
|
+
if (/^ *-+: *$/.test(item.align[i])) {
|
|
463
|
+
item.align[i] = 'right';
|
|
464
|
+
} else if (/^ *:-+: *$/.test(item.align[i])) {
|
|
465
|
+
item.align[i] = 'center';
|
|
466
|
+
} else if (/^ *:-+ *$/.test(item.align[i])) {
|
|
467
|
+
item.align[i] = 'left';
|
|
468
|
+
} else {
|
|
469
|
+
item.align[i] = null;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
l = item.cells.length;
|
|
474
|
+
for (i = 0; i < l; i++) {
|
|
475
|
+
item.cells[i] = splitCells$1(item.cells[i], item.header.length);
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
return item;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
hr(src) {
|
|
484
|
+
const cap = this.rules.block.hr.exec(src);
|
|
485
|
+
if (cap) {
|
|
486
|
+
return {
|
|
487
|
+
type: 'hr',
|
|
488
|
+
raw: cap[0]
|
|
489
|
+
};
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
blockquote(src) {
|
|
494
|
+
const cap = this.rules.block.blockquote.exec(src);
|
|
495
|
+
if (cap) {
|
|
496
|
+
const text = cap[0].replace(/^ *> ?/gm, '');
|
|
497
|
+
|
|
498
|
+
return {
|
|
499
|
+
type: 'blockquote',
|
|
500
|
+
raw: cap[0],
|
|
501
|
+
text
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
list(src) {
|
|
507
|
+
const cap = this.rules.block.list.exec(src);
|
|
508
|
+
if (cap) {
|
|
509
|
+
let raw = cap[0];
|
|
510
|
+
const bull = cap[2];
|
|
511
|
+
const isordered = bull.length > 1;
|
|
512
|
+
|
|
513
|
+
const list = {
|
|
514
|
+
type: 'list',
|
|
515
|
+
raw,
|
|
516
|
+
ordered: isordered,
|
|
517
|
+
start: isordered ? +bull.slice(0, -1) : '',
|
|
518
|
+
loose: false,
|
|
519
|
+
items: []
|
|
520
|
+
};
|
|
521
|
+
|
|
522
|
+
// Get each top-level item.
|
|
523
|
+
const itemMatch = cap[0].match(this.rules.block.item);
|
|
524
|
+
|
|
525
|
+
let next = false,
|
|
526
|
+
item,
|
|
527
|
+
space,
|
|
528
|
+
bcurr,
|
|
529
|
+
bnext,
|
|
530
|
+
addBack,
|
|
531
|
+
loose,
|
|
532
|
+
istask,
|
|
533
|
+
ischecked;
|
|
534
|
+
|
|
535
|
+
let l = itemMatch.length;
|
|
536
|
+
bcurr = this.rules.block.listItemStart.exec(itemMatch[0]);
|
|
537
|
+
for (let i = 0; i < l; i++) {
|
|
538
|
+
item = itemMatch[i];
|
|
539
|
+
raw = item;
|
|
540
|
+
|
|
541
|
+
// Determine whether the next list item belongs here.
|
|
542
|
+
// Backpedal if it does not belong in this list.
|
|
543
|
+
if (i !== l - 1) {
|
|
544
|
+
bnext = this.rules.block.listItemStart.exec(itemMatch[i + 1]);
|
|
545
|
+
|
|
546
|
+
if (bnext[1].length > bcurr[0].length || bnext[1].length > 3) {
|
|
547
|
+
// nested list
|
|
548
|
+
itemMatch.splice(i, 2, itemMatch[i] + '\n' + itemMatch[i + 1]);
|
|
549
|
+
i--;
|
|
550
|
+
l--;
|
|
551
|
+
continue;
|
|
552
|
+
} else {
|
|
553
|
+
if (
|
|
554
|
+
// different bullet style
|
|
555
|
+
!this.options.pedantic || this.options.smartLists
|
|
556
|
+
? bnext[2][bnext[2].length - 1] !== bull[bull.length - 1]
|
|
557
|
+
: isordered === (bnext[2].length === 1)
|
|
558
|
+
) {
|
|
559
|
+
addBack = itemMatch.slice(i + 1).join('\n');
|
|
560
|
+
list.raw = list.raw.substring(0, list.raw.length - addBack.length);
|
|
561
|
+
i = l - 1;
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
bcurr = bnext;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
// Remove the list item's bullet
|
|
568
|
+
// so it is seen as the next token.
|
|
569
|
+
space = item.length;
|
|
570
|
+
item = item.replace(/^ *([*+-]|\d+[.)]) ?/, '');
|
|
571
|
+
|
|
572
|
+
// Outdent whatever the
|
|
573
|
+
// list item contains. Hacky.
|
|
574
|
+
if (~item.indexOf('\n ')) {
|
|
575
|
+
space -= item.length;
|
|
576
|
+
item = !this.options.pedantic
|
|
577
|
+
? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '')
|
|
578
|
+
: item.replace(/^ {1,4}/gm, '');
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
// Determine whether item is loose or not.
|
|
582
|
+
// Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/
|
|
583
|
+
// for discount behavior.
|
|
584
|
+
loose = next || /\n\n(?!\s*$)/.test(item);
|
|
585
|
+
if (i !== l - 1) {
|
|
586
|
+
next = item.charAt(item.length - 1) === '\n';
|
|
587
|
+
if (!loose) loose = next;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
if (loose) {
|
|
591
|
+
list.loose = true;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
// Check for task list items
|
|
595
|
+
if (this.options.gfm) {
|
|
596
|
+
istask = /^\[[ xX]\] /.test(item);
|
|
597
|
+
ischecked = undefined;
|
|
598
|
+
if (istask) {
|
|
599
|
+
ischecked = item[1] !== ' ';
|
|
600
|
+
item = item.replace(/^\[[ xX]\] +/, '');
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
list.items.push({
|
|
605
|
+
type: 'list_item',
|
|
606
|
+
raw,
|
|
607
|
+
task: istask,
|
|
608
|
+
checked: ischecked,
|
|
609
|
+
loose: loose,
|
|
610
|
+
text: item
|
|
611
|
+
});
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
return list;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
html(src) {
|
|
619
|
+
const cap = this.rules.block.html.exec(src);
|
|
620
|
+
if (cap) {
|
|
621
|
+
return {
|
|
622
|
+
type: this.options.sanitize
|
|
623
|
+
? 'paragraph'
|
|
624
|
+
: 'html',
|
|
625
|
+
raw: cap[0],
|
|
626
|
+
pre: !this.options.sanitizer
|
|
627
|
+
&& (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),
|
|
628
|
+
text: this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape$1(cap[0])) : cap[0]
|
|
629
|
+
};
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
def(src) {
|
|
634
|
+
const cap = this.rules.block.def.exec(src);
|
|
635
|
+
if (cap) {
|
|
636
|
+
if (cap[3]) cap[3] = cap[3].substring(1, cap[3].length - 1);
|
|
637
|
+
const tag = cap[1].toLowerCase().replace(/\s+/g, ' ');
|
|
638
|
+
return {
|
|
639
|
+
tag,
|
|
640
|
+
raw: cap[0],
|
|
641
|
+
href: cap[2],
|
|
642
|
+
title: cap[3]
|
|
643
|
+
};
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
table(src) {
|
|
648
|
+
const cap = this.rules.block.table.exec(src);
|
|
649
|
+
if (cap) {
|
|
650
|
+
const item = {
|
|
651
|
+
type: 'table',
|
|
652
|
+
header: splitCells$1(cap[1].replace(/^ *| *\| *$/g, '')),
|
|
653
|
+
align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
|
|
654
|
+
cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : []
|
|
655
|
+
};
|
|
656
|
+
|
|
657
|
+
if (item.header.length === item.align.length) {
|
|
658
|
+
item.raw = cap[0];
|
|
659
|
+
|
|
660
|
+
let l = item.align.length;
|
|
661
|
+
let i;
|
|
662
|
+
for (i = 0; i < l; i++) {
|
|
663
|
+
if (/^ *-+: *$/.test(item.align[i])) {
|
|
664
|
+
item.align[i] = 'right';
|
|
665
|
+
} else if (/^ *:-+: *$/.test(item.align[i])) {
|
|
666
|
+
item.align[i] = 'center';
|
|
667
|
+
} else if (/^ *:-+ *$/.test(item.align[i])) {
|
|
668
|
+
item.align[i] = 'left';
|
|
669
|
+
} else {
|
|
670
|
+
item.align[i] = null;
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
l = item.cells.length;
|
|
675
|
+
for (i = 0; i < l; i++) {
|
|
676
|
+
item.cells[i] = splitCells$1(
|
|
677
|
+
item.cells[i].replace(/^ *\| *| *\| *$/g, ''),
|
|
678
|
+
item.header.length);
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
return item;
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
lheading(src) {
|
|
687
|
+
const cap = this.rules.block.lheading.exec(src);
|
|
688
|
+
if (cap) {
|
|
689
|
+
return {
|
|
690
|
+
type: 'heading',
|
|
691
|
+
raw: cap[0],
|
|
692
|
+
depth: cap[2].charAt(0) === '=' ? 1 : 2,
|
|
693
|
+
text: cap[1]
|
|
694
|
+
};
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
paragraph(src) {
|
|
699
|
+
const cap = this.rules.block.paragraph.exec(src);
|
|
700
|
+
if (cap) {
|
|
701
|
+
return {
|
|
702
|
+
type: 'paragraph',
|
|
703
|
+
raw: cap[0],
|
|
704
|
+
text: cap[1].charAt(cap[1].length - 1) === '\n'
|
|
705
|
+
? cap[1].slice(0, -1)
|
|
706
|
+
: cap[1]
|
|
707
|
+
};
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
text(src, tokens) {
|
|
712
|
+
const cap = this.rules.block.text.exec(src);
|
|
713
|
+
if (cap) {
|
|
714
|
+
const lastToken = tokens[tokens.length - 1];
|
|
715
|
+
if (lastToken && lastToken.type === 'text') {
|
|
716
|
+
return {
|
|
717
|
+
raw: cap[0],
|
|
718
|
+
text: cap[0]
|
|
719
|
+
};
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
return {
|
|
723
|
+
type: 'text',
|
|
724
|
+
raw: cap[0],
|
|
725
|
+
text: cap[0]
|
|
726
|
+
};
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
escape(src) {
|
|
731
|
+
const cap = this.rules.inline.escape.exec(src);
|
|
732
|
+
if (cap) {
|
|
733
|
+
return {
|
|
734
|
+
type: 'escape',
|
|
735
|
+
raw: cap[0],
|
|
736
|
+
text: escape$1(cap[1])
|
|
737
|
+
};
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
tag(src, inLink, inRawBlock) {
|
|
742
|
+
const cap = this.rules.inline.tag.exec(src);
|
|
743
|
+
if (cap) {
|
|
744
|
+
if (!inLink && /^<a /i.test(cap[0])) {
|
|
745
|
+
inLink = true;
|
|
746
|
+
} else if (inLink && /^<\/a>/i.test(cap[0])) {
|
|
747
|
+
inLink = false;
|
|
748
|
+
}
|
|
749
|
+
if (!inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) {
|
|
750
|
+
inRawBlock = true;
|
|
751
|
+
} else if (inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) {
|
|
752
|
+
inRawBlock = false;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
return {
|
|
756
|
+
type: this.options.sanitize
|
|
757
|
+
? 'text'
|
|
758
|
+
: 'html',
|
|
759
|
+
raw: cap[0],
|
|
760
|
+
inLink,
|
|
761
|
+
inRawBlock,
|
|
762
|
+
text: this.options.sanitize
|
|
763
|
+
? (this.options.sanitizer
|
|
764
|
+
? this.options.sanitizer(cap[0])
|
|
765
|
+
: escape$1(cap[0]))
|
|
766
|
+
: cap[0]
|
|
767
|
+
};
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
link(src) {
|
|
772
|
+
const cap = this.rules.inline.link.exec(src);
|
|
773
|
+
if (cap) {
|
|
774
|
+
const lastParenIndex = findClosingBracket$1(cap[2], '()');
|
|
775
|
+
if (lastParenIndex > -1) {
|
|
776
|
+
const start = cap[0].indexOf('!') === 0 ? 5 : 4;
|
|
777
|
+
const linkLen = start + cap[1].length + lastParenIndex;
|
|
778
|
+
cap[2] = cap[2].substring(0, lastParenIndex);
|
|
779
|
+
cap[0] = cap[0].substring(0, linkLen).trim();
|
|
780
|
+
cap[3] = '';
|
|
781
|
+
}
|
|
782
|
+
let href = cap[2];
|
|
783
|
+
let title = '';
|
|
784
|
+
if (this.options.pedantic) {
|
|
785
|
+
const link = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href);
|
|
786
|
+
|
|
787
|
+
if (link) {
|
|
788
|
+
href = link[1];
|
|
789
|
+
title = link[3];
|
|
790
|
+
} else {
|
|
791
|
+
title = '';
|
|
792
|
+
}
|
|
793
|
+
} else {
|
|
794
|
+
title = cap[3] ? cap[3].slice(1, -1) : '';
|
|
795
|
+
}
|
|
796
|
+
href = href.trim().replace(/^<([\s\S]*)>$/, '$1');
|
|
797
|
+
const token = outputLink(cap, {
|
|
798
|
+
href: href ? href.replace(this.rules.inline._escapes, '$1') : href,
|
|
799
|
+
title: title ? title.replace(this.rules.inline._escapes, '$1') : title
|
|
800
|
+
}, cap[0]);
|
|
801
|
+
return token;
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
reflink(src, links) {
|
|
806
|
+
let cap;
|
|
807
|
+
if ((cap = this.rules.inline.reflink.exec(src))
|
|
808
|
+
|| (cap = this.rules.inline.nolink.exec(src))) {
|
|
809
|
+
let link = (cap[2] || cap[1]).replace(/\s+/g, ' ');
|
|
810
|
+
link = links[link.toLowerCase()];
|
|
811
|
+
if (!link || !link.href) {
|
|
812
|
+
const text = cap[0].charAt(0);
|
|
813
|
+
return {
|
|
814
|
+
type: 'text',
|
|
815
|
+
raw: text,
|
|
816
|
+
text
|
|
817
|
+
};
|
|
818
|
+
}
|
|
819
|
+
const token = outputLink(cap, link, cap[0]);
|
|
820
|
+
return token;
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
strong(src, maskedSrc, prevChar = '') {
|
|
825
|
+
let match = this.rules.inline.strong.start.exec(src);
|
|
826
|
+
|
|
827
|
+
if (match && (!match[1] || (match[1] && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar))))) {
|
|
828
|
+
maskedSrc = maskedSrc.slice(-1 * src.length);
|
|
829
|
+
const endReg = match[0] === '**' ? this.rules.inline.strong.endAst : this.rules.inline.strong.endUnd;
|
|
830
|
+
|
|
831
|
+
endReg.lastIndex = 0;
|
|
832
|
+
|
|
833
|
+
let cap;
|
|
834
|
+
while ((match = endReg.exec(maskedSrc)) != null) {
|
|
835
|
+
cap = this.rules.inline.strong.middle.exec(maskedSrc.slice(0, match.index + 3));
|
|
836
|
+
if (cap) {
|
|
837
|
+
return {
|
|
838
|
+
type: 'strong',
|
|
839
|
+
raw: src.slice(0, cap[0].length),
|
|
840
|
+
text: src.slice(2, cap[0].length - 2)
|
|
841
|
+
};
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
em(src, maskedSrc, prevChar = '') {
|
|
848
|
+
let match = this.rules.inline.em.start.exec(src);
|
|
849
|
+
|
|
850
|
+
if (match && (!match[1] || (match[1] && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar))))) {
|
|
851
|
+
maskedSrc = maskedSrc.slice(-1 * src.length);
|
|
852
|
+
const endReg = match[0] === '*' ? this.rules.inline.em.endAst : this.rules.inline.em.endUnd;
|
|
853
|
+
|
|
854
|
+
endReg.lastIndex = 0;
|
|
855
|
+
|
|
856
|
+
let cap;
|
|
857
|
+
while ((match = endReg.exec(maskedSrc)) != null) {
|
|
858
|
+
cap = this.rules.inline.em.middle.exec(maskedSrc.slice(0, match.index + 2));
|
|
859
|
+
if (cap) {
|
|
860
|
+
return {
|
|
861
|
+
type: 'em',
|
|
862
|
+
raw: src.slice(0, cap[0].length),
|
|
863
|
+
text: src.slice(1, cap[0].length - 1)
|
|
864
|
+
};
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
codespan(src) {
|
|
871
|
+
const cap = this.rules.inline.code.exec(src);
|
|
872
|
+
if (cap) {
|
|
873
|
+
let text = cap[2].replace(/\n/g, ' ');
|
|
874
|
+
const hasNonSpaceChars = /[^ ]/.test(text);
|
|
875
|
+
const hasSpaceCharsOnBothEnds = text.startsWith(' ') && text.endsWith(' ');
|
|
876
|
+
if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {
|
|
877
|
+
text = text.substring(1, text.length - 1);
|
|
878
|
+
}
|
|
879
|
+
text = escape$1(text, true);
|
|
880
|
+
return {
|
|
881
|
+
type: 'codespan',
|
|
882
|
+
raw: cap[0],
|
|
883
|
+
text
|
|
884
|
+
};
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
br(src) {
|
|
889
|
+
const cap = this.rules.inline.br.exec(src);
|
|
890
|
+
if (cap) {
|
|
891
|
+
return {
|
|
892
|
+
type: 'br',
|
|
893
|
+
raw: cap[0]
|
|
894
|
+
};
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
del(src) {
|
|
899
|
+
const cap = this.rules.inline.del.exec(src);
|
|
900
|
+
if (cap) {
|
|
901
|
+
return {
|
|
902
|
+
type: 'del',
|
|
903
|
+
raw: cap[0],
|
|
904
|
+
text: cap[2]
|
|
905
|
+
};
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
autolink(src, mangle) {
|
|
910
|
+
const cap = this.rules.inline.autolink.exec(src);
|
|
911
|
+
if (cap) {
|
|
912
|
+
let text, href;
|
|
913
|
+
if (cap[2] === '@') {
|
|
914
|
+
text = escape$1(this.options.mangle ? mangle(cap[1]) : cap[1]);
|
|
915
|
+
href = 'mailto:' + text;
|
|
916
|
+
} else {
|
|
917
|
+
text = escape$1(cap[1]);
|
|
918
|
+
href = text;
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
return {
|
|
922
|
+
type: 'link',
|
|
923
|
+
raw: cap[0],
|
|
924
|
+
text,
|
|
925
|
+
href,
|
|
926
|
+
tokens: [
|
|
927
|
+
{
|
|
928
|
+
type: 'text',
|
|
929
|
+
raw: text,
|
|
930
|
+
text
|
|
931
|
+
}
|
|
932
|
+
]
|
|
933
|
+
};
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
url(src, mangle) {
|
|
938
|
+
let cap;
|
|
939
|
+
if (cap = this.rules.inline.url.exec(src)) {
|
|
940
|
+
let text, href;
|
|
941
|
+
if (cap[2] === '@') {
|
|
942
|
+
text = escape$1(this.options.mangle ? mangle(cap[0]) : cap[0]);
|
|
943
|
+
href = 'mailto:' + text;
|
|
944
|
+
} else {
|
|
945
|
+
// do extended autolink path validation
|
|
946
|
+
let prevCapZero;
|
|
947
|
+
do {
|
|
948
|
+
prevCapZero = cap[0];
|
|
949
|
+
cap[0] = this.rules.inline._backpedal.exec(cap[0])[0];
|
|
950
|
+
} while (prevCapZero !== cap[0]);
|
|
951
|
+
text = escape$1(cap[0]);
|
|
952
|
+
if (cap[1] === 'www.') {
|
|
953
|
+
href = 'http://' + text;
|
|
954
|
+
} else {
|
|
955
|
+
href = text;
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
return {
|
|
959
|
+
type: 'link',
|
|
960
|
+
raw: cap[0],
|
|
961
|
+
text,
|
|
962
|
+
href,
|
|
963
|
+
tokens: [
|
|
964
|
+
{
|
|
965
|
+
type: 'text',
|
|
966
|
+
raw: text,
|
|
967
|
+
text
|
|
968
|
+
}
|
|
969
|
+
]
|
|
970
|
+
};
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
inlineText(src, inRawBlock, smartypants) {
|
|
975
|
+
const cap = this.rules.inline.text.exec(src);
|
|
976
|
+
if (cap) {
|
|
977
|
+
let text;
|
|
978
|
+
if (inRawBlock) {
|
|
979
|
+
text = this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape$1(cap[0])) : cap[0];
|
|
980
|
+
} else {
|
|
981
|
+
text = escape$1(this.options.smartypants ? smartypants(cap[0]) : cap[0]);
|
|
982
|
+
}
|
|
983
|
+
return {
|
|
984
|
+
type: 'text',
|
|
985
|
+
raw: cap[0],
|
|
986
|
+
text
|
|
987
|
+
};
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
};
|
|
991
|
+
|
|
992
|
+
const {
|
|
993
|
+
noopTest: noopTest$1,
|
|
994
|
+
edit: edit$1,
|
|
995
|
+
merge: merge$1
|
|
996
|
+
} = helpers;
|
|
997
|
+
|
|
998
|
+
/**
|
|
999
|
+
* Block-Level Grammar
|
|
1000
|
+
*/
|
|
1001
|
+
const block = {
|
|
1002
|
+
newline: /^\n+/,
|
|
1003
|
+
code: /^( {4}[^\n]+\n*)+/,
|
|
1004
|
+
fences: /^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,
|
|
1005
|
+
hr: /^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,
|
|
1006
|
+
heading: /^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,
|
|
1007
|
+
blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,
|
|
1008
|
+
list: /^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,
|
|
1009
|
+
html: '^ {0,3}(?:' // optional indentation
|
|
1010
|
+
+ '<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)' // (1)
|
|
1011
|
+
+ '|comment[^\\n]*(\\n+|$)' // (2)
|
|
1012
|
+
+ '|<\\?[\\s\\S]*?(?:\\?>\\n*|$)' // (3)
|
|
1013
|
+
+ '|<![A-Z][\\s\\S]*?(?:>\\n*|$)' // (4)
|
|
1014
|
+
+ '|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)' // (5)
|
|
1015
|
+
+ '|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)' // (6)
|
|
1016
|
+
+ '|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)' // (7) open tag
|
|
1017
|
+
+ '|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)' // (7) closing tag
|
|
1018
|
+
+ ')',
|
|
1019
|
+
def: /^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,
|
|
1020
|
+
nptable: noopTest$1,
|
|
1021
|
+
table: noopTest$1,
|
|
1022
|
+
lheading: /^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
1023
|
+
// regex template, placeholders will be replaced according to different paragraph
|
|
1024
|
+
// interruption rules of commonmark and the original markdown spec:
|
|
1025
|
+
_paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,
|
|
1026
|
+
text: /^[^\n]+/
|
|
1027
|
+
};
|
|
1028
|
+
|
|
1029
|
+
block._label = /(?!\s*\])(?:\\[\[\]]|[^\[\]])+/;
|
|
1030
|
+
block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;
|
|
1031
|
+
block.def = edit$1(block.def)
|
|
1032
|
+
.replace('label', block._label)
|
|
1033
|
+
.replace('title', block._title)
|
|
1034
|
+
.getRegex();
|
|
1035
|
+
|
|
1036
|
+
block.bullet = /(?:[*+-]|\d{1,9}[.)])/;
|
|
1037
|
+
block.item = /^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/;
|
|
1038
|
+
block.item = edit$1(block.item, 'gm')
|
|
1039
|
+
.replace(/bull/g, block.bullet)
|
|
1040
|
+
.getRegex();
|
|
1041
|
+
|
|
1042
|
+
block.listItemStart = edit$1(/^( *)(bull)/)
|
|
1043
|
+
.replace('bull', block.bullet)
|
|
1044
|
+
.getRegex();
|
|
1045
|
+
|
|
1046
|
+
block.list = edit$1(block.list)
|
|
1047
|
+
.replace(/bull/g, block.bullet)
|
|
1048
|
+
.replace('hr', '\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))')
|
|
1049
|
+
.replace('def', '\\n+(?=' + block.def.source + ')')
|
|
1050
|
+
.getRegex();
|
|
1051
|
+
|
|
1052
|
+
block._tag = 'address|article|aside|base|basefont|blockquote|body|caption'
|
|
1053
|
+
+ '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'
|
|
1054
|
+
+ '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'
|
|
1055
|
+
+ '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'
|
|
1056
|
+
+ '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr'
|
|
1057
|
+
+ '|track|ul';
|
|
1058
|
+
block._comment = /<!--(?!-?>)[\s\S]*?(?:-->|$)/;
|
|
1059
|
+
block.html = edit$1(block.html, 'i')
|
|
1060
|
+
.replace('comment', block._comment)
|
|
1061
|
+
.replace('tag', block._tag)
|
|
1062
|
+
.replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/)
|
|
1063
|
+
.getRegex();
|
|
1064
|
+
|
|
1065
|
+
block.paragraph = edit$1(block._paragraph)
|
|
1066
|
+
.replace('hr', block.hr)
|
|
1067
|
+
.replace('heading', ' {0,3}#{1,6} ')
|
|
1068
|
+
.replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs
|
|
1069
|
+
.replace('blockquote', ' {0,3}>')
|
|
1070
|
+
.replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n')
|
|
1071
|
+
.replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
|
|
1072
|
+
.replace('html', '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)')
|
|
1073
|
+
.replace('tag', block._tag) // pars can be interrupted by type (6) html blocks
|
|
1074
|
+
.getRegex();
|
|
1075
|
+
|
|
1076
|
+
block.blockquote = edit$1(block.blockquote)
|
|
1077
|
+
.replace('paragraph', block.paragraph)
|
|
1078
|
+
.getRegex();
|
|
1079
|
+
|
|
1080
|
+
/**
|
|
1081
|
+
* Normal Block Grammar
|
|
1082
|
+
*/
|
|
1083
|
+
|
|
1084
|
+
block.normal = merge$1({}, block);
|
|
1085
|
+
|
|
1086
|
+
/**
|
|
1087
|
+
* GFM Block Grammar
|
|
1088
|
+
*/
|
|
1089
|
+
|
|
1090
|
+
block.gfm = merge$1({}, block.normal, {
|
|
1091
|
+
nptable: '^ *([^|\\n ].*\\|.*)\\n' // Header
|
|
1092
|
+
+ ' {0,3}([-:]+ *\\|[-| :]*)' // Align
|
|
1093
|
+
+ '(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)', // Cells
|
|
1094
|
+
table: '^ *\\|(.+)\\n' // Header
|
|
1095
|
+
+ ' {0,3}\\|?( *[-:]+[-| :]*)' // Align
|
|
1096
|
+
+ '(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells
|
|
1097
|
+
});
|
|
1098
|
+
|
|
1099
|
+
block.gfm.nptable = edit$1(block.gfm.nptable)
|
|
1100
|
+
.replace('hr', block.hr)
|
|
1101
|
+
.replace('heading', ' {0,3}#{1,6} ')
|
|
1102
|
+
.replace('blockquote', ' {0,3}>')
|
|
1103
|
+
.replace('code', ' {4}[^\\n]')
|
|
1104
|
+
.replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n')
|
|
1105
|
+
.replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
|
|
1106
|
+
.replace('html', '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)')
|
|
1107
|
+
.replace('tag', block._tag) // tables can be interrupted by type (6) html blocks
|
|
1108
|
+
.getRegex();
|
|
1109
|
+
|
|
1110
|
+
block.gfm.table = edit$1(block.gfm.table)
|
|
1111
|
+
.replace('hr', block.hr)
|
|
1112
|
+
.replace('heading', ' {0,3}#{1,6} ')
|
|
1113
|
+
.replace('blockquote', ' {0,3}>')
|
|
1114
|
+
.replace('code', ' {4}[^\\n]')
|
|
1115
|
+
.replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n')
|
|
1116
|
+
.replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
|
|
1117
|
+
.replace('html', '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)')
|
|
1118
|
+
.replace('tag', block._tag) // tables can be interrupted by type (6) html blocks
|
|
1119
|
+
.getRegex();
|
|
1120
|
+
|
|
1121
|
+
/**
|
|
1122
|
+
* Pedantic grammar (original John Gruber's loose markdown specification)
|
|
1123
|
+
*/
|
|
1124
|
+
|
|
1125
|
+
block.pedantic = merge$1({}, block.normal, {
|
|
1126
|
+
html: edit$1(
|
|
1127
|
+
'^ *(?:comment *(?:\\n|\\s*$)'
|
|
1128
|
+
+ '|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)' // closed tag
|
|
1129
|
+
+ '|<tag(?:"[^"]*"|\'[^\']*\'|\\s[^\'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))')
|
|
1130
|
+
.replace('comment', block._comment)
|
|
1131
|
+
.replace(/tag/g, '(?!(?:'
|
|
1132
|
+
+ 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'
|
|
1133
|
+
+ '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'
|
|
1134
|
+
+ '\\b)\\w+(?!:|[^\\w\\s@]*@)\\b')
|
|
1135
|
+
.getRegex(),
|
|
1136
|
+
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
|
|
1137
|
+
heading: /^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,
|
|
1138
|
+
fences: noopTest$1, // fences not supported
|
|
1139
|
+
paragraph: edit$1(block.normal._paragraph)
|
|
1140
|
+
.replace('hr', block.hr)
|
|
1141
|
+
.replace('heading', ' *#{1,6} *[^\n]')
|
|
1142
|
+
.replace('lheading', block.lheading)
|
|
1143
|
+
.replace('blockquote', ' {0,3}>')
|
|
1144
|
+
.replace('|fences', '')
|
|
1145
|
+
.replace('|list', '')
|
|
1146
|
+
.replace('|html', '')
|
|
1147
|
+
.getRegex()
|
|
1148
|
+
});
|
|
1149
|
+
|
|
1150
|
+
/**
|
|
1151
|
+
* Inline-Level Grammar
|
|
1152
|
+
*/
|
|
1153
|
+
const inline = {
|
|
1154
|
+
escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
|
|
1155
|
+
autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/,
|
|
1156
|
+
url: noopTest$1,
|
|
1157
|
+
tag: '^comment'
|
|
1158
|
+
+ '|^</[a-zA-Z][\\w:-]*\\s*>' // self-closing tag
|
|
1159
|
+
+ '|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>' // open tag
|
|
1160
|
+
+ '|^<\\?[\\s\\S]*?\\?>' // processing instruction, e.g. <?php ?>
|
|
1161
|
+
+ '|^<![a-zA-Z]+\\s[\\s\\S]*?>' // declaration, e.g. <!DOCTYPE html>
|
|
1162
|
+
+ '|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>', // CDATA section
|
|
1163
|
+
link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,
|
|
1164
|
+
reflink: /^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,
|
|
1165
|
+
nolink: /^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,
|
|
1166
|
+
reflinkSearch: 'reflink|nolink(?!\\()',
|
|
1167
|
+
strong: {
|
|
1168
|
+
start: /^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/, // (1) returns if starts w/ punctuation
|
|
1169
|
+
middle: /^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,
|
|
1170
|
+
endAst: /[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation_\s]|$))/, // last char can't be punct, or final * must also be followed by punct (or endline)
|
|
1171
|
+
endUnd: /[^\s]__(?!_)(?:(?=[punctuation*\s])|$)/ // last char can't be a space, and final _ must preceed punct or \s (or endline)
|
|
1172
|
+
},
|
|
1173
|
+
em: {
|
|
1174
|
+
start: /^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/, // (1) returns if starts w/ punctuation
|
|
1175
|
+
middle: /^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,
|
|
1176
|
+
endAst: /[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation_\s]|$))/, // last char can't be punct, or final * must also be followed by punct (or endline)
|
|
1177
|
+
endUnd: /[^\s]_(?!_)(?:(?=[punctuation*\s])|$)/ // last char can't be a space, and final _ must preceed punct or \s (or endline)
|
|
1178
|
+
},
|
|
1179
|
+
code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,
|
|
1180
|
+
br: /^( {2,}|\\)\n(?!\s*$)/,
|
|
1181
|
+
del: noopTest$1,
|
|
1182
|
+
text: /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n)))/,
|
|
1183
|
+
punctuation: /^([\s*punctuation])/
|
|
1184
|
+
};
|
|
1185
|
+
|
|
1186
|
+
// list of punctuation marks from common mark spec
|
|
1187
|
+
// without * and _ to workaround cases with double emphasis
|
|
1188
|
+
inline._punctuation = '!"#$%&\'()+\\-.,/:;<=>?@\\[\\]`^{|}~';
|
|
1189
|
+
inline.punctuation = edit$1(inline.punctuation).replace(/punctuation/g, inline._punctuation).getRegex();
|
|
1190
|
+
|
|
1191
|
+
// sequences em should skip over [title](link), `code`, <html>
|
|
1192
|
+
inline._blockSkip = '\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>';
|
|
1193
|
+
inline._overlapSkip = '__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*';
|
|
1194
|
+
|
|
1195
|
+
inline._comment = edit$1(block._comment).replace('(?:-->|$)', '-->').getRegex();
|
|
1196
|
+
|
|
1197
|
+
inline.em.start = edit$1(inline.em.start)
|
|
1198
|
+
.replace(/punctuation/g, inline._punctuation)
|
|
1199
|
+
.getRegex();
|
|
1200
|
+
|
|
1201
|
+
inline.em.middle = edit$1(inline.em.middle)
|
|
1202
|
+
.replace(/punctuation/g, inline._punctuation)
|
|
1203
|
+
.replace(/overlapSkip/g, inline._overlapSkip)
|
|
1204
|
+
.getRegex();
|
|
1205
|
+
|
|
1206
|
+
inline.em.endAst = edit$1(inline.em.endAst, 'g')
|
|
1207
|
+
.replace(/punctuation/g, inline._punctuation)
|
|
1208
|
+
.getRegex();
|
|
1209
|
+
|
|
1210
|
+
inline.em.endUnd = edit$1(inline.em.endUnd, 'g')
|
|
1211
|
+
.replace(/punctuation/g, inline._punctuation)
|
|
1212
|
+
.getRegex();
|
|
1213
|
+
|
|
1214
|
+
inline.strong.start = edit$1(inline.strong.start)
|
|
1215
|
+
.replace(/punctuation/g, inline._punctuation)
|
|
1216
|
+
.getRegex();
|
|
1217
|
+
|
|
1218
|
+
inline.strong.middle = edit$1(inline.strong.middle)
|
|
1219
|
+
.replace(/punctuation/g, inline._punctuation)
|
|
1220
|
+
.replace(/overlapSkip/g, inline._overlapSkip)
|
|
1221
|
+
.getRegex();
|
|
1222
|
+
|
|
1223
|
+
inline.strong.endAst = edit$1(inline.strong.endAst, 'g')
|
|
1224
|
+
.replace(/punctuation/g, inline._punctuation)
|
|
1225
|
+
.getRegex();
|
|
1226
|
+
|
|
1227
|
+
inline.strong.endUnd = edit$1(inline.strong.endUnd, 'g')
|
|
1228
|
+
.replace(/punctuation/g, inline._punctuation)
|
|
1229
|
+
.getRegex();
|
|
1230
|
+
|
|
1231
|
+
inline.blockSkip = edit$1(inline._blockSkip, 'g')
|
|
1232
|
+
.getRegex();
|
|
1233
|
+
|
|
1234
|
+
inline.overlapSkip = edit$1(inline._overlapSkip, 'g')
|
|
1235
|
+
.getRegex();
|
|
1236
|
+
|
|
1237
|
+
inline._escapes = /\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;
|
|
1238
|
+
|
|
1239
|
+
inline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;
|
|
1240
|
+
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])?)+(?![-_])/;
|
|
1241
|
+
inline.autolink = edit$1(inline.autolink)
|
|
1242
|
+
.replace('scheme', inline._scheme)
|
|
1243
|
+
.replace('email', inline._email)
|
|
1244
|
+
.getRegex();
|
|
1245
|
+
|
|
1246
|
+
inline._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;
|
|
1247
|
+
|
|
1248
|
+
inline.tag = edit$1(inline.tag)
|
|
1249
|
+
.replace('comment', inline._comment)
|
|
1250
|
+
.replace('attribute', inline._attribute)
|
|
1251
|
+
.getRegex();
|
|
1252
|
+
|
|
1253
|
+
inline._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
|
|
1254
|
+
inline._href = /<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/;
|
|
1255
|
+
inline._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;
|
|
1256
|
+
|
|
1257
|
+
inline.link = edit$1(inline.link)
|
|
1258
|
+
.replace('label', inline._label)
|
|
1259
|
+
.replace('href', inline._href)
|
|
1260
|
+
.replace('title', inline._title)
|
|
1261
|
+
.getRegex();
|
|
1262
|
+
|
|
1263
|
+
inline.reflink = edit$1(inline.reflink)
|
|
1264
|
+
.replace('label', inline._label)
|
|
1265
|
+
.getRegex();
|
|
1266
|
+
|
|
1267
|
+
inline.reflinkSearch = edit$1(inline.reflinkSearch, 'g')
|
|
1268
|
+
.replace('reflink', inline.reflink)
|
|
1269
|
+
.replace('nolink', inline.nolink)
|
|
1270
|
+
.getRegex();
|
|
1271
|
+
|
|
1272
|
+
/**
|
|
1273
|
+
* Normal Inline Grammar
|
|
1274
|
+
*/
|
|
1275
|
+
|
|
1276
|
+
inline.normal = merge$1({}, inline);
|
|
1277
|
+
|
|
1278
|
+
/**
|
|
1279
|
+
* Pedantic Inline Grammar
|
|
1280
|
+
*/
|
|
1281
|
+
|
|
1282
|
+
inline.pedantic = merge$1({}, inline.normal, {
|
|
1283
|
+
strong: {
|
|
1284
|
+
start: /^__|\*\*/,
|
|
1285
|
+
middle: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
|
|
1286
|
+
endAst: /\*\*(?!\*)/g,
|
|
1287
|
+
endUnd: /__(?!_)/g
|
|
1288
|
+
},
|
|
1289
|
+
em: {
|
|
1290
|
+
start: /^_|\*/,
|
|
1291
|
+
middle: /^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,
|
|
1292
|
+
endAst: /\*(?!\*)/g,
|
|
1293
|
+
endUnd: /_(?!_)/g
|
|
1294
|
+
},
|
|
1295
|
+
link: edit$1(/^!?\[(label)\]\((.*?)\)/)
|
|
1296
|
+
.replace('label', inline._label)
|
|
1297
|
+
.getRegex(),
|
|
1298
|
+
reflink: edit$1(/^!?\[(label)\]\s*\[([^\]]*)\]/)
|
|
1299
|
+
.replace('label', inline._label)
|
|
1300
|
+
.getRegex()
|
|
1301
|
+
});
|
|
1302
|
+
|
|
1303
|
+
/**
|
|
1304
|
+
* GFM Inline Grammar
|
|
1305
|
+
*/
|
|
1306
|
+
|
|
1307
|
+
inline.gfm = merge$1({}, inline.normal, {
|
|
1308
|
+
escape: edit$1(inline.escape).replace('])', '~|])').getRegex(),
|
|
1309
|
+
_extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,
|
|
1310
|
+
url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,
|
|
1311
|
+
_backpedal: /(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,
|
|
1312
|
+
del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,
|
|
1313
|
+
text: /^([`~]+|[^`~])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/
|
|
1314
|
+
});
|
|
1315
|
+
|
|
1316
|
+
inline.gfm.url = edit$1(inline.gfm.url, 'i')
|
|
1317
|
+
.replace('email', inline.gfm._extended_email)
|
|
1318
|
+
.getRegex();
|
|
1319
|
+
/**
|
|
1320
|
+
* GFM + Line Breaks Inline Grammar
|
|
1321
|
+
*/
|
|
1322
|
+
|
|
1323
|
+
inline.breaks = merge$1({}, inline.gfm, {
|
|
1324
|
+
br: edit$1(inline.br).replace('{2,}', '*').getRegex(),
|
|
1325
|
+
text: edit$1(inline.gfm.text)
|
|
1326
|
+
.replace('\\b_', '\\b_| {2,}\\n')
|
|
1327
|
+
.replace(/\{2,\}/g, '*')
|
|
1328
|
+
.getRegex()
|
|
1329
|
+
});
|
|
1330
|
+
|
|
1331
|
+
var rules = {
|
|
1332
|
+
block,
|
|
1333
|
+
inline
|
|
1334
|
+
};
|
|
1335
|
+
|
|
1336
|
+
const { defaults: defaults$2 } = defaults;
|
|
1337
|
+
const { block: block$1, inline: inline$1 } = rules;
|
|
1338
|
+
const { repeatString: repeatString$1 } = helpers;
|
|
1339
|
+
|
|
1340
|
+
/**
|
|
1341
|
+
* smartypants text replacement
|
|
1342
|
+
*/
|
|
1343
|
+
function smartypants(text) {
|
|
1344
|
+
return text
|
|
1345
|
+
// em-dashes
|
|
1346
|
+
.replace(/---/g, '\u2014')
|
|
1347
|
+
// en-dashes
|
|
1348
|
+
.replace(/--/g, '\u2013')
|
|
1349
|
+
// opening singles
|
|
1350
|
+
.replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018')
|
|
1351
|
+
// closing singles & apostrophes
|
|
1352
|
+
.replace(/'/g, '\u2019')
|
|
1353
|
+
// opening doubles
|
|
1354
|
+
.replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c')
|
|
1355
|
+
// closing doubles
|
|
1356
|
+
.replace(/"/g, '\u201d')
|
|
1357
|
+
// ellipses
|
|
1358
|
+
.replace(/\.{3}/g, '\u2026');
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
/**
|
|
1362
|
+
* mangle email addresses
|
|
1363
|
+
*/
|
|
1364
|
+
function mangle(text) {
|
|
1365
|
+
let out = '',
|
|
1366
|
+
i,
|
|
1367
|
+
ch;
|
|
1368
|
+
|
|
1369
|
+
const l = text.length;
|
|
1370
|
+
for (i = 0; i < l; i++) {
|
|
1371
|
+
ch = text.charCodeAt(i);
|
|
1372
|
+
if (Math.random() > 0.5) {
|
|
1373
|
+
ch = 'x' + ch.toString(16);
|
|
1374
|
+
}
|
|
1375
|
+
out += '&#' + ch + ';';
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1378
|
+
return out;
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
/**
|
|
1382
|
+
* Block Lexer
|
|
1383
|
+
*/
|
|
1384
|
+
var Lexer_1 = class Lexer {
|
|
1385
|
+
constructor(options) {
|
|
1386
|
+
this.tokens = [];
|
|
1387
|
+
this.tokens.links = Object.create(null);
|
|
1388
|
+
this.options = options || defaults$2;
|
|
1389
|
+
this.options.tokenizer = this.options.tokenizer || new Tokenizer_1();
|
|
1390
|
+
this.tokenizer = this.options.tokenizer;
|
|
1391
|
+
this.tokenizer.options = this.options;
|
|
1392
|
+
|
|
1393
|
+
const rules = {
|
|
1394
|
+
block: block$1.normal,
|
|
1395
|
+
inline: inline$1.normal
|
|
1396
|
+
};
|
|
1397
|
+
|
|
1398
|
+
if (this.options.pedantic) {
|
|
1399
|
+
rules.block = block$1.pedantic;
|
|
1400
|
+
rules.inline = inline$1.pedantic;
|
|
1401
|
+
} else if (this.options.gfm) {
|
|
1402
|
+
rules.block = block$1.gfm;
|
|
1403
|
+
if (this.options.breaks) {
|
|
1404
|
+
rules.inline = inline$1.breaks;
|
|
1405
|
+
} else {
|
|
1406
|
+
rules.inline = inline$1.gfm;
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
this.tokenizer.rules = rules;
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1412
|
+
/**
|
|
1413
|
+
* Expose Rules
|
|
1414
|
+
*/
|
|
1415
|
+
static get rules() {
|
|
1416
|
+
return {
|
|
1417
|
+
block: block$1,
|
|
1418
|
+
inline: inline$1
|
|
1419
|
+
};
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
/**
|
|
1423
|
+
* Static Lex Method
|
|
1424
|
+
*/
|
|
1425
|
+
static lex(src, options) {
|
|
1426
|
+
const lexer = new Lexer(options);
|
|
1427
|
+
return lexer.lex(src);
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
/**
|
|
1431
|
+
* Static Lex Inline Method
|
|
1432
|
+
*/
|
|
1433
|
+
static lexInline(src, options) {
|
|
1434
|
+
const lexer = new Lexer(options);
|
|
1435
|
+
return lexer.inlineTokens(src);
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
/**
|
|
1439
|
+
* Preprocessing
|
|
1440
|
+
*/
|
|
1441
|
+
lex(src) {
|
|
1442
|
+
src = src
|
|
1443
|
+
.replace(/\r\n|\r/g, '\n')
|
|
1444
|
+
.replace(/\t/g, ' ');
|
|
1445
|
+
|
|
1446
|
+
this.blockTokens(src, this.tokens, true);
|
|
1447
|
+
|
|
1448
|
+
this.inline(this.tokens);
|
|
1449
|
+
|
|
1450
|
+
return this.tokens;
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
/**
|
|
1454
|
+
* Lexing
|
|
1455
|
+
*/
|
|
1456
|
+
blockTokens(src, tokens = [], top = true) {
|
|
1457
|
+
src = src.replace(/^ +$/gm, '');
|
|
1458
|
+
let token, i, l, lastToken;
|
|
1459
|
+
|
|
1460
|
+
while (src) {
|
|
1461
|
+
// newline
|
|
1462
|
+
if (token = this.tokenizer.space(src)) {
|
|
1463
|
+
src = src.substring(token.raw.length);
|
|
1464
|
+
if (token.type) {
|
|
1465
|
+
tokens.push(token);
|
|
1466
|
+
}
|
|
1467
|
+
continue;
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
// code
|
|
1471
|
+
if (token = this.tokenizer.code(src, tokens)) {
|
|
1472
|
+
src = src.substring(token.raw.length);
|
|
1473
|
+
if (token.type) {
|
|
1474
|
+
tokens.push(token);
|
|
1475
|
+
} else {
|
|
1476
|
+
lastToken = tokens[tokens.length - 1];
|
|
1477
|
+
lastToken.raw += '\n' + token.raw;
|
|
1478
|
+
lastToken.text += '\n' + token.text;
|
|
1479
|
+
}
|
|
1480
|
+
continue;
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1483
|
+
// fences
|
|
1484
|
+
if (token = this.tokenizer.fences(src)) {
|
|
1485
|
+
src = src.substring(token.raw.length);
|
|
1486
|
+
tokens.push(token);
|
|
1487
|
+
continue;
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
// heading
|
|
1491
|
+
if (token = this.tokenizer.heading(src)) {
|
|
1492
|
+
src = src.substring(token.raw.length);
|
|
1493
|
+
tokens.push(token);
|
|
1494
|
+
continue;
|
|
1495
|
+
}
|
|
1496
|
+
|
|
1497
|
+
// table no leading pipe (gfm)
|
|
1498
|
+
if (token = this.tokenizer.nptable(src)) {
|
|
1499
|
+
src = src.substring(token.raw.length);
|
|
1500
|
+
tokens.push(token);
|
|
1501
|
+
continue;
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1504
|
+
// hr
|
|
1505
|
+
if (token = this.tokenizer.hr(src)) {
|
|
1506
|
+
src = src.substring(token.raw.length);
|
|
1507
|
+
tokens.push(token);
|
|
1508
|
+
continue;
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
// blockquote
|
|
1512
|
+
if (token = this.tokenizer.blockquote(src)) {
|
|
1513
|
+
src = src.substring(token.raw.length);
|
|
1514
|
+
token.tokens = this.blockTokens(token.text, [], top);
|
|
1515
|
+
tokens.push(token);
|
|
1516
|
+
continue;
|
|
1517
|
+
}
|
|
1518
|
+
|
|
1519
|
+
// list
|
|
1520
|
+
if (token = this.tokenizer.list(src)) {
|
|
1521
|
+
src = src.substring(token.raw.length);
|
|
1522
|
+
l = token.items.length;
|
|
1523
|
+
for (i = 0; i < l; i++) {
|
|
1524
|
+
token.items[i].tokens = this.blockTokens(token.items[i].text, [], false);
|
|
1525
|
+
}
|
|
1526
|
+
tokens.push(token);
|
|
1527
|
+
continue;
|
|
1528
|
+
}
|
|
1529
|
+
|
|
1530
|
+
// html
|
|
1531
|
+
if (token = this.tokenizer.html(src)) {
|
|
1532
|
+
src = src.substring(token.raw.length);
|
|
1533
|
+
tokens.push(token);
|
|
1534
|
+
continue;
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1537
|
+
// def
|
|
1538
|
+
if (top && (token = this.tokenizer.def(src))) {
|
|
1539
|
+
src = src.substring(token.raw.length);
|
|
1540
|
+
if (!this.tokens.links[token.tag]) {
|
|
1541
|
+
this.tokens.links[token.tag] = {
|
|
1542
|
+
href: token.href,
|
|
1543
|
+
title: token.title
|
|
1544
|
+
};
|
|
1545
|
+
}
|
|
1546
|
+
continue;
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
// table (gfm)
|
|
1550
|
+
if (token = this.tokenizer.table(src)) {
|
|
1551
|
+
src = src.substring(token.raw.length);
|
|
1552
|
+
tokens.push(token);
|
|
1553
|
+
continue;
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
// lheading
|
|
1557
|
+
if (token = this.tokenizer.lheading(src)) {
|
|
1558
|
+
src = src.substring(token.raw.length);
|
|
1559
|
+
tokens.push(token);
|
|
1560
|
+
continue;
|
|
1561
|
+
}
|
|
1562
|
+
|
|
1563
|
+
// top-level paragraph
|
|
1564
|
+
if (top && (token = this.tokenizer.paragraph(src))) {
|
|
1565
|
+
src = src.substring(token.raw.length);
|
|
1566
|
+
tokens.push(token);
|
|
1567
|
+
continue;
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
// text
|
|
1571
|
+
if (token = this.tokenizer.text(src, tokens)) {
|
|
1572
|
+
src = src.substring(token.raw.length);
|
|
1573
|
+
if (token.type) {
|
|
1574
|
+
tokens.push(token);
|
|
1575
|
+
} else {
|
|
1576
|
+
lastToken = tokens[tokens.length - 1];
|
|
1577
|
+
lastToken.raw += '\n' + token.raw;
|
|
1578
|
+
lastToken.text += '\n' + token.text;
|
|
1579
|
+
}
|
|
1580
|
+
continue;
|
|
1581
|
+
}
|
|
1582
|
+
|
|
1583
|
+
if (src) {
|
|
1584
|
+
const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);
|
|
1585
|
+
if (this.options.silent) {
|
|
1586
|
+
console.error(errMsg);
|
|
1587
|
+
break;
|
|
1588
|
+
} else {
|
|
1589
|
+
throw new Error(errMsg);
|
|
1590
|
+
}
|
|
1591
|
+
}
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
return tokens;
|
|
1595
|
+
}
|
|
1596
|
+
|
|
1597
|
+
inline(tokens) {
|
|
1598
|
+
let i,
|
|
1599
|
+
j,
|
|
1600
|
+
k,
|
|
1601
|
+
l2,
|
|
1602
|
+
row,
|
|
1603
|
+
token;
|
|
1604
|
+
|
|
1605
|
+
const l = tokens.length;
|
|
1606
|
+
for (i = 0; i < l; i++) {
|
|
1607
|
+
token = tokens[i];
|
|
1608
|
+
switch (token.type) {
|
|
1609
|
+
case 'paragraph':
|
|
1610
|
+
case 'text':
|
|
1611
|
+
case 'heading': {
|
|
1612
|
+
token.tokens = [];
|
|
1613
|
+
this.inlineTokens(token.text, token.tokens);
|
|
1614
|
+
break;
|
|
1615
|
+
}
|
|
1616
|
+
case 'table': {
|
|
1617
|
+
token.tokens = {
|
|
1618
|
+
header: [],
|
|
1619
|
+
cells: []
|
|
1620
|
+
};
|
|
1621
|
+
|
|
1622
|
+
// header
|
|
1623
|
+
l2 = token.header.length;
|
|
1624
|
+
for (j = 0; j < l2; j++) {
|
|
1625
|
+
token.tokens.header[j] = [];
|
|
1626
|
+
this.inlineTokens(token.header[j], token.tokens.header[j]);
|
|
1627
|
+
}
|
|
1628
|
+
|
|
1629
|
+
// cells
|
|
1630
|
+
l2 = token.cells.length;
|
|
1631
|
+
for (j = 0; j < l2; j++) {
|
|
1632
|
+
row = token.cells[j];
|
|
1633
|
+
token.tokens.cells[j] = [];
|
|
1634
|
+
for (k = 0; k < row.length; k++) {
|
|
1635
|
+
token.tokens.cells[j][k] = [];
|
|
1636
|
+
this.inlineTokens(row[k], token.tokens.cells[j][k]);
|
|
1637
|
+
}
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
break;
|
|
1641
|
+
}
|
|
1642
|
+
case 'blockquote': {
|
|
1643
|
+
this.inline(token.tokens);
|
|
1644
|
+
break;
|
|
1645
|
+
}
|
|
1646
|
+
case 'list': {
|
|
1647
|
+
l2 = token.items.length;
|
|
1648
|
+
for (j = 0; j < l2; j++) {
|
|
1649
|
+
this.inline(token.items[j].tokens);
|
|
1650
|
+
}
|
|
1651
|
+
break;
|
|
1652
|
+
}
|
|
1653
|
+
}
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
return tokens;
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1659
|
+
/**
|
|
1660
|
+
* Lexing/Compiling
|
|
1661
|
+
*/
|
|
1662
|
+
inlineTokens(src, tokens = [], inLink = false, inRawBlock = false) {
|
|
1663
|
+
let token;
|
|
1664
|
+
|
|
1665
|
+
// String with links masked to avoid interference with em and strong
|
|
1666
|
+
let maskedSrc = src;
|
|
1667
|
+
let match;
|
|
1668
|
+
let keepPrevChar, prevChar;
|
|
1669
|
+
|
|
1670
|
+
// Mask out reflinks
|
|
1671
|
+
if (this.tokens.links) {
|
|
1672
|
+
const links = Object.keys(this.tokens.links);
|
|
1673
|
+
if (links.length > 0) {
|
|
1674
|
+
while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {
|
|
1675
|
+
if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) {
|
|
1676
|
+
maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString$1('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);
|
|
1677
|
+
}
|
|
1678
|
+
}
|
|
1679
|
+
}
|
|
1680
|
+
}
|
|
1681
|
+
// Mask out other blocks
|
|
1682
|
+
while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {
|
|
1683
|
+
maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString$1('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1686
|
+
while (src) {
|
|
1687
|
+
if (!keepPrevChar) {
|
|
1688
|
+
prevChar = '';
|
|
1689
|
+
}
|
|
1690
|
+
keepPrevChar = false;
|
|
1691
|
+
// escape
|
|
1692
|
+
if (token = this.tokenizer.escape(src)) {
|
|
1693
|
+
src = src.substring(token.raw.length);
|
|
1694
|
+
tokens.push(token);
|
|
1695
|
+
continue;
|
|
1696
|
+
}
|
|
1697
|
+
|
|
1698
|
+
// tag
|
|
1699
|
+
if (token = this.tokenizer.tag(src, inLink, inRawBlock)) {
|
|
1700
|
+
src = src.substring(token.raw.length);
|
|
1701
|
+
inLink = token.inLink;
|
|
1702
|
+
inRawBlock = token.inRawBlock;
|
|
1703
|
+
tokens.push(token);
|
|
1704
|
+
continue;
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1707
|
+
// link
|
|
1708
|
+
if (token = this.tokenizer.link(src)) {
|
|
1709
|
+
src = src.substring(token.raw.length);
|
|
1710
|
+
if (token.type === 'link') {
|
|
1711
|
+
token.tokens = this.inlineTokens(token.text, [], true, inRawBlock);
|
|
1712
|
+
}
|
|
1713
|
+
tokens.push(token);
|
|
1714
|
+
continue;
|
|
1715
|
+
}
|
|
1716
|
+
|
|
1717
|
+
// reflink, nolink
|
|
1718
|
+
if (token = this.tokenizer.reflink(src, this.tokens.links)) {
|
|
1719
|
+
src = src.substring(token.raw.length);
|
|
1720
|
+
if (token.type === 'link') {
|
|
1721
|
+
token.tokens = this.inlineTokens(token.text, [], true, inRawBlock);
|
|
1722
|
+
}
|
|
1723
|
+
tokens.push(token);
|
|
1724
|
+
continue;
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1727
|
+
// strong
|
|
1728
|
+
if (token = this.tokenizer.strong(src, maskedSrc, prevChar)) {
|
|
1729
|
+
src = src.substring(token.raw.length);
|
|
1730
|
+
token.tokens = this.inlineTokens(token.text, [], inLink, inRawBlock);
|
|
1731
|
+
tokens.push(token);
|
|
1732
|
+
continue;
|
|
1733
|
+
}
|
|
1734
|
+
|
|
1735
|
+
// em
|
|
1736
|
+
if (token = this.tokenizer.em(src, maskedSrc, prevChar)) {
|
|
1737
|
+
src = src.substring(token.raw.length);
|
|
1738
|
+
token.tokens = this.inlineTokens(token.text, [], inLink, inRawBlock);
|
|
1739
|
+
tokens.push(token);
|
|
1740
|
+
continue;
|
|
1741
|
+
}
|
|
1742
|
+
|
|
1743
|
+
// code
|
|
1744
|
+
if (token = this.tokenizer.codespan(src)) {
|
|
1745
|
+
src = src.substring(token.raw.length);
|
|
1746
|
+
tokens.push(token);
|
|
1747
|
+
continue;
|
|
1748
|
+
}
|
|
1749
|
+
|
|
1750
|
+
// br
|
|
1751
|
+
if (token = this.tokenizer.br(src)) {
|
|
1752
|
+
src = src.substring(token.raw.length);
|
|
1753
|
+
tokens.push(token);
|
|
1754
|
+
continue;
|
|
1755
|
+
}
|
|
1756
|
+
|
|
1757
|
+
// del (gfm)
|
|
1758
|
+
if (token = this.tokenizer.del(src)) {
|
|
1759
|
+
src = src.substring(token.raw.length);
|
|
1760
|
+
token.tokens = this.inlineTokens(token.text, [], inLink, inRawBlock);
|
|
1761
|
+
tokens.push(token);
|
|
1762
|
+
continue;
|
|
1763
|
+
}
|
|
1764
|
+
|
|
1765
|
+
// autolink
|
|
1766
|
+
if (token = this.tokenizer.autolink(src, mangle)) {
|
|
1767
|
+
src = src.substring(token.raw.length);
|
|
1768
|
+
tokens.push(token);
|
|
1769
|
+
continue;
|
|
1770
|
+
}
|
|
1771
|
+
|
|
1772
|
+
// url (gfm)
|
|
1773
|
+
if (!inLink && (token = this.tokenizer.url(src, mangle))) {
|
|
1774
|
+
src = src.substring(token.raw.length);
|
|
1775
|
+
tokens.push(token);
|
|
1776
|
+
continue;
|
|
1777
|
+
}
|
|
1778
|
+
|
|
1779
|
+
// text
|
|
1780
|
+
if (token = this.tokenizer.inlineText(src, inRawBlock, smartypants)) {
|
|
1781
|
+
src = src.substring(token.raw.length);
|
|
1782
|
+
prevChar = token.raw.slice(-1);
|
|
1783
|
+
keepPrevChar = true;
|
|
1784
|
+
tokens.push(token);
|
|
1785
|
+
continue;
|
|
1786
|
+
}
|
|
1787
|
+
|
|
1788
|
+
if (src) {
|
|
1789
|
+
const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);
|
|
1790
|
+
if (this.options.silent) {
|
|
1791
|
+
console.error(errMsg);
|
|
1792
|
+
break;
|
|
1793
|
+
} else {
|
|
1794
|
+
throw new Error(errMsg);
|
|
1795
|
+
}
|
|
1796
|
+
}
|
|
1797
|
+
}
|
|
1798
|
+
|
|
1799
|
+
return tokens;
|
|
1800
|
+
}
|
|
1801
|
+
};
|
|
1802
|
+
|
|
1803
|
+
const { defaults: defaults$3 } = defaults;
|
|
1804
|
+
const {
|
|
1805
|
+
cleanUrl: cleanUrl$1,
|
|
1806
|
+
escape: escape$2
|
|
1807
|
+
} = helpers;
|
|
1808
|
+
|
|
1809
|
+
/**
|
|
1810
|
+
* Renderer
|
|
1811
|
+
*/
|
|
1812
|
+
var Renderer_1 = class Renderer {
|
|
1813
|
+
constructor(options) {
|
|
1814
|
+
this.options = options || defaults$3;
|
|
1815
|
+
}
|
|
1816
|
+
|
|
1817
|
+
code(code, infostring, escaped) {
|
|
1818
|
+
const lang = (infostring || '').match(/\S*/)[0];
|
|
1819
|
+
if (this.options.highlight) {
|
|
1820
|
+
const out = this.options.highlight(code, lang);
|
|
1821
|
+
if (out != null && out !== code) {
|
|
1822
|
+
escaped = true;
|
|
1823
|
+
code = out;
|
|
1824
|
+
}
|
|
1825
|
+
}
|
|
1826
|
+
|
|
1827
|
+
if (!lang) {
|
|
1828
|
+
return '<pre><code>'
|
|
1829
|
+
+ (escaped ? code : escape$2(code, true))
|
|
1830
|
+
+ '</code></pre>\n';
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
return '<pre><code class="'
|
|
1834
|
+
+ this.options.langPrefix
|
|
1835
|
+
+ escape$2(lang, true)
|
|
1836
|
+
+ '">'
|
|
1837
|
+
+ (escaped ? code : escape$2(code, true))
|
|
1838
|
+
+ '</code></pre>\n';
|
|
1839
|
+
}
|
|
1840
|
+
|
|
1841
|
+
blockquote(quote) {
|
|
1842
|
+
return '<blockquote>\n' + quote + '</blockquote>\n';
|
|
1843
|
+
}
|
|
1844
|
+
|
|
1845
|
+
html(html) {
|
|
1846
|
+
return html;
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1849
|
+
heading(text, level, raw, slugger) {
|
|
1850
|
+
if (this.options.headerIds) {
|
|
1851
|
+
return '<h'
|
|
1852
|
+
+ level
|
|
1853
|
+
+ ' id="'
|
|
1854
|
+
+ this.options.headerPrefix
|
|
1855
|
+
+ slugger.slug(raw)
|
|
1856
|
+
+ '">'
|
|
1857
|
+
+ text
|
|
1858
|
+
+ '</h'
|
|
1859
|
+
+ level
|
|
1860
|
+
+ '>\n';
|
|
1861
|
+
}
|
|
1862
|
+
// ignore IDs
|
|
1863
|
+
return '<h' + level + '>' + text + '</h' + level + '>\n';
|
|
1864
|
+
}
|
|
1865
|
+
|
|
1866
|
+
hr() {
|
|
1867
|
+
return this.options.xhtml ? '<hr/>\n' : '<hr>\n';
|
|
1868
|
+
}
|
|
1869
|
+
|
|
1870
|
+
list(body, ordered, start) {
|
|
1871
|
+
const type = ordered ? 'ol' : 'ul',
|
|
1872
|
+
startatt = (ordered && start !== 1) ? (' start="' + start + '"') : '';
|
|
1873
|
+
return '<' + type + startatt + '>\n' + body + '</' + type + '>\n';
|
|
1874
|
+
}
|
|
1875
|
+
|
|
1876
|
+
listitem(text) {
|
|
1877
|
+
return '<li>' + text + '</li>\n';
|
|
1878
|
+
}
|
|
1879
|
+
|
|
1880
|
+
checkbox(checked) {
|
|
1881
|
+
return '<input '
|
|
1882
|
+
+ (checked ? 'checked="" ' : '')
|
|
1883
|
+
+ 'disabled="" type="checkbox"'
|
|
1884
|
+
+ (this.options.xhtml ? ' /' : '')
|
|
1885
|
+
+ '> ';
|
|
1886
|
+
}
|
|
1887
|
+
|
|
1888
|
+
paragraph(text) {
|
|
1889
|
+
return '<p>' + text + '</p>\n';
|
|
1890
|
+
}
|
|
1891
|
+
|
|
1892
|
+
table(header, body) {
|
|
1893
|
+
if (body) body = '<tbody>' + body + '</tbody>';
|
|
1894
|
+
|
|
1895
|
+
return '<table>\n'
|
|
1896
|
+
+ '<thead>\n'
|
|
1897
|
+
+ header
|
|
1898
|
+
+ '</thead>\n'
|
|
1899
|
+
+ body
|
|
1900
|
+
+ '</table>\n';
|
|
1901
|
+
}
|
|
1902
|
+
|
|
1903
|
+
tablerow(content) {
|
|
1904
|
+
return '<tr>\n' + content + '</tr>\n';
|
|
1905
|
+
}
|
|
1906
|
+
|
|
1907
|
+
tablecell(content, flags) {
|
|
1908
|
+
const type = flags.header ? 'th' : 'td';
|
|
1909
|
+
const tag = flags.align
|
|
1910
|
+
? '<' + type + ' align="' + flags.align + '">'
|
|
1911
|
+
: '<' + type + '>';
|
|
1912
|
+
return tag + content + '</' + type + '>\n';
|
|
1913
|
+
}
|
|
1914
|
+
|
|
1915
|
+
// span level renderer
|
|
1916
|
+
strong(text) {
|
|
1917
|
+
return '<strong>' + text + '</strong>';
|
|
1918
|
+
}
|
|
1919
|
+
|
|
1920
|
+
em(text) {
|
|
1921
|
+
return '<em>' + text + '</em>';
|
|
1922
|
+
}
|
|
1923
|
+
|
|
1924
|
+
codespan(text) {
|
|
1925
|
+
return '<code>' + text + '</code>';
|
|
1926
|
+
}
|
|
1927
|
+
|
|
1928
|
+
br() {
|
|
1929
|
+
return this.options.xhtml ? '<br/>' : '<br>';
|
|
1930
|
+
}
|
|
1931
|
+
|
|
1932
|
+
del(text) {
|
|
1933
|
+
return '<del>' + text + '</del>';
|
|
1934
|
+
}
|
|
1935
|
+
|
|
1936
|
+
link(href, title, text) {
|
|
1937
|
+
href = cleanUrl$1(this.options.sanitize, this.options.baseUrl, href);
|
|
1938
|
+
if (href === null) {
|
|
1939
|
+
return text;
|
|
1940
|
+
}
|
|
1941
|
+
let out = '<a href="' + escape$2(href) + '"';
|
|
1942
|
+
if (title) {
|
|
1943
|
+
out += ' title="' + title + '"';
|
|
1944
|
+
}
|
|
1945
|
+
out += '>' + text + '</a>';
|
|
1946
|
+
return out;
|
|
1947
|
+
}
|
|
1948
|
+
|
|
1949
|
+
image(href, title, text) {
|
|
1950
|
+
href = cleanUrl$1(this.options.sanitize, this.options.baseUrl, href);
|
|
1951
|
+
if (href === null) {
|
|
1952
|
+
return text;
|
|
1953
|
+
}
|
|
1954
|
+
|
|
1955
|
+
let out = '<img src="' + href + '" alt="' + text + '"';
|
|
1956
|
+
if (title) {
|
|
1957
|
+
out += ' title="' + title + '"';
|
|
1958
|
+
}
|
|
1959
|
+
out += this.options.xhtml ? '/>' : '>';
|
|
1960
|
+
return out;
|
|
1961
|
+
}
|
|
1962
|
+
|
|
1963
|
+
text(text) {
|
|
1964
|
+
return text;
|
|
1965
|
+
}
|
|
1966
|
+
};
|
|
1967
|
+
|
|
1968
|
+
/**
|
|
1969
|
+
* TextRenderer
|
|
1970
|
+
* returns only the textual part of the token
|
|
1971
|
+
*/
|
|
1972
|
+
var TextRenderer_1 = class TextRenderer {
|
|
1973
|
+
// no need for block level renderers
|
|
1974
|
+
strong(text) {
|
|
1975
|
+
return text;
|
|
1976
|
+
}
|
|
1977
|
+
|
|
1978
|
+
em(text) {
|
|
1979
|
+
return text;
|
|
1980
|
+
}
|
|
1981
|
+
|
|
1982
|
+
codespan(text) {
|
|
1983
|
+
return text;
|
|
1984
|
+
}
|
|
1985
|
+
|
|
1986
|
+
del(text) {
|
|
1987
|
+
return text;
|
|
1988
|
+
}
|
|
1989
|
+
|
|
1990
|
+
html(text) {
|
|
1991
|
+
return text;
|
|
1992
|
+
}
|
|
1993
|
+
|
|
1994
|
+
text(text) {
|
|
1995
|
+
return text;
|
|
1996
|
+
}
|
|
1997
|
+
|
|
1998
|
+
link(href, title, text) {
|
|
1999
|
+
return '' + text;
|
|
2000
|
+
}
|
|
2001
|
+
|
|
2002
|
+
image(href, title, text) {
|
|
2003
|
+
return '' + text;
|
|
2004
|
+
}
|
|
2005
|
+
|
|
2006
|
+
br() {
|
|
2007
|
+
return '';
|
|
2008
|
+
}
|
|
2009
|
+
};
|
|
2010
|
+
|
|
2011
|
+
/**
|
|
2012
|
+
* Slugger generates header id
|
|
2013
|
+
*/
|
|
2014
|
+
var Slugger_1 = class Slugger {
|
|
2015
|
+
constructor() {
|
|
2016
|
+
this.seen = {};
|
|
2017
|
+
}
|
|
2018
|
+
|
|
2019
|
+
serialize(value) {
|
|
2020
|
+
return value
|
|
2021
|
+
.toLowerCase()
|
|
2022
|
+
.trim()
|
|
2023
|
+
// remove html tags
|
|
2024
|
+
.replace(/<[!\/a-z].*?>/ig, '')
|
|
2025
|
+
// remove unwanted chars
|
|
2026
|
+
.replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, '')
|
|
2027
|
+
.replace(/\s/g, '-');
|
|
2028
|
+
}
|
|
2029
|
+
|
|
2030
|
+
/**
|
|
2031
|
+
* Finds the next safe (unique) slug to use
|
|
2032
|
+
*/
|
|
2033
|
+
getNextSafeSlug(originalSlug, isDryRun) {
|
|
2034
|
+
let slug = originalSlug;
|
|
2035
|
+
let occurenceAccumulator = 0;
|
|
2036
|
+
if (this.seen.hasOwnProperty(slug)) {
|
|
2037
|
+
occurenceAccumulator = this.seen[originalSlug];
|
|
2038
|
+
do {
|
|
2039
|
+
occurenceAccumulator++;
|
|
2040
|
+
slug = originalSlug + '-' + occurenceAccumulator;
|
|
2041
|
+
} while (this.seen.hasOwnProperty(slug));
|
|
2042
|
+
}
|
|
2043
|
+
if (!isDryRun) {
|
|
2044
|
+
this.seen[originalSlug] = occurenceAccumulator;
|
|
2045
|
+
this.seen[slug] = 0;
|
|
2046
|
+
}
|
|
2047
|
+
return slug;
|
|
2048
|
+
}
|
|
2049
|
+
|
|
2050
|
+
/**
|
|
2051
|
+
* Convert string to unique id
|
|
2052
|
+
* @param {object} options
|
|
2053
|
+
* @param {boolean} options.dryrun Generates the next unique slug without updating the internal accumulator.
|
|
2054
|
+
*/
|
|
2055
|
+
slug(value, options = {}) {
|
|
2056
|
+
const slug = this.serialize(value);
|
|
2057
|
+
return this.getNextSafeSlug(slug, options.dryrun);
|
|
2058
|
+
}
|
|
2059
|
+
};
|
|
2060
|
+
|
|
2061
|
+
const { defaults: defaults$4 } = defaults;
|
|
2062
|
+
const {
|
|
2063
|
+
unescape: unescape$1
|
|
2064
|
+
} = helpers;
|
|
2065
|
+
|
|
2066
|
+
/**
|
|
2067
|
+
* Parsing & Compiling
|
|
2068
|
+
*/
|
|
2069
|
+
var Parser_1 = class Parser {
|
|
2070
|
+
constructor(options) {
|
|
2071
|
+
this.options = options || defaults$4;
|
|
2072
|
+
this.options.renderer = this.options.renderer || new Renderer_1();
|
|
2073
|
+
this.renderer = this.options.renderer;
|
|
2074
|
+
this.renderer.options = this.options;
|
|
2075
|
+
this.textRenderer = new TextRenderer_1();
|
|
2076
|
+
this.slugger = new Slugger_1();
|
|
2077
|
+
}
|
|
2078
|
+
|
|
2079
|
+
/**
|
|
2080
|
+
* Static Parse Method
|
|
2081
|
+
*/
|
|
2082
|
+
static parse(tokens, options) {
|
|
2083
|
+
const parser = new Parser(options);
|
|
2084
|
+
return parser.parse(tokens);
|
|
2085
|
+
}
|
|
2086
|
+
|
|
2087
|
+
/**
|
|
2088
|
+
* Static Parse Inline Method
|
|
2089
|
+
*/
|
|
2090
|
+
static parseInline(tokens, options) {
|
|
2091
|
+
const parser = new Parser(options);
|
|
2092
|
+
return parser.parseInline(tokens);
|
|
2093
|
+
}
|
|
2094
|
+
|
|
2095
|
+
/**
|
|
2096
|
+
* Parse Loop
|
|
2097
|
+
*/
|
|
2098
|
+
parse(tokens, top = true) {
|
|
2099
|
+
let out = '',
|
|
2100
|
+
i,
|
|
2101
|
+
j,
|
|
2102
|
+
k,
|
|
2103
|
+
l2,
|
|
2104
|
+
l3,
|
|
2105
|
+
row,
|
|
2106
|
+
cell,
|
|
2107
|
+
header,
|
|
2108
|
+
body,
|
|
2109
|
+
token,
|
|
2110
|
+
ordered,
|
|
2111
|
+
start,
|
|
2112
|
+
loose,
|
|
2113
|
+
itemBody,
|
|
2114
|
+
item,
|
|
2115
|
+
checked,
|
|
2116
|
+
task,
|
|
2117
|
+
checkbox;
|
|
2118
|
+
|
|
2119
|
+
const l = tokens.length;
|
|
2120
|
+
for (i = 0; i < l; i++) {
|
|
2121
|
+
token = tokens[i];
|
|
2122
|
+
switch (token.type) {
|
|
2123
|
+
case 'space': {
|
|
2124
|
+
continue;
|
|
2125
|
+
}
|
|
2126
|
+
case 'hr': {
|
|
2127
|
+
out += this.renderer.hr();
|
|
2128
|
+
continue;
|
|
2129
|
+
}
|
|
2130
|
+
case 'heading': {
|
|
2131
|
+
out += this.renderer.heading(
|
|
2132
|
+
this.parseInline(token.tokens),
|
|
2133
|
+
token.depth,
|
|
2134
|
+
unescape$1(this.parseInline(token.tokens, this.textRenderer)),
|
|
2135
|
+
this.slugger);
|
|
2136
|
+
continue;
|
|
2137
|
+
}
|
|
2138
|
+
case 'code': {
|
|
2139
|
+
out += this.renderer.code(token.text,
|
|
2140
|
+
token.lang,
|
|
2141
|
+
token.escaped);
|
|
2142
|
+
continue;
|
|
2143
|
+
}
|
|
2144
|
+
case 'table': {
|
|
2145
|
+
header = '';
|
|
2146
|
+
|
|
2147
|
+
// header
|
|
2148
|
+
cell = '';
|
|
2149
|
+
l2 = token.header.length;
|
|
2150
|
+
for (j = 0; j < l2; j++) {
|
|
2151
|
+
cell += this.renderer.tablecell(
|
|
2152
|
+
this.parseInline(token.tokens.header[j]),
|
|
2153
|
+
{ header: true, align: token.align[j] }
|
|
2154
|
+
);
|
|
2155
|
+
}
|
|
2156
|
+
header += this.renderer.tablerow(cell);
|
|
2157
|
+
|
|
2158
|
+
body = '';
|
|
2159
|
+
l2 = token.cells.length;
|
|
2160
|
+
for (j = 0; j < l2; j++) {
|
|
2161
|
+
row = token.tokens.cells[j];
|
|
2162
|
+
|
|
2163
|
+
cell = '';
|
|
2164
|
+
l3 = row.length;
|
|
2165
|
+
for (k = 0; k < l3; k++) {
|
|
2166
|
+
cell += this.renderer.tablecell(
|
|
2167
|
+
this.parseInline(row[k]),
|
|
2168
|
+
{ header: false, align: token.align[k] }
|
|
2169
|
+
);
|
|
2170
|
+
}
|
|
2171
|
+
|
|
2172
|
+
body += this.renderer.tablerow(cell);
|
|
2173
|
+
}
|
|
2174
|
+
out += this.renderer.table(header, body);
|
|
2175
|
+
continue;
|
|
2176
|
+
}
|
|
2177
|
+
case 'blockquote': {
|
|
2178
|
+
body = this.parse(token.tokens);
|
|
2179
|
+
out += this.renderer.blockquote(body);
|
|
2180
|
+
continue;
|
|
2181
|
+
}
|
|
2182
|
+
case 'list': {
|
|
2183
|
+
ordered = token.ordered;
|
|
2184
|
+
start = token.start;
|
|
2185
|
+
loose = token.loose;
|
|
2186
|
+
l2 = token.items.length;
|
|
2187
|
+
|
|
2188
|
+
body = '';
|
|
2189
|
+
for (j = 0; j < l2; j++) {
|
|
2190
|
+
item = token.items[j];
|
|
2191
|
+
checked = item.checked;
|
|
2192
|
+
task = item.task;
|
|
2193
|
+
|
|
2194
|
+
itemBody = '';
|
|
2195
|
+
if (item.task) {
|
|
2196
|
+
checkbox = this.renderer.checkbox(checked);
|
|
2197
|
+
if (loose) {
|
|
2198
|
+
if (item.tokens.length > 0 && item.tokens[0].type === 'text') {
|
|
2199
|
+
item.tokens[0].text = checkbox + ' ' + item.tokens[0].text;
|
|
2200
|
+
if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') {
|
|
2201
|
+
item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text;
|
|
2202
|
+
}
|
|
2203
|
+
} else {
|
|
2204
|
+
item.tokens.unshift({
|
|
2205
|
+
type: 'text',
|
|
2206
|
+
text: checkbox
|
|
2207
|
+
});
|
|
2208
|
+
}
|
|
2209
|
+
} else {
|
|
2210
|
+
itemBody += checkbox;
|
|
2211
|
+
}
|
|
2212
|
+
}
|
|
2213
|
+
|
|
2214
|
+
itemBody += this.parse(item.tokens, loose);
|
|
2215
|
+
body += this.renderer.listitem(itemBody, task, checked);
|
|
2216
|
+
}
|
|
2217
|
+
|
|
2218
|
+
out += this.renderer.list(body, ordered, start);
|
|
2219
|
+
continue;
|
|
2220
|
+
}
|
|
2221
|
+
case 'html': {
|
|
2222
|
+
// TODO parse inline content if parameter markdown=1
|
|
2223
|
+
out += this.renderer.html(token.text);
|
|
2224
|
+
continue;
|
|
2225
|
+
}
|
|
2226
|
+
case 'paragraph': {
|
|
2227
|
+
out += this.renderer.paragraph(this.parseInline(token.tokens));
|
|
2228
|
+
continue;
|
|
2229
|
+
}
|
|
2230
|
+
case 'text': {
|
|
2231
|
+
body = token.tokens ? this.parseInline(token.tokens) : token.text;
|
|
2232
|
+
while (i + 1 < l && tokens[i + 1].type === 'text') {
|
|
2233
|
+
token = tokens[++i];
|
|
2234
|
+
body += '\n' + (token.tokens ? this.parseInline(token.tokens) : token.text);
|
|
2235
|
+
}
|
|
2236
|
+
out += top ? this.renderer.paragraph(body) : body;
|
|
2237
|
+
continue;
|
|
2238
|
+
}
|
|
2239
|
+
default: {
|
|
2240
|
+
const errMsg = 'Token with "' + token.type + '" type was not found.';
|
|
2241
|
+
if (this.options.silent) {
|
|
2242
|
+
console.error(errMsg);
|
|
2243
|
+
return;
|
|
2244
|
+
} else {
|
|
2245
|
+
throw new Error(errMsg);
|
|
2246
|
+
}
|
|
2247
|
+
}
|
|
2248
|
+
}
|
|
2249
|
+
}
|
|
2250
|
+
|
|
2251
|
+
return out;
|
|
2252
|
+
}
|
|
2253
|
+
|
|
2254
|
+
/**
|
|
2255
|
+
* Parse Inline Tokens
|
|
2256
|
+
*/
|
|
2257
|
+
parseInline(tokens, renderer) {
|
|
2258
|
+
renderer = renderer || this.renderer;
|
|
2259
|
+
let out = '',
|
|
2260
|
+
i,
|
|
2261
|
+
token;
|
|
2262
|
+
|
|
2263
|
+
const l = tokens.length;
|
|
2264
|
+
for (i = 0; i < l; i++) {
|
|
2265
|
+
token = tokens[i];
|
|
2266
|
+
switch (token.type) {
|
|
2267
|
+
case 'escape': {
|
|
2268
|
+
out += renderer.text(token.text);
|
|
2269
|
+
break;
|
|
2270
|
+
}
|
|
2271
|
+
case 'html': {
|
|
2272
|
+
out += renderer.html(token.text);
|
|
2273
|
+
break;
|
|
2274
|
+
}
|
|
2275
|
+
case 'link': {
|
|
2276
|
+
out += renderer.link(token.href, token.title, this.parseInline(token.tokens, renderer));
|
|
2277
|
+
break;
|
|
2278
|
+
}
|
|
2279
|
+
case 'image': {
|
|
2280
|
+
out += renderer.image(token.href, token.title, token.text);
|
|
2281
|
+
break;
|
|
2282
|
+
}
|
|
2283
|
+
case 'strong': {
|
|
2284
|
+
out += renderer.strong(this.parseInline(token.tokens, renderer));
|
|
2285
|
+
break;
|
|
2286
|
+
}
|
|
2287
|
+
case 'em': {
|
|
2288
|
+
out += renderer.em(this.parseInline(token.tokens, renderer));
|
|
2289
|
+
break;
|
|
2290
|
+
}
|
|
2291
|
+
case 'codespan': {
|
|
2292
|
+
out += renderer.codespan(token.text);
|
|
2293
|
+
break;
|
|
2294
|
+
}
|
|
2295
|
+
case 'br': {
|
|
2296
|
+
out += renderer.br();
|
|
2297
|
+
break;
|
|
2298
|
+
}
|
|
2299
|
+
case 'del': {
|
|
2300
|
+
out += renderer.del(this.parseInline(token.tokens, renderer));
|
|
2301
|
+
break;
|
|
2302
|
+
}
|
|
2303
|
+
case 'text': {
|
|
2304
|
+
out += renderer.text(token.text);
|
|
2305
|
+
break;
|
|
2306
|
+
}
|
|
2307
|
+
default: {
|
|
2308
|
+
const errMsg = 'Token with "' + token.type + '" type was not found.';
|
|
2309
|
+
if (this.options.silent) {
|
|
2310
|
+
console.error(errMsg);
|
|
2311
|
+
return;
|
|
2312
|
+
} else {
|
|
2313
|
+
throw new Error(errMsg);
|
|
2314
|
+
}
|
|
2315
|
+
}
|
|
2316
|
+
}
|
|
2317
|
+
}
|
|
2318
|
+
return out;
|
|
2319
|
+
}
|
|
2320
|
+
};
|
|
2321
|
+
|
|
2322
|
+
const {
|
|
2323
|
+
merge: merge$2,
|
|
2324
|
+
checkSanitizeDeprecation: checkSanitizeDeprecation$1,
|
|
2325
|
+
escape: escape$3
|
|
2326
|
+
} = helpers;
|
|
2327
|
+
const {
|
|
2328
|
+
getDefaults,
|
|
2329
|
+
changeDefaults,
|
|
2330
|
+
defaults: defaults$5
|
|
2331
|
+
} = defaults;
|
|
2332
|
+
|
|
2333
|
+
/**
|
|
2334
|
+
* Marked
|
|
2335
|
+
*/
|
|
2336
|
+
function marked(src, opt, callback) {
|
|
2337
|
+
// throw error in case of non string input
|
|
2338
|
+
if (typeof src === 'undefined' || src === null) {
|
|
2339
|
+
throw new Error('marked(): input parameter is undefined or null');
|
|
2340
|
+
}
|
|
2341
|
+
if (typeof src !== 'string') {
|
|
2342
|
+
throw new Error('marked(): input parameter is of type '
|
|
2343
|
+
+ Object.prototype.toString.call(src) + ', string expected');
|
|
2344
|
+
}
|
|
2345
|
+
|
|
2346
|
+
if (typeof opt === 'function') {
|
|
2347
|
+
callback = opt;
|
|
2348
|
+
opt = null;
|
|
2349
|
+
}
|
|
2350
|
+
|
|
2351
|
+
opt = merge$2({}, marked.defaults, opt || {});
|
|
2352
|
+
checkSanitizeDeprecation$1(opt);
|
|
2353
|
+
|
|
2354
|
+
if (callback) {
|
|
2355
|
+
const highlight = opt.highlight;
|
|
2356
|
+
let tokens;
|
|
2357
|
+
|
|
2358
|
+
try {
|
|
2359
|
+
tokens = Lexer_1.lex(src, opt);
|
|
2360
|
+
} catch (e) {
|
|
2361
|
+
return callback(e);
|
|
2362
|
+
}
|
|
2363
|
+
|
|
2364
|
+
const done = function(err) {
|
|
2365
|
+
let out;
|
|
2366
|
+
|
|
2367
|
+
if (!err) {
|
|
2368
|
+
try {
|
|
2369
|
+
out = Parser_1.parse(tokens, opt);
|
|
2370
|
+
} catch (e) {
|
|
2371
|
+
err = e;
|
|
2372
|
+
}
|
|
2373
|
+
}
|
|
2374
|
+
|
|
2375
|
+
opt.highlight = highlight;
|
|
2376
|
+
|
|
2377
|
+
return err
|
|
2378
|
+
? callback(err)
|
|
2379
|
+
: callback(null, out);
|
|
2380
|
+
};
|
|
2381
|
+
|
|
2382
|
+
if (!highlight || highlight.length < 3) {
|
|
2383
|
+
return done();
|
|
2384
|
+
}
|
|
2385
|
+
|
|
2386
|
+
delete opt.highlight;
|
|
2387
|
+
|
|
2388
|
+
if (!tokens.length) return done();
|
|
2389
|
+
|
|
2390
|
+
let pending = 0;
|
|
2391
|
+
marked.walkTokens(tokens, function(token) {
|
|
2392
|
+
if (token.type === 'code') {
|
|
2393
|
+
pending++;
|
|
2394
|
+
setTimeout(() => {
|
|
2395
|
+
highlight(token.text, token.lang, function(err, code) {
|
|
2396
|
+
if (err) {
|
|
2397
|
+
return done(err);
|
|
2398
|
+
}
|
|
2399
|
+
if (code != null && code !== token.text) {
|
|
2400
|
+
token.text = code;
|
|
2401
|
+
token.escaped = true;
|
|
2402
|
+
}
|
|
2403
|
+
|
|
2404
|
+
pending--;
|
|
2405
|
+
if (pending === 0) {
|
|
2406
|
+
done();
|
|
2407
|
+
}
|
|
2408
|
+
});
|
|
2409
|
+
}, 0);
|
|
2410
|
+
}
|
|
2411
|
+
});
|
|
2412
|
+
|
|
2413
|
+
if (pending === 0) {
|
|
2414
|
+
done();
|
|
2415
|
+
}
|
|
2416
|
+
|
|
2417
|
+
return;
|
|
2418
|
+
}
|
|
2419
|
+
|
|
2420
|
+
try {
|
|
2421
|
+
const tokens = Lexer_1.lex(src, opt);
|
|
2422
|
+
if (opt.walkTokens) {
|
|
2423
|
+
marked.walkTokens(tokens, opt.walkTokens);
|
|
2424
|
+
}
|
|
2425
|
+
return Parser_1.parse(tokens, opt);
|
|
2426
|
+
} catch (e) {
|
|
2427
|
+
e.message += '\nPlease report this to https://github.com/markedjs/marked.';
|
|
2428
|
+
if (opt.silent) {
|
|
2429
|
+
return '<p>An error occurred:</p><pre>'
|
|
2430
|
+
+ escape$3(e.message + '', true)
|
|
2431
|
+
+ '</pre>';
|
|
2432
|
+
}
|
|
2433
|
+
throw e;
|
|
2434
|
+
}
|
|
2435
|
+
}
|
|
2436
|
+
|
|
2437
|
+
/**
|
|
2438
|
+
* Options
|
|
2439
|
+
*/
|
|
2440
|
+
|
|
2441
|
+
marked.options =
|
|
2442
|
+
marked.setOptions = function(opt) {
|
|
2443
|
+
merge$2(marked.defaults, opt);
|
|
2444
|
+
changeDefaults(marked.defaults);
|
|
2445
|
+
return marked;
|
|
2446
|
+
};
|
|
2447
|
+
|
|
2448
|
+
marked.getDefaults = getDefaults;
|
|
2449
|
+
|
|
2450
|
+
marked.defaults = defaults$5;
|
|
2451
|
+
|
|
2452
|
+
/**
|
|
2453
|
+
* Use Extension
|
|
2454
|
+
*/
|
|
2455
|
+
|
|
2456
|
+
marked.use = function(extension) {
|
|
2457
|
+
const opts = merge$2({}, extension);
|
|
2458
|
+
if (extension.renderer) {
|
|
2459
|
+
const renderer = marked.defaults.renderer || new Renderer_1();
|
|
2460
|
+
for (const prop in extension.renderer) {
|
|
2461
|
+
const prevRenderer = renderer[prop];
|
|
2462
|
+
renderer[prop] = (...args) => {
|
|
2463
|
+
let ret = extension.renderer[prop].apply(renderer, args);
|
|
2464
|
+
if (ret === false) {
|
|
2465
|
+
ret = prevRenderer.apply(renderer, args);
|
|
2466
|
+
}
|
|
2467
|
+
return ret;
|
|
2468
|
+
};
|
|
2469
|
+
}
|
|
2470
|
+
opts.renderer = renderer;
|
|
2471
|
+
}
|
|
2472
|
+
if (extension.tokenizer) {
|
|
2473
|
+
const tokenizer = marked.defaults.tokenizer || new Tokenizer_1();
|
|
2474
|
+
for (const prop in extension.tokenizer) {
|
|
2475
|
+
const prevTokenizer = tokenizer[prop];
|
|
2476
|
+
tokenizer[prop] = (...args) => {
|
|
2477
|
+
let ret = extension.tokenizer[prop].apply(tokenizer, args);
|
|
2478
|
+
if (ret === false) {
|
|
2479
|
+
ret = prevTokenizer.apply(tokenizer, args);
|
|
2480
|
+
}
|
|
2481
|
+
return ret;
|
|
2482
|
+
};
|
|
2483
|
+
}
|
|
2484
|
+
opts.tokenizer = tokenizer;
|
|
2485
|
+
}
|
|
2486
|
+
if (extension.walkTokens) {
|
|
2487
|
+
const walkTokens = marked.defaults.walkTokens;
|
|
2488
|
+
opts.walkTokens = (token) => {
|
|
2489
|
+
extension.walkTokens(token);
|
|
2490
|
+
if (walkTokens) {
|
|
2491
|
+
walkTokens(token);
|
|
2492
|
+
}
|
|
2493
|
+
};
|
|
2494
|
+
}
|
|
2495
|
+
marked.setOptions(opts);
|
|
2496
|
+
};
|
|
2497
|
+
|
|
2498
|
+
/**
|
|
2499
|
+
* Run callback for every token
|
|
2500
|
+
*/
|
|
2501
|
+
|
|
2502
|
+
marked.walkTokens = function(tokens, callback) {
|
|
2503
|
+
for (const token of tokens) {
|
|
2504
|
+
callback(token);
|
|
2505
|
+
switch (token.type) {
|
|
2506
|
+
case 'table': {
|
|
2507
|
+
for (const cell of token.tokens.header) {
|
|
2508
|
+
marked.walkTokens(cell, callback);
|
|
2509
|
+
}
|
|
2510
|
+
for (const row of token.tokens.cells) {
|
|
2511
|
+
for (const cell of row) {
|
|
2512
|
+
marked.walkTokens(cell, callback);
|
|
2513
|
+
}
|
|
2514
|
+
}
|
|
2515
|
+
break;
|
|
2516
|
+
}
|
|
2517
|
+
case 'list': {
|
|
2518
|
+
marked.walkTokens(token.items, callback);
|
|
2519
|
+
break;
|
|
2520
|
+
}
|
|
2521
|
+
default: {
|
|
2522
|
+
if (token.tokens) {
|
|
2523
|
+
marked.walkTokens(token.tokens, callback);
|
|
2524
|
+
}
|
|
2525
|
+
}
|
|
2526
|
+
}
|
|
2527
|
+
}
|
|
2528
|
+
};
|
|
2529
|
+
|
|
2530
|
+
/**
|
|
2531
|
+
* Parse Inline
|
|
2532
|
+
*/
|
|
2533
|
+
marked.parseInline = function(src, opt) {
|
|
2534
|
+
// throw error in case of non string input
|
|
2535
|
+
if (typeof src === 'undefined' || src === null) {
|
|
2536
|
+
throw new Error('marked.parseInline(): input parameter is undefined or null');
|
|
2537
|
+
}
|
|
2538
|
+
if (typeof src !== 'string') {
|
|
2539
|
+
throw new Error('marked.parseInline(): input parameter is of type '
|
|
2540
|
+
+ Object.prototype.toString.call(src) + ', string expected');
|
|
2541
|
+
}
|
|
2542
|
+
|
|
2543
|
+
opt = merge$2({}, marked.defaults, opt || {});
|
|
2544
|
+
checkSanitizeDeprecation$1(opt);
|
|
2545
|
+
|
|
2546
|
+
try {
|
|
2547
|
+
const tokens = Lexer_1.lexInline(src, opt);
|
|
2548
|
+
if (opt.walkTokens) {
|
|
2549
|
+
marked.walkTokens(tokens, opt.walkTokens);
|
|
2550
|
+
}
|
|
2551
|
+
return Parser_1.parseInline(tokens, opt);
|
|
2552
|
+
} catch (e) {
|
|
2553
|
+
e.message += '\nPlease report this to https://github.com/markedjs/marked.';
|
|
2554
|
+
if (opt.silent) {
|
|
2555
|
+
return '<p>An error occurred:</p><pre>'
|
|
2556
|
+
+ escape$3(e.message + '', true)
|
|
2557
|
+
+ '</pre>';
|
|
2558
|
+
}
|
|
2559
|
+
throw e;
|
|
2560
|
+
}
|
|
2561
|
+
};
|
|
2562
|
+
|
|
2563
|
+
/**
|
|
2564
|
+
* Expose
|
|
2565
|
+
*/
|
|
2566
|
+
|
|
2567
|
+
marked.Parser = Parser_1;
|
|
2568
|
+
marked.parser = Parser_1.parse;
|
|
2569
|
+
|
|
2570
|
+
marked.Renderer = Renderer_1;
|
|
2571
|
+
marked.TextRenderer = TextRenderer_1;
|
|
2572
|
+
|
|
2573
|
+
marked.Lexer = Lexer_1;
|
|
2574
|
+
marked.lexer = Lexer_1.lex;
|
|
2575
|
+
|
|
2576
|
+
marked.Tokenizer = Tokenizer_1;
|
|
2577
|
+
|
|
2578
|
+
marked.Slugger = Slugger_1;
|
|
2579
|
+
|
|
2580
|
+
marked.parse = marked;
|
|
2581
|
+
|
|
2582
|
+
var marked_1 = marked;
|
|
2583
|
+
|
|
2584
|
+
export default marked_1;
|