就是emacs输入斜体有两种,一种是两个*,一种是两个_,前者很正常,后者的话输出代码的时候就很不方便了啊,虽然在代码块里两个_是失效的,但有时候在代码块外也会偶尔和中文一起输入,求问社区大佬咋办呀
问题不够清楚。是说不想让无意中输入的_
把内容变斜体了?这要找一下markdown怎么输入_
本身
我的意思是,在emacs里写markdown的时候,两个_中间的英文字母会自动变成斜体,我不需要这样的效果,我只需要两个*中间的英文字母变成斜体就好了
改这个正则试试:
(defconst markdown-regex-italic
"\\(?:^\\|[^\\]\\)\\(\\([*_]\\)\\([^ \n\t\\]\\|[^ \n\t*]\\(?:.\\|\n[^\n]\\)*?[^\\ ]\\)\\(\\2\\)\\)"
"Regular expression for matching italic text.
The leading unnumbered matches the character before the opening
asterisk or underscore, if any, ensuring that it is not a
backslash escape.
Group 1 matches the entire expression, including delimiters.
Groups 2 and 4 matches the opening and closing delimiters.
Group 3 matches the text inside the delimiters.")
我知道了,只需要enable gfm-mode就可以了