1
0
Fork 0
mirror of https://github.com/marty-oehme/scripts.git synced 2024-12-21 15:38:09 +00:00

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

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;
}