Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remark-github-alerts doesn't work with MDsveX #665

Open
ryoppippi opened this issue Oct 12, 2024 · 1 comment
Open

remark-github-alerts doesn't work with MDsveX #665

ryoppippi opened this issue Oct 12, 2024 · 1 comment

Comments

@ryoppippi
Copy link

ryoppippi commented Oct 12, 2024

https://github.com/hyoban/remark-github-alerts

Reproduction:

version:

    "mdsvex": "^0.12.3"
    "remark-gh-alerts": "^0.0.3"
import { compile } from 'mdsvex';
import remarkGithubAlerts from 'remark-gh-alerts'

const transformed_code = await compile(`
> [!NOTE]
> Highlights information that users should take into account, even when skimming.

> [!TIP]
> Optional information to help a user be more successful.

> [!IMPORTANT]
> Crucial information necessary for users to succeed.

> [!WARNING]
> Critical content demanding immediate user attention due to potential risks.

> [!CAUTION]
> Negative potential consequences of an action.
`,
  {
    remarkPlugins: [remarkGithubAlerts]
  }
);

console.log(transformed_code.code);

output

<blockquote>
<p>[!NOTE]
Highlights information that users should take into account, even when skimming.</p>
</blockquote>
<blockquote>
<p>[!TIP]
Optional information to help a user be more successful.</p>
</blockquote>
<blockquote>
<p>[!IMPORTANT]
Crucial information necessary for users to succeed.</p>
</blockquote>
<blockquote>
<p>[!WARNING]
Critical content demanding immediate user attention due to potential risks.</p>
</blockquote>
<blockquote>
<p>[!CAUTION]
Negative potential consequences of an action.</p>
</blockquote>

The expected result should include blockquotes with a class like markdown-alert markdown-alert-warning, but the result is not.

Works with other markdown parser plugin (like svelte-exmarkdown), but not MDsveX.

Good Result -> https://svelte-5-preview.vercel.app/#H4sIAAAAAAAAE2WSTW8iMQyG_4o3Fy7Q3ilUQtWqy6EDqljtgSA1JJ6ZiMSZTRzaCvHfV5kZsV-XyHlf-7El-yJq6zCJ-f4iSHkUc7HqOjEV_NmVTzqjYxRTkUKOuiiLpKPt-FGSZOu7EBleVDyZ8E5Qx-BhMtTM8MOP-uRB0pgasYjPltt8XDmMnMaiwZg17Uz18qTwHTJ4A0t4kyzpEfZfqs3u66GE32zTOtu0nMBSHaJXbAMBt4ohJ4wJUhuyM8DqhGCJAyitQyaeAp6R4L1FgnSy3ltq7iQN_N162-M3XcEp9zc8QIuuA9V3gCOCDxEhZa0xpTq7G2b9st287lbVroc9xaztPyzCUqPiJ9QhjhNzGFhobqAfq9dqXT2PGMtWKwc6ECMxGPSKjKUGrPdorGIcJlNc_NLGZCzYLvSCchBtOqUb_mn1fbfeVD2-wkaxPeMfyTpQwp8ZSWOCUIMiULpw7yS9PUgqPoPkzuXGUlrCvmztUh7Jw0a3vTWH_f-bP5S8q6SDpMX976uiBeMHq4gKjpbM_KxcxuXFmyvA_aOkxe3ceu0yNr_2ppgKH4ytLRox55jxerj-Ar7bqD3kAgAA

@github-project-automation github-project-automation bot moved this to Triage + Refine in mdsvex Oct 12, 2024
@ryoppippi
Copy link
Author

Looks like #533 is related the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Triage + Refine
Development

No branches or pull requests

1 participant