fix: update wx-renderer.js

修复图片渲染多出上下空行的问题
This commit is contained in:
yanglbme 2020-06-22 17:30:42 +08:00
parent d1db8a8c0a
commit 1f07dd39c6

View File

@ -112,7 +112,10 @@ const WxRenderer = function (opts) {
}
}
renderer.paragraph = text => {
return text.replace(/ /g, '') === '' ? '' : `<p ${getStyles('p')}>${text}</p>`
if (text.indexOf('<figure') != -1 && text.indexOf('<img') != -1) {
return text;
}
return text.replace(/ /g, '') === '' ? '' : `<p ${getStyles('p')}>${text}</p>`
}
renderer.blockquote = text => {