From a6bd239592c9224f8f81763c6dac33ae3c63de90 Mon Sep 17 00:00:00 2001 From: asmsuechan Date: Thu, 9 Mar 2017 13:04:14 -0800 Subject: [PATCH] Fix the design of li * fix the design of markdown-it-TOC --- browser/components/MarkdownPreview.js | 4 ++++ browser/components/markdown.styl | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/browser/components/MarkdownPreview.js b/browser/components/MarkdownPreview.js index c8e9374b..1802139e 100644 --- a/browser/components/MarkdownPreview.js +++ b/browser/components/MarkdownPreview.js @@ -243,6 +243,10 @@ export default class MarkdownPreview extends React.Component { this.refs.root.contentWindow.document.body.setAttribute('data-theme', theme) this.refs.root.contentWindow.document.body.innerHTML = markdown.render(value) + _.forEach(this.refs.root.contentWindow.document.querySelectorAll('.taskListItem'), (el) => { + el.parentNode.parentNode.style.listStyleType = 'none' + }) + _.forEach(this.refs.root.contentWindow.document.querySelectorAll('a'), (el) => { el.addEventListener('click', this.anchorClickHandler) }) diff --git a/browser/components/markdown.styl b/browser/components/markdown.styl index 9dd769d2..e94ebae8 100644 --- a/browser/components/markdown.styl +++ b/browser/components/markdown.styl @@ -182,8 +182,18 @@ ul list-style-type circle &>li>ul list-style-type square -ul.markdownIt-TOC, ul.markdownIt-TOC ul - list-style-type none +ul.markdownIt-TOC + list-style-type decimal + background-color #ffffff + padding-top 10px + padding-bottom 10px + ul + list-style-type none + a + text-decoration none + color #000000 + a:hover + color #2bac8f ol list-style-type decimal padding-left 2em