improved regular expression

This commit is contained in:
Patrizio Bekerle 2018-09-04 06:19:37 +02:00 committed by GitHub
parent 40a3ba0e20
commit 660fc57c82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -17,8 +17,7 @@ QtObject {
function noteToMarkdownHtmlHook(note, html) {
// see http://doc.qt.io/qt-5/richtext-html-subset.html for a list of
// supported css styles
html = html.replace(/<li>(\s*)(<p>)*(\s*)\[x\]/g, "<li style=\"list-style-type: none; margin-left: -16px;\">$1$2$3&#x2611;");
html = html.replace(/<li>(\s*)(<p>)*(\s*)\[X\]/g, "<li style=\"list-style-type: none; margin-left: -16px;\">$1$2$3&#x2611;");
html = html.replace(/<li>(\s*)(<p>)*(\s*)\[[xX]\]/g, "<li style=\"list-style-type: none; margin-left: -16px;\">$1$2$3&#x2611;");
html = html.replace(/<li>(\s*)(<p>)*(\s*)\[ \]/g, "<li style=\"list-style-type: none; margin-left: -16px;\">$1$2$3&#x2610;");
return html;
}