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

Unexpected default slot in Fence component #219

Open
maiertech opened this issue Sep 8, 2024 · 2 comments
Open

Unexpected default slot in Fence component #219

maiertech opened this issue Sep 8, 2024 · 2 comments

Comments

@maiertech
Copy link

Describe the bug

I am building my own Fence component, similar to the one from the demo: https://github.com/TorstenDittmann/svelte-markdoc-preprocess/blob/main/apps/demo/src/lib/nodes/Fence.svelte.

According to the Markdoc nodes docs, I expect content, language, and process props in my Svelte component. But I also receive a default slot, which seems to contain the same as content. Since my Fence component does not make use of the default slot, I see a console warning <Fence> received an unexpected slot "default"..

I can silence the warning, but I wonder why I am receiving the default slot.

To Reproduce

I have no public reproduction. But this console warning should be visible with the demoFence component mentioned above. It does not use a slot.

Expected behavior

Just pass content, language, and process?

Screenshots

n/a

Desktop (please complete the following information):

n/a

Smartphone (please complete the following information):

n/a

Additional context

n/a

@TorstenDittmann
Copy link
Owner

Its probably caused by markdoc itself and potentially be useful for fallbacks or different approaches to add highlighting :-)

for example hljs can do this:

<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>

<script>hljs.highlightAll();</script>
<pre><code class="language-html">...</code></pre>

I will check nontheless 👍🏻

@maiertech
Copy link
Author

Yes, might be a gap in the Markdoc docs.

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