From bbb6b4441625c8aaec72604236944c7075d77308 Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Mon, 15 Jun 2020 22:39:16 +0200 Subject: [PATCH] Improve highlighting and linking --- editor/src/index.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/editor/src/index.js b/editor/src/index.js index f9740da..11573f5 100644 --- a/editor/src/index.js +++ b/editor/src/index.js @@ -14,7 +14,11 @@ import getCaretCoordinates from './caret-position' import moment from 'moment' import PrismJS from 'prismjs' import 'prismjs/components/prism-php' +import 'prismjs/components/prism-go' +import 'prismjs/components/prism-perl' +import 'prismjs/components/prism-css' import 'prismjs/components/prism-markup-templating' +import 'prismjs/components/prism-jq' import './styles.scss'; import '../node_modules/jquery-contextmenu/dist/jquery.contextMenu.css'; @@ -174,14 +178,16 @@ $(document).on('popup:selected', '#autocomplete', function (event, linkName, res }) if (holder) { - const MD = new MarkdownIt() + const MD = new MarkdownIt({ + linkify: true + }) MD.use(MarkdownItWikilinks({ baseURL: holder.dataset.baseUrl, uriSuffix: '', relativeBaseURL: '/edit/', htmlAttributes: { class: 'wiki-link' - } + }, })).use(MarkdownItMark) const options = { @@ -317,6 +323,7 @@ if (holder) { } if (searchEnabled && event.key === 'Escape') { searchEnabled = false + return false; } let value = input.value