Skip to content

Commit

Permalink
fix: admonitions without titles properly display again (close #131)
Browse files Browse the repository at this point in the history
  • Loading branch information
valentine195 committed Nov 29, 2021
1 parent ac208d4 commit b3bd5c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -848,8 +848,11 @@ title:
* Replace the <pre> tag with the new admonition.
*/
const parent = el.parentElement;
if (parent && !parent.hasClass('admonition-content')) {
parent.addClass('admonition-parent', `admonition-${type}-parent`)
if (parent && !parent.hasClass("admonition-content")) {
parent.addClass(
"admonition-parent",
`admonition-${type}-parent`
);
}
el.replaceWith(admonitionElement);
return admonitionElement;
Expand Down
2 changes: 1 addition & 1 deletion src/util/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export function getParametersFromSource(
collapse = "closed";
}

if (!title || !title.length) {
if (!("title" in params)) {
if (!admonition.noTitle) {
title = admonitionTitle;
}
Expand Down

0 comments on commit b3bd5c2

Please sign in to comment.