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