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

Add custom block type #332

Open
soylomass opened this issue Jan 27, 2025 · 1 comment
Open

Add custom block type #332

soylomass opened this issue Jan 27, 2025 · 1 comment

Comments

@soylomass
Copy link

soylomass commented Jan 27, 2025

Hi,

Is it possible to add a custom type parser, besides those already included?

Use case:

I have strings in the following format:

<think>
Lorem ipsum...
</think>

Rest of the text...

I need to display the text inside with a custom format.

Is there a way to do this with MDC?

@Atulin
Copy link

Atulin commented Jan 28, 2025

Create a component with a slot, like

<script setup lang="ts">
</script>

<template>
  <div class="think">
    </ slot>
  </div>
</template>

<style scoped>
.think {
  ...
}
</style>

and use it with

::think
Lorem ipsum
::

Rest of the text...

?

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

No branches or pull requests

2 participants