From 6eb290781d11992e75c8ab74825c158f4156b7cd Mon Sep 17 00:00:00 2001 From: NGPixel Date: Sun, 25 Feb 2018 12:59:59 -0500 Subject: [PATCH] feat: editor preview tabs, abbr, sup, sub, mark and img size --- client/components/editor-code.vue | 14 ++++++++++++++ client/scss/components/markdown-content.scss | 4 ++++ dev/webpack/webpack.common.js | 3 +++ package.json | 4 ++++ yarn.lock | 16 ++++++++++++++++ 5 files changed, 41 insertions(+) diff --git a/client/components/editor-code.vue b/client/components/editor-code.vue index 05e5545a..cf0633b9 100644 --- a/client/components/editor-code.vue +++ b/client/components/editor-code.vue @@ -113,6 +113,14 @@ import 'codemirror/addon/search/match-highlighter.js' import MarkdownIt from 'markdown-it' import mdEmoji from 'markdown-it-emoji' import mdTaskLists from 'markdown-it-task-lists' +import mdExpandTabs from 'markdown-it-expand-tabs' +import mdAbbr from 'markdown-it-abbr' +import mdSup from 'markdown-it-sup' +import mdSub from 'markdown-it-sub' +import mdMark from 'markdown-it-mark' +import mdImsize from 'markdown-it-imsize' + +// Prism (Syntax Highlighting) import Prism from '../libs/prism/prism.js' const md = new MarkdownIt({ @@ -126,6 +134,12 @@ const md = new MarkdownIt({ }) .use(mdEmoji) .use(mdTaskLists) + .use(mdExpandTabs) + .use(mdAbbr) + .use(mdSup) + .use(mdSub) + .use(mdMark) + .use(mdImsize) export default { components: { diff --git a/client/scss/components/markdown-content.scss b/client/scss/components/markdown-content.scss index 01b5450b..c78b32e0 100644 --- a/client/scss/components/markdown-content.scss +++ b/client/scss/components/markdown-content.scss @@ -39,6 +39,10 @@ font-size: 1.025rem; } + p + p { + margin-top: 1rem; + } + // -------------------------------------------- // Code Blocks // -------------------------------------------- diff --git a/dev/webpack/webpack.common.js b/dev/webpack/webpack.common.js index 6266ae43..23593548 100644 --- a/dev/webpack/webpack.common.js +++ b/dev/webpack/webpack.common.js @@ -247,5 +247,8 @@ module.exports = { 'node_modules' ] }, + node: { + fs: 'empty' + }, target: 'web' } diff --git a/package.json b/package.json index 43257742..96aed926 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,11 @@ "markdown-it-expand-tabs": "1.0.12", "markdown-it-external-links": "0.0.6", "markdown-it-footnote": "3.0.1", + "markdown-it-imsize": "2.0.1", + "markdown-it-mark": "2.0.0", "markdown-it-mathjax": "2.0.0", + "markdown-it-sub": "1.0.0", + "markdown-it-sup": "1.0.0", "markdown-it-task-lists": "2.1.0", "mathjax-node": "2.0.1", "mime-types": "2.1.18", diff --git a/yarn.lock b/yarn.lock index 8907f751..a211a959 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6348,10 +6348,26 @@ markdown-it-footnote@3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/markdown-it-footnote/-/markdown-it-footnote-3.0.1.tgz#7f3730747cacc86e2fe0bf8a17a710f34791517a" +markdown-it-imsize@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/markdown-it-imsize/-/markdown-it-imsize-2.0.1.tgz#cca0427905d05338a247cb9ca9d968c5cddd5170" + +markdown-it-mark@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/markdown-it-mark/-/markdown-it-mark-2.0.0.tgz#46a1aa947105aed8188978e0a016179e404f42c7" + markdown-it-mathjax@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/markdown-it-mathjax/-/markdown-it-mathjax-2.0.0.tgz#ae2b4f4c5c719a03f9e475c664f7b2685231d9e9" +markdown-it-sub@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/markdown-it-sub/-/markdown-it-sub-1.0.0.tgz#375fd6026eae7ddcb012497f6411195ea1e3afe8" + +markdown-it-sup@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/markdown-it-sup/-/markdown-it-sup-1.0.0.tgz#cb9c9ff91a5255ac08f3fd3d63286e15df0a1fc3" + markdown-it-task-lists@2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/markdown-it-task-lists/-/markdown-it-task-lists-2.1.0.tgz#4594f750f70df053d1dad68024388007c1d20783"