[feat] sidebar widget: markdown.src

This commit is contained in:
xaoxuu 2024-01-11 23:39:36 +08:00
parent 257225478e
commit e301eb585a
1 changed files with 7 additions and 2 deletions

View File

@ -1,6 +1,6 @@
<%
function layoutDiv() {
if (!item.content?.length) return ''
if (!item.content?.length && !item.src?.length) return ''
var el = '';
el += '<widget class="widget-wrapper markdown">';
if (item.title?.length > 0) {
@ -9,7 +9,12 @@ function layoutDiv() {
el += '</div>';
}
el += '<div class="widget-body fs14">';
el += markdown(item.content);
if (item.content) {
el += markdown(item.content);
}
if (item.src) {
el += `<div class="stellar-marked-api md-marked" src="${item.src}"></div>`
}
el += '</div>';
el += '</widget>';
return el;