fix: update wx-renderer.js

This commit is contained in:
Yang Libin 2020-06-21 18:24:18 +08:00 committed by GitHub
parent 0839325ebc
commit d1db8a8c0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -111,7 +111,9 @@ const WxRenderer = function (opts) {
return `<h4 ${getStyles('h4')}>${text}</h4>`
}
}
renderer.paragraph = text => `<p ${getStyles('p')}>${text}</p>`
renderer.paragraph = text => {
return text.replace(/ /g, '') === '' ? '' : `<p ${getStyles('p')}>${text}</p>`
}
renderer.blockquote = text => {
text = text.replace(/<p.*?>/, `<p ${getStyles('blockquote_p')}>`)