浏览代码

Don't escape formatting in code

close #146
Markus-Rost 4 年之前
父节点
当前提交
f6cd818ff8
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      util/functions.js

+ 2 - 1
util/functions.js

@@ -280,7 +280,8 @@ function htmlToDiscord(html, serverpath = '', ...escapeArgs) {
 		ontext: (htmltext) => {
 			if ( !reference ) {
 				if ( href && !code ) htmltext = htmltext.replace( /[\[\]]/g, '\\$&' );
-				text += escapeFormatting(htmltext, ...escapeArgs);
+				if ( code ) text += htmltext.replace( /`/g, 'ˋ' );
+				else text += escapeFormatting(htmltext, ...escapeArgs);
 			}
 		},
 		onclosetag: (tagname) => {