From ac2c50c8bcf47c7d10731965ccb36480640a7a05 Mon Sep 17 00:00:00 2001 From: georg Date: Sat, 4 Mar 2017 17:18:30 +0100 Subject: [PATCH 1/3] Fixed background of taskListItem - fixed background bug when using a taskListItem with the light design --- browser/components/markdown.styl | 1 - 1 file changed, 1 deletion(-) diff --git a/browser/components/markdown.styl b/browser/components/markdown.styl index 8034c2a8..e79f2a29 100644 --- a/browser/components/markdown.styl +++ b/browser/components/markdown.styl @@ -78,7 +78,6 @@ body li label.taskListItem margin-left -2em - background-color white div.math-rendered text-align center .math-failed From 57835d0e32bc2ece7def39a004bbe14121542dc0 Mon Sep 17 00:00:00 2001 From: georg Date: Sat, 4 Mar 2017 17:48:17 +0100 Subject: [PATCH 2/3] Added ToC support - added `markdown-it-toc-and-anchor` into the project - integrated it, create a table of contents every in a markup by adding `@[TOC]` --- browser/components/markdown.styl | 2 ++ browser/lib/markdown.js | 4 ++++ package.json | 1 + 3 files changed, 7 insertions(+) diff --git a/browser/components/markdown.styl b/browser/components/markdown.styl index e79f2a29..3f851cf4 100644 --- a/browser/components/markdown.styl +++ b/browser/components/markdown.styl @@ -183,6 +183,8 @@ ul list-style-type circle &>li>ul list-style-type square +ul.markdownIt-TOC, ul.markdownIt-TOC ul + list-style-type none ol list-style-type decimal padding-left 2em diff --git a/browser/lib/markdown.js b/browser/lib/markdown.js index af68b0e3..c4939c06 100644 --- a/browser/lib/markdown.js +++ b/browser/lib/markdown.js @@ -1,6 +1,7 @@ import markdownit from 'markdown-it' import emoji from 'markdown-it-emoji' import math from '@rokt33r/markdown-it-math' +import tocAndAnchor from "markdown-it-toc-and-anchor" import _ from 'lodash' const katex = window.katex @@ -36,6 +37,9 @@ var md = markdownit({ md.use(emoji, { shortcuts: {} }) +md.use(tocAndAnchor, { + anchorLink: false +}) md.use(math, { inlineRenderer: function (str) { let output = '' diff --git a/package.json b/package.json index 70feac66..68d96835 100644 --- a/package.json +++ b/package.json @@ -61,6 +61,7 @@ "markdown-it-checkbox": "^1.1.0", "markdown-it-emoji": "^1.1.1", "markdown-it-footnote": "^3.0.0", + "markdown-it-toc-and-anchor": "^4.1.1", "md5": "^2.0.0", "mixpanel": "^0.4.1", "moment": "^2.10.3", From 850c339bb3c55a6a6e8d99a3e0b96ebfed26de8c Mon Sep 17 00:00:00 2001 From: georg Date: Sat, 4 Mar 2017 18:37:04 +0100 Subject: [PATCH 3/3] bug fix to select all - at least on OSX fixed bug, that would select all text when clicking, opening or any other action was done --- browser/components/markdown.styl | 1 - 1 file changed, 1 deletion(-) diff --git a/browser/components/markdown.styl b/browser/components/markdown.styl index 3f851cf4..9dd769d2 100644 --- a/browser/components/markdown.styl +++ b/browser/components/markdown.styl @@ -54,7 +54,6 @@ body font-family helvetica, arial, sans-serif line-height 1.6 overflow-x hidden - user-select all background-color $ui-noteDetail-backgroundColor .katex font 400 1.2em 'KaTeX_Main'