Skip to content

Commit

Permalink
Merge pull request #344 from marp-team/twemoji-base-option
Browse files Browse the repository at this point in the history
Fix regression: Not working `emoji.twemoji.base` constructor option
  • Loading branch information
yhatt authored Jun 9, 2023
2 parents da3cfbd + ef6adc4 commit 8d581fc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

## [Unreleased]

### Changed

- Upgrade Marpit to [v2.5.0](https://github.com/marp-team/marpit/releases/v2.5.0) ([#342](https://github.com/marp-team/marp-core/pull/342))
- Added `paginate: skip` and `paginate: hold`

### Fixed

- Regression: Not working `emoji.twemoji.base` constructor option ([#343](https://github.com/marp-team/marp-core/issues/343), [#344](https://github.com/marp-team/marp-core/pull/344))

## v3.6.0 - 2023-04-01

### Added
Expand Down
1 change: 1 addition & 0 deletions src/emoji/emoji.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const markdown = marpitPlugin((md) => {
// Casting to any is a workaround until merging the PR https://github.com/jdecked/twemoji/pull/1
(twemoji as any).parse(content, {
attributes: () => ({ 'data-marp-twemoji': '' }),
base: twemojiOpts.base || undefined,
ext: `.${twemojiExt}`,
size: twemojiExt === 'svg' ? 'svg' : undefined,
})
Expand Down
4 changes: 1 addition & 3 deletions test/marp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,7 @@ describe('Marp', () => {
it('uses specified base', () =>
expect(
emojiSrc(':+1:', instance({ base: '/assets/twemoji/' }))
).toMatchInlineSnapshot(
`"https://cdn.jsdelivr.net/gh/jdecked/[email protected]/assets/svg/1f44d.svg"`
))
).toMatchInlineSnapshot(`"/assets/twemoji/svg/1f44d.svg"`))

it("uses Twemoji's default CDN if the base option was undefined", () =>
expect(
Expand Down

0 comments on commit 8d581fc

Please sign in to comment.