mirror of
https://github.com/doocs/md.git
synced 2024-11-24 19:10:34 +08:00
parent
e98a5b5103
commit
97f42c9d0d
@ -168,14 +168,17 @@ class WxRenderer {
|
||||
return `<ol ${getStyles("ol")}>${text}</ol>`;
|
||||
};
|
||||
renderer.image = (href, title, text) => {
|
||||
let subText = "";
|
||||
if (text) {
|
||||
subText = `<figcaption ${getStyles(
|
||||
"figcaption"
|
||||
)}>${text}</figcaption>`;
|
||||
}
|
||||
let figureStyles = getStyles("figure");
|
||||
let imgStyles = getStyles("image");
|
||||
const createSubText = (s) => {
|
||||
if (!s) {
|
||||
return "";
|
||||
}
|
||||
|
||||
return `<figcaption ${getStyles("figcaption")}>${s}</figcaption>`;
|
||||
};
|
||||
|
||||
const subText = createSubText(title || text);
|
||||
const figureStyles = getStyles("figure");
|
||||
const imgStyles = getStyles("image");
|
||||
return `<figure ${figureStyles}><img ${imgStyles} src="${href}" title="${title}" alt="${text}"/>${subText}</figure>`;
|
||||
};
|
||||
renderer.link = (href, title, text) => {
|
||||
|
Loading…
Reference in New Issue
Block a user