8
0
fredck 5 лет назад
Родитель
Сommit
6f52851a85

+ 1 - 1
packages/ckeditor5-markdown-gfm/package.json

@@ -12,7 +12,7 @@
   "dependencies": {
     "@ckeditor/ckeditor5-core": "^21.0.0",
     "@ckeditor/ckeditor5-engine": "^21.0.0",
-    "marked": "^0.7.0",
+    "marked": "^1.1.1",
     "turndown": "^6.0.0",
     "turndown-plugin-gfm": "^1.0.2"
   },

+ 9 - 4
packages/ckeditor5-markdown-gfm/src/markdown2html/markdown2html.js

@@ -9,6 +9,15 @@
 
 import marked from 'marked';
 
+// Overrides.
+marked.use( {
+	tokenizer: {
+		// Disable the autolink rule in the lexer.
+		autolink: () => null,
+		url: () => null
+	}
+} );
+
 /**
  * Parses markdown string to an HTML.
  *
@@ -26,7 +35,3 @@ export default function markdown2html( markdown ) {
 }
 
 export { marked };
-
-// Disable the autolink rule in the lexer (point it to a regex that always fail).
-marked.InlineLexer.rules.breaks.autolink = /^\b$/;
-marked.InlineLexer.rules.breaks.url = /^\b$/;