Skip to content

Commit 8936d8b

Browse files
committed
updated to code to pass test
1 parent 14fec74 commit 8936d8b

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

browser/components/MarkdownPreview.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,10 @@ export default class MarkdownPreview extends React.Component {
483483
eventEmitter.on('export:save-md', this.saveAsMdHandler)
484484
eventEmitter.on('export:save-html', this.saveAsHtmlHandler)
485485
eventEmitter.on('print', this.printHandler)
486-
eventEmitter.on('config-renew', this.rewriteIframe.bind(this))
486+
eventEmitter.on('config-renew', () => {
487+
this.markdown.updateConfig()
488+
this.rewriteIframe()
489+
})
487490
}
488491

489492
componentWillUnmount () {

browser/lib/markdown.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,9 @@ class Markdown {
265265
}
266266
// FIXME We should not depend on global variable.
267267
window.md = this.md
268-
ee.on('config-renew', () => {
268+
this.updateConfig = () => {
269269
config = ConfigManager.get()
270-
})
270+
}
271271
}
272272

273273
render (content) {

tests/lib/snapshots/markdown-test.js.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Generated by [AVA](https://ava.li).
3131
3232
`<ul>␊
3333
<li class="taskListItem"><input type="checkbox" id="checkbox-2" /> Unchecked</li>␊
34-
<li class="taskListItem"><input type="checkbox" checked id="checkbox-3" /> Checked</li>␊
34+
<li class="taskListItem checked"><input type="checkbox" checked id="checkbox-3" /> Checked</li>␊
3535
</ul>␊
3636
`
3737

5 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)