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>`;
|
return `<ol ${getStyles("ol")}>${text}</ol>`;
|
||||||
};
|
};
|
||||||
renderer.image = (href, title, text) => {
|
renderer.image = (href, title, text) => {
|
||||||
let subText = "";
|
const createSubText = (s) => {
|
||||||
if (text) {
|
if (!s) {
|
||||||
subText = `<figcaption ${getStyles(
|
return "";
|
||||||
"figcaption"
|
|
||||||
)}>${text}</figcaption>`;
|
|
||||||
}
|
}
|
||||||
let figureStyles = getStyles("figure");
|
|
||||||
let imgStyles = getStyles("image");
|
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>`;
|
return `<figure ${figureStyles}><img ${imgStyles} src="${href}" title="${title}" alt="${text}"/>${subText}</figure>`;
|
||||||
};
|
};
|
||||||
renderer.link = (href, title, text) => {
|
renderer.link = (href, title, text) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user