Compare commits
2 Commits
79aba57dcb
...
e7d2c0e1a9
Author | SHA1 | Date | |
---|---|---|---|
e7d2c0e1a9 | |||
66fe665bf2 |
|
@ -3,7 +3,7 @@ import moment from 'moment'
|
|||
import './styles.scss'
|
||||
import Editor from './editor'
|
||||
import MD from './markdown'
|
||||
import wikiGraph from "./graph";
|
||||
// import wikiGraph from "./graph";
|
||||
import "./sr";
|
||||
|
||||
moment.locale('nl')
|
||||
|
@ -11,9 +11,9 @@ moment.locale('nl')
|
|||
// PrismJS.plugins.filterHighlightAll.reject.addSelector('.language-mermaid')
|
||||
// PrismJS.plugins.filterHighlightAll.reject.addSelector('.language-dot')
|
||||
|
||||
$(function () {
|
||||
setTimeout(() => wikiGraph('.graph-network'), 1);
|
||||
})
|
||||
// $(function () {
|
||||
// setTimeout(() => wikiGraph('.graph-network'), 1);
|
||||
// })
|
||||
|
||||
/*
|
||||
* EVENTS
|
||||
|
|
|
@ -237,6 +237,10 @@ function editor(root, inputData, options) {
|
|||
return {indented: indented, text: '', fold: 'open', hidden: false}
|
||||
}
|
||||
|
||||
function hasMarkdown(text) {
|
||||
return text.match(/[^a-zA-Z0-9 .,!@$&"'?]/)
|
||||
}
|
||||
|
||||
function newItem(value) {
|
||||
let el = document.createElement('div')
|
||||
el.classList.add('list-item')
|
||||
|
@ -253,7 +257,11 @@ function editor(root, inputData, options) {
|
|||
|
||||
line.prepend(content)
|
||||
|
||||
options.transform(value.text, $(content), value.id, EDITOR)
|
||||
if (hasMarkdown(value.text)) {
|
||||
options.transform(value.text, $(content), value.id, EDITOR)
|
||||
} else {
|
||||
$(content).html(value.text)
|
||||
}
|
||||
|
||||
let marker = document.createElement('span')
|
||||
marker.classList.add('marker')
|
||||
|
@ -343,7 +351,12 @@ function editor(root, inputData, options) {
|
|||
|
||||
value.hidden = value.indented >= hideLevel
|
||||
|
||||
options.transform(value.text, $li.find('.content'), value.id, EDITOR)
|
||||
let $content = $li.find('.content');
|
||||
if (hasMarkdown(value.text)) {
|
||||
options.transform(value.text, $content, value.id, EDITOR)
|
||||
} else {
|
||||
$content.html(value.text)
|
||||
}
|
||||
|
||||
if (value.indented < hideLevel) {
|
||||
if (value.fold !== 'open') {
|
||||
|
|
Loading…
Reference in New Issue
Block a user