r4ai / remark-callout

A remark plugin to add obsidian style callouts to markdown
https://r4ai.github.io/remark-callout/
MIT License
4 stars 1 forks source link

fix: don't render an empty paragraph when the callout body is empty #144

Closed r4ai closed 1 month ago

r4ai commented 1 month ago

fix #134

Fixed the issue where an empty paragraph was rendered when the callout body was empty. As a result, empty paragraphs will no longer be rendered for callouts without a title.

For insance,

> [!note]

yieds:

before:

<div data-callout data-callout-type="note">
  <div data-callout-title>Note</div>
  <div data-callout-body>
    <p></p>
  </div>
</div>

after:

<div data-callout="" data-callout-type="note">
  <div data-callout-title="">Note</div>
  <div data-callout-body="">
  </div>
</div>
changeset-bot[bot] commented 1 month ago

🦋 Changeset detected

Latest commit: bb837e11e16e20f6559991b8be4add336c97f127

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | -------------------- | ----- | | @r4ai/remark-callout | Minor |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Files Coverage Δ
packages/remark-callout/src/plugin.ts 98.01% <100.00%> (+0.06%) :arrow_up: