feat: update wx renderer

This commit is contained in:
yanglbme 2021-01-25 09:49:58 +08:00
parent e300fbcefb
commit c7eea12c2a

View File

@ -184,7 +184,7 @@ class WxRenderer {
return `<figure ${figureStyles}><img ${imgStyles} src="${href}" title="${title}" alt="${text}"/>${subText}</figure>`; return `<figure ${figureStyles}><img ${imgStyles} src="${href}" title="${title}" alt="${text}"/>${subText}</figure>`;
}; };
renderer.link = (href, title, text) => { renderer.link = (href, title, text) => {
if (href.indexOf("https://mp.weixin.qq.com") === 0) { if (href.startsWith("https://mp.weixin.qq.com")) {
return `<a href="${href}" title="${ return `<a href="${href}" title="${
title || text title || text
}" ${getStyles("wx_link")}>${text}</a>`; }" ${getStyles("wx_link")}>${text}</a>`;
@ -205,7 +205,6 @@ class WxRenderer {
`<section style="padding:0 8px;"><table class="preview-table"><thead ${getStyles( `<section style="padding:0 8px;"><table class="preview-table"><thead ${getStyles(
"thead" "thead"
)}>${header}</thead><tbody>${body}</tbody></table></section>`; )}>${header}</thead><tbody>${body}</tbody></table></section>`;
// renderer.tablerow = (text) => `<tr style="">${text}</tr>`;
renderer.tablecell = (text, flags) => renderer.tablecell = (text, flags) =>
`<td ${getStyles("td")}>${text}</td>`; `<td ${getStyles("td")}>${text}</td>`;
renderer.hr = () => renderer.hr = () =>