-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用html标签的时候换行会被认为是换行 #422
Comments
It may be a bug of marked. I'm trying to fix it. |
@tommy351 这个确实存在,把html放在一行很丑... |
找到一个workaround: 首先marked.setOptions中保证 breaks: false, 关闭gfm下的断行输出: marked.setOptions({
gfm: true,
pedantic: false,
sanitize: false,
tables: true,
breaks: false,
smartLists: true,
smartypants: true,
renderer: r,
langPrefix: '',
highlight: function(code, lang){
return highlight(code, {lang: lang, gutter: false, wrap: false});
}
}); 然后再使用lexer: module.exports = function(data, options){
headingId = {};
var tokens = marked.lexer(data.text, options);
return marked.parser(tokens)
}; 两个同时使用才生效,没搞懂为啥直接改options没有用,应该是marked的bug吧。 |
@winterland1989 The main reason should be the |
最新版本修复了没?要是修复了,就关了吧。 |
为什么我用2.8.3最新版本还是存在table前面很多空行的情况? |
the bug is still remained. |
Ref #1388 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
比如写一个简单的表格
如果html标签之间有换行的话,hexo会先去处理这些换行,然后再处理html标签的内容,这会导致很大的一个空白。不知道算是bug还是系统无法避免的东西。解决的方式是把html全部放在一行就行
The text was updated successfully, but these errors were encountered: