import QtQml 2.0 import QOwnNotesTypes 1.0 import "markdown-it.js" as MarkdownIt QtObject { property variant md; property string options; property string customStylesheet; property variant settingsVariables: [ { "identifier": "options", "name": "Markdown-it options", "description": "For available options and default values see markdown-it presets.", "type": "text", "default": "{"+"\n"+ " //html: false, // Enable HTML tags in source"+"\n"+ " //xhtmlOut: false, // Use '/' to close single tags (
)"+"\n"+ " //breaks: false, // Convert '\\n' in paragraphs into
"+"\n"+ " //langPrefix: 'language-', // CSS language prefix for fenced blocks"+"\n"+ " //linkify: false, // autoconvert URL-like texts to links"+"\n"+ ""+"\n"+ " // Enable some language-neutral replacements + quotes beautification"+"\n"+ " //typographer: false,"+"\n"+ ""+"\n"+ " // Double + single quotes replacement pairs, when typographer enabled,"+"\n"+ " // and smartquotes on. Could be either a String or an Array."+"\n"+ " //"+"\n"+ " // For example, you can use '«»„“' for Russian, '„“‚‘' for German,"+"\n"+ " // and ['«\\xA0', '\\xA0»', '‹\\xA0', '\\xA0›'] for French (including nbsp)."+"\n"+ " //quotes: '\\u201c\\u201d\\u2018\\u2019', /* “”‘’ */"+"\n"+ ""+"\n"+ " // Highlighter function. Should return escaped HTML,"+"\n"+ " // or '' if the source string is not changed and should be escaped externaly."+"\n"+ " // If result starts with (?:.|\n)*?"))[0]; //Add custom styles head = head.replace("", "table {border-spacing: 0; border-style: solid; border-width: 1px; border-collapse: collapse; margin-top: 0.5em;} th, td {padding: 0 5px;}" + customStylesheet + ""); mdHtml = ""+head+""+mdHtml+""; return mdHtml; } }