Skip to content

Commit 5d24b6d

Browse files
committed
Remove space between classes in admonition
1 parent 98656b0 commit 5d24b6d

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tests/fixtures/*.md

src/directives/admonitions.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ class BaseAdmonition extends Directive {
2424
// we create an overall container, then individual containers for the title and body
2525

2626
const adToken = this.createToken("admonition_open", "aside", 1, { map: data.map })
27-
adToken.attrSet("class", `admonition ${this.title.toLowerCase()}`)
27+
adToken.attrSet("class", "admonition")
28+
if (this.title) adToken.attrJoin("class", this.title.toLowerCase())
2829
if (data.options.class) {
2930
adToken.attrJoin("class", data.options.class.join(" "))
3031
}

tests/fixtures/directives.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ admonition
1616
Some *content*
1717
```
1818
.
19-
<aside class="admonition "><p class="admonition-title">A <strong>Title</strong></p><div class="admonition-body"><p>Some <em>content</em></p>
19+
<aside class="admonition"><p class="admonition-title">A <strong>Title</strong></p><div class="admonition-body"><p>Some <em>content</em></p>
2020
</div></aside>
2121
.
2222

0 commit comments

Comments
 (0)