Skip to content

Commit b3bd5c2

Browse files
committed
fix: admonitions without titles properly display again (close #131)
1 parent ac208d4 commit b3bd5c2

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/main.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -848,8 +848,11 @@ title:
848848
* Replace the <pre> tag with the new admonition.
849849
*/
850850
const parent = el.parentElement;
851-
if (parent && !parent.hasClass('admonition-content')) {
852-
parent.addClass('admonition-parent', `admonition-${type}-parent`)
851+
if (parent && !parent.hasClass("admonition-content")) {
852+
parent.addClass(
853+
"admonition-parent",
854+
`admonition-${type}-parent`
855+
);
853856
}
854857
el.replaceWith(admonitionElement);
855858
return admonitionElement;

src/util/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export function getParametersFromSource(
105105
collapse = "closed";
106106
}
107107

108-
if (!title || !title.length) {
108+
if (!("title" in params)) {
109109
if (!admonition.noTitle) {
110110
title = admonitionTitle;
111111
}

0 commit comments

Comments
 (0)