Skip to content

Commit

Permalink
Merge pull request #45 from valentine195:valentine195/issue44
Browse files Browse the repository at this point in the history
`collapse:` no longer defaults to closed
  • Loading branch information
valentine195 authored Jun 7, 2021
2 parents 78bdce2 + d138c7d commit d2dc466
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "obsidian-admonition",
"name": "Admonition",
"version": "5.0.2",
"version": "5.0.3",
"minAppVersion": "0.11.0",
"description": "Admonition block-styled content for Obsidian.md",
"author": "Jeremy Valentine",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obsidian-admonition",
"version": "5.0.2",
"version": "5.0.3",
"description": "Admonition block-styled content for Obsidian.md",
"main": "main.js",
"scripts": {
Expand Down
10 changes: 2 additions & 8 deletions src/util/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ export function getParametersFromSource(type: string, src: string) {
* If the admonition should collapse, but something other than open or closed was provided, set to closed.
*/
if (
collapse &&
collapse.length &&
collapse !== undefined &&
collapse !== "none" &&
collapse !== "open" &&
collapse !== "closed"
Expand All @@ -91,12 +90,7 @@ export function getParametersFromSource(type: string, src: string) {
/**
* If the admonition should collapse, but title was blanked, set the default title.
*/
if (
title.trim() === "" &&
collapse &&
collapse.length &&
collapse !== "none"
) {
if (title.trim() === "" && collapse !== undefined && collapse !== "none") {
title = type[0].toUpperCase() + type.slice(1).toLowerCase();
new Notice("An admonition must have a title if it is collapsible.");
}
Expand Down
2 changes: 1 addition & 1 deletion versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"4.2.1": "0.11.0",
"4.3.1": "0.12.0",
"4.4.2": "0.12.2",
"5.0.2": "0.12.2"
"5.0.3": "0.12.2"
}

0 comments on commit d2dc466

Please sign in to comment.