Skip to content

Commit

Permalink
Merge pull request #229 from marp-team/upgrade-dependencies
Browse files Browse the repository at this point in the history
Upgrade dependent packages to the latest version
  • Loading branch information
yhatt authored May 8, 2021
2 parents f557381 + 533f581 commit 6bb8102
Show file tree
Hide file tree
Showing 5 changed files with 293 additions and 317 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

- Fix to work `markdown.typographer` option ([#228](https://github.com/marp-team/marp-core/pull/228))

### Changed

- Upgrade dependent packages to the latest version ([#229](https://github.com/marp-team/marp-core/pull/229))

## v2.0.1 - 2021-04-27

### Changed
Expand Down
29 changes: 14 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,17 @@
"devDependencies": {
"@marp-team/marp-cli": "^0.23.3",
"@rollup/plugin-alias": "^3.1.2",
"@rollup/plugin-commonjs": "^18.0.0",
"@rollup/plugin-commonjs": "^19.0.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^11.2.1",
"@rollup/plugin-node-resolve": "^13.0.0",
"@rollup/plugin-typescript": "^8.2.1",
"@types/cheerio": "^0.22.28",
"@types/jest": "^26.0.23",
"@typescript-eslint/eslint-plugin": "^4.22.0",
"@typescript-eslint/parser": "^4.22.0",
"@typescript-eslint/eslint-plugin": "^4.22.1",
"@typescript-eslint/parser": "^4.22.1",
"autoprefixer": "^10.2.5",
"cheerio": "^1.0.0-rc.6",
"codecov": "^3.8.1",
"eslint": "^7.25.0",
"cheerio": "^1.0.0-rc.9",
"codecov": "^3.8.2",
"eslint": "^7.26.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jest": "^24.3.6",
Expand All @@ -95,17 +94,17 @@
"postcss-url": "^10.1.3",
"prettier": "^2.2.1",
"rimraf": "^3.0.2",
"rollup": "^2.45.2",
"rollup": "^2.47.0",
"rollup-plugin-postcss": "^4.0.0",
"rollup-plugin-string": "^3.0.0",
"rollup-plugin-terser": "^7.0.2",
"sass": "^1.32.11",
"sass": "^1.32.12",
"self-closing-tags": "^1.0.1",
"stylelint": "^13.13.0",
"stylelint": "^13.13.1",
"stylelint-config-prettier": "^8.0.2",
"stylelint-config-standard": "^22.0.0",
"stylelint-scss": "^3.19.0",
"ts-jest": "26.5.5",
"ts-jest": "26.5.6",
"tslib": "^2.2.0",
"typescript": "^4.2.4"
},
Expand All @@ -114,15 +113,15 @@
"@marp-team/marpit-svg-polyfill": "^1.7.1",
"emoji-regex": "^9.2.2",
"highlight.js": "^10.7.2",
"katex": "^0.13.3",
"katex": "^0.13.9",
"markdown-it-emoji": "^2.0.0",
"mathjax-full": "^3.1.4",
"postcss": "^8.2.13",
"postcss": "^8.2.14",
"postcss-minify-params": "^5.0.0",
"postcss-minify-selectors": "^5.0.0",
"postcss-normalize-whitespace": "^5.0.0",
"twemoji": "^13.0.2",
"xss": "^1.0.8"
"xss": "^1.0.9"
},
"publishConfig": {
"access": "public"
Expand Down
40 changes: 20 additions & 20 deletions test/__snapshots__/marp.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@

exports[`Marp math option with KaTeX (default) injects KaTeX css with replacing web font URL to CDN: katex-css-cdn 1`] = `
Array [
"url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_AMS-Regular.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_AMS-Regular.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_AMS-Regular.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Caligraphic-Bold.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Caligraphic-Bold.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Caligraphic-Bold.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Caligraphic-Regular.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Caligraphic-Regular.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Caligraphic-Regular.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Fraktur-Bold.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Fraktur-Bold.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Fraktur-Bold.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Fraktur-Regular.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Fraktur-Regular.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Fraktur-Regular.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Main-Bold.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Main-Bold.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Main-Bold.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Main-BoldItalic.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Main-BoldItalic.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Main-BoldItalic.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Main-Italic.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Main-Italic.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Main-Italic.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Main-Regular.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Main-Regular.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Main-Regular.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Math-BoldItalic.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Math-BoldItalic.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Math-BoldItalic.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Math-Italic.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Math-Italic.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Math-Italic.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_SansSerif-Bold.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_SansSerif-Bold.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_SansSerif-Bold.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_SansSerif-Italic.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_SansSerif-Italic.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_SansSerif-Italic.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_SansSerif-Regular.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_SansSerif-Regular.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_SansSerif-Regular.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Script-Regular.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Script-Regular.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Script-Regular.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Size1-Regular.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Size1-Regular.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Size1-Regular.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Size2-Regular.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Size2-Regular.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Size2-Regular.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Size3-Regular.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Size3-Regular.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Size3-Regular.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Size4-Regular.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Size4-Regular.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Size4-Regular.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Typewriter-Regular.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Typewriter-Regular.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].3/dist/fonts/KaTeX_Typewriter-Regular.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_AMS-Regular.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_AMS-Regular.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_AMS-Regular.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Caligraphic-Bold.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Caligraphic-Bold.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Caligraphic-Bold.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Caligraphic-Regular.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Caligraphic-Regular.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Caligraphic-Regular.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Fraktur-Bold.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Fraktur-Bold.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Fraktur-Bold.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Fraktur-Regular.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Fraktur-Regular.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Fraktur-Regular.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Main-Bold.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Main-Bold.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Main-Bold.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Main-BoldItalic.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Main-BoldItalic.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Main-BoldItalic.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Main-Italic.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Main-Italic.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Main-Italic.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Main-Regular.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Main-Regular.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Main-Regular.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Math-BoldItalic.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Math-BoldItalic.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Math-BoldItalic.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Math-Italic.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Math-Italic.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Math-Italic.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_SansSerif-Bold.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_SansSerif-Bold.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_SansSerif-Bold.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_SansSerif-Italic.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_SansSerif-Italic.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_SansSerif-Italic.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_SansSerif-Regular.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_SansSerif-Regular.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_SansSerif-Regular.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Script-Regular.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Script-Regular.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Script-Regular.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Size1-Regular.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Size1-Regular.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Size1-Regular.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Size2-Regular.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Size2-Regular.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Size2-Regular.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Size3-Regular.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Size3-Regular.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Size3-Regular.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Size4-Regular.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Size4-Regular.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Size4-Regular.ttf') format(\\"truetype\\")",
"url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Typewriter-Regular.woff2') format(\\"woff2\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Typewriter-Regular.woff') format(\\"woff\\"),url('https://cdn.jsdelivr.net/npm/[email protected].9/dist/fonts/KaTeX_Typewriter-Regular.ttf') format(\\"truetype\\")",
]
`;

Expand Down
20 changes: 13 additions & 7 deletions test/marp.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Marpit } from '@marp-team/marpit'
import cheerio from 'cheerio'
import cheerio, { CheerioOptions } from 'cheerio'
import postcss from 'postcss'
import { EmojiOptions } from '../src/emoji/emoji'
import { Marp, MarpOptions } from '../src/marp'
Expand All @@ -13,10 +13,11 @@ afterEach(() => jest.restoreAllMocks())
describe('Marp', () => {
const marp = (opts?: MarpOptions): Marp => new Marp(opts)

const loadCheerio = (html: string) =>
const loadCheerio = (html: string, opts?: CheerioOptions) =>
cheerio.load(html, {
lowerCaseAttributeNames: false,
lowerCaseTags: false,
...opts,
})

it('extends Marpit', () => expect(marp()).toBeInstanceOf(Marpit))
Expand Down Expand Up @@ -45,6 +46,9 @@ describe('Marp', () => {
})

it('can enable typographer option by markdown option', () => {
const $original = cheerio.load(marp().markdown.render('"(c)"'))
expect($original('p').text()).toBe('"(c)"')

const $ = cheerio.load(
marp({ markdown: { typographer: true } }).markdown.render('"(c)"')
)
Expand Down Expand Up @@ -604,7 +608,7 @@ describe('Marp', () => {
]) {
it('wraps by <svg data-marp-fitting="svg">', () => {
const { html, comments } = marp().render(markdown)
const $ = loadCheerio(html)
const $ = loadCheerio(html, { xmlMode: true })
const svgContent = $(
[
'h1',
Expand Down Expand Up @@ -634,7 +638,7 @@ describe('Marp', () => {
const markdown = '\tCODE BLOCK'

it('wraps code block by <svg data-marp-fitting="svg">', () => {
const $ = loadCheerio(marp().render(markdown).html)
const $ = loadCheerio(marp().render(markdown).html, { xmlMode: true })
const svgContent = $(
[
'pre',
Expand Down Expand Up @@ -678,7 +682,7 @@ describe('Marp', () => {
const markdown = '```typescript\nconst a = 1\n```'

it('wraps code block by <svg data-marp-fitting="svg">', () => {
const $ = loadCheerio(marp().render(markdown).html)
const $ = loadCheerio(marp().render(markdown).html, { xmlMode: true })
const svgContent = $(
[
'pre',
Expand Down Expand Up @@ -786,11 +790,13 @@ describe('Marp', () => {
const md = (t: string) => `<!-- theme: ${t} -->\n<!-- size: 4:3 -->`

const { html } = instance.render('<!-- size: 4:3 -->')
expect(loadCheerio(html)('foreignObject').attr()).toStrictEqual(size)
expect(
loadCheerio(html, { xmlMode: true })('foreignObject').attr()
).toStrictEqual(size)

for (const theme of instance.themeSet.themes()) {
const { html: themeHtml } = instance.render(md(theme.name))
const $ = loadCheerio(themeHtml)
const $ = loadCheerio(themeHtml, { xmlMode: true })

expect($('foreignObject').attr()).toStrictEqual(size)
}
Expand Down
Loading

0 comments on commit 6bb8102

Please sign in to comment.