Skip to content

Commit 2a977bc

Browse files
committed
fix: markmap api changes in 0.9.3
Signed-off-by: Yukai Huang <[email protected]>
1 parent 3f7d202 commit 2a977bc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

public/js/extra.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import unescapeHTML from 'lodash/unescape'
1212
import isURL from 'validator/lib/isURL'
1313

1414
import { transform } from 'markmap-lib/dist/transform'
15-
import { markmap } from 'markmap-lib/dist/view'
15+
import { Markmap } from 'markmap-lib/dist/view'
1616

1717
import { stripTags } from '../../utils/string'
1818

@@ -561,11 +561,11 @@ export function finishView (view) {
561561
const content = $value.text()
562562
$value.unwrap()
563563
try {
564-
const data = transform(content)
564+
const { root: data } = transform(content)
565565
$elem.html('<div class="markmap-container"><svg></svg></div>')
566-
markmap($elem.find('svg')[0], data, {
566+
Markmap.create($elem.find('svg')[0], {
567567
duration: 0
568-
})
568+
}, data)
569569
} catch (err) {
570570
$elem.html(`<div class="alert alert-warning">${escapeHTML(err)}</div>`)
571571
console.warn(err)

0 commit comments

Comments
 (0)