Explorar o código

:memo: 加注释

visuddhinanda %!s(int64=3) %!d(string=hai) anos
pai
achega
63a4de9025
Modificáronse 1 ficheiros con 5 adicións e 2 borrados
  1. 5 2
      public/app/term/note.js

+ 5 - 2
public/app/term/note.js

@@ -91,8 +91,11 @@ function note_sent_edit_dlg_init() {
 function note_init(input,channel="",editor="",lang="en") {
 	if (input) {
 		let output = "<div>";
-		//output += marked(input);
-		//output += marked(term_std_str_to_tran(input, channel, editor, lang), { renderer: note_renderer });
+		/*
+		 * **[[术语]]** marked不会渲染成黑体
+		 * 所以要在渲染markdown前先把[[]]两边加中文引号
+		 *  在渲染后再去掉中文引号
+		 */
 		let newText = input.replace(/\[\[/g,'“[[');
 		newText = newText.replace(/\]\]/g,']]”');
 		let markdown = marked(newText, { renderer: note_renderer });