瀏覽代碼

Reverted incomplete fix for "Checklist + card title with starting number and point", because it disabled some markdown. Related #2696

More fixes to GFM checklist not displayed properly in card title, fixes #2818

Thanks to xet7 !
Lauri Ojansivu 4 年之前
父節點
當前提交
bf18792d77
共有 1 個文件被更改,包括 13 次插入20 次删除
  1. 13 20
      packages/markdown/marked/lib/marked.js

+ 13 - 20
packages/markdown/marked/lib/marked.js

@@ -4,22 +4,15 @@
  * https://github.com/markedjs/marked
  */
 
-/*
-Wekan Changes:
-
-Disable list formatting and converting to HTML. Fixes:
-- Checklist + card title with starting number and point
-  https://github.com/wekan/wekan/issues/2696
-- How to begin a card title with "3. "?
-  https://github.com/wekan/wekan/issues/1421
-- GFM checklist not displayed properly in card title #2818
-  https://github.com/wekan/wekan/issues/2818
-
-With below using this code, search with text "Wekan":
-      //var cap = this.rules.block.list.exec(src);
-      // Wekan: do not autonumber lists:
-      cap = false;
-*/
+ /* Wekan changes below, with this same code:
+
+_proto.checkbox = function checkbox(checked) {
+  -      return '<input ' + (checked ? 'checked="" ' : '') + 'disabled="" type="checkbox"' + (this.options.xhtml ? ' /' : '') + '> ';
+  +      // return '<input ' + (checked ? 'checked="" ' : '') + 'disabled="" type="checkbox"' + (this.options.xhtml ? ' /' : '') + '> ';
+  +      // Wekan: Instead of HTML, use unicode checked characters
+  +      return (checked ? '🗹 ' : '☐ ');
+       };
+ */
 
 /**
  * DO NOT EDIT THIS FILE
@@ -601,9 +594,7 @@ With below using this code, search with text "Wekan":
     };
 
     _proto.list = function list(src) {
-      //var cap = this.rules.block.list.exec(src);
-      // Wekan: do not autonumber lists:
-      cap = false;
+      var cap = this.rules.block.list.exec(src);
 
       if (cap) {
         var raw = cap[0];
@@ -1873,7 +1864,9 @@ With below using this code, search with text "Wekan":
     };
 
     _proto.checkbox = function checkbox(checked) {
-      return '<input ' + (checked ? 'checked="" ' : '') + 'disabled="" type="checkbox"' + (this.options.xhtml ? ' /' : '') + '> ';
+      // return '<input ' + (checked ? 'checked="" ' : '') + 'disabled="" type="checkbox"' + (this.options.xhtml ? ' /' : '') + '> ';
+      // Wekan: Instead of HTML, use unicode checked characters
+      return (checked ? '🗹 ' : '☐ ');
     };
 
     _proto.paragraph = function paragraph(text) {