Markdown now follow Github Flavor Markdown, including single line breaks
This commit is contained in:
@@ -23,7 +23,7 @@ function computeInlineCalcsForField(prop, memo, field){
|
||||
dependencies,
|
||||
} = evaluateCalculation({string: calculation, prop, memo, fn: 'compile'});
|
||||
if (result instanceof ErrorNode){
|
||||
result = `<code>${result.toString()}</code>`;
|
||||
result = '`Calculation Error`';
|
||||
}
|
||||
let computation = {
|
||||
calculation,
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
<script>
|
||||
import marked from 'marked';
|
||||
import DOMPurify from 'dompurify';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
@@ -17,10 +16,7 @@
|
||||
computed: {
|
||||
compiledMarkdown() {
|
||||
if (!this.markdown) return;
|
||||
//TODO Markdown <hr> need to be styled to match their vue components
|
||||
let html = marked(this.markdown);
|
||||
let cleanHtml = DOMPurify.sanitize(html);
|
||||
return cleanHtml;
|
||||
return marked(this.markdown);
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
12
app/imports/ui/markdownCofig.js
Normal file
12
app/imports/ui/markdownCofig.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import marked from 'marked';
|
||||
import DOMPurify from 'dompurify';
|
||||
|
||||
marked.setOptions({
|
||||
breaks: true,
|
||||
gfm: true,
|
||||
sanitizer: DOMPurify.sanitize,
|
||||
silent: true,
|
||||
smartLists: true,
|
||||
smartypants: true,
|
||||
baseUrl: 'https://dicecloud.com',
|
||||
});
|
||||
@@ -10,6 +10,7 @@ import 'vuetify/dist/vuetify.min.css';
|
||||
import '/imports/ui/components/global/globalIndex.js';
|
||||
import SvgIconByName from '/imports/ui/icons/SvgIconByName.vue';
|
||||
import SVG_ICONS from '/imports/constants/SVG_ICONS.js';
|
||||
import '/imports/ui/markdownCofig.js';
|
||||
|
||||
let icons = {};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user