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

Localize markdown-it-container #3

Open
Martien opened this issue Dec 14, 2024 · 0 comments
Open

Localize markdown-it-container #3

Martien opened this issue Dec 14, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Martien
Copy link
Owner

Martien commented Dec 14, 2024

Behaviour like in the live demo at css-class-warning-lang-nl, using markdown-it-container like so:

::: warning
*here be dragons*
:::

results in:

<div class="warning">
  <em>here be dragons</em>
</div>

Likewise, it would be nice if:

::: warning lang=nl
*hier zijn draken*
:::

and joined at the hip with the proper css:

.warning::before {
    content: "Warning: ";
    color: red;
    font-weight: bold;
}
.warning:lang(nl)::before {
    content: "Pas op! ";
}

results in:

<div class="warning" lang="nl">
  <em>here be dragons</em>
</div>

and its rendering:

Pas op! hier zijn draken

In fact, everything that follows the class name can be copied as is into the corresponding <div> declaration.

@Martien Martien added the enhancement New feature or request label Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant