unplugin / unplugin-vue-markdown

Compile Markdown to Vue component
MIT License
508 stars 27 forks source link

Is there a way to escape parsing? #15

Closed Thevetat closed 1 year ago

Thevetat commented 1 year ago

Currently I have been using vite-plugin-pages along with this to serve .md files directly as pages.

This has been working great up until I tried to use an html or vue tag.

<script setup lang="ts">
import HelloWorld from './components/HelloWorld.vue'
</script>

<template>
  <div>
    <a href="https://vitejs.dev" target="_blank">
      <img src="/vite.svg" class="logo" alt="Vite logo" />
    </a>
    <a href="https://vuejs.org/" target="_blank">
      <img src="./assets/vue.svg" class="logo vue" alt="Vue logo" />
    </a>
  </div>
  <HelloWorld msg="Vite + Vue" />
</template>

<style scoped>
.logo {
  height: 6em;
  padding: 1.5em;
  will-change: filter;
  transition: filter 300ms;
}
.logo:hover {
  filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.vue:hover {
  filter: drop-shadow(0 0 2em #42b883aa);
}
</style>

Will break site rendering, whereas this

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
})

Will not. Incase Markdown takes over here, I am talking about a fenced html or vue codeblock, vs any other block. Is this a current limitation or something I could resolve potentially? Thank you all.

meteorlxy commented 1 year ago

I'm not quite sure about your problem. Could you provide a reproduce repo for that?

Thevetat commented 1 year ago

I just tried to recreate the issue on a stackblitz and was unable to. This leads me to believe there is a problem with this specifics projects configuration. I will close this issue for now, and if I am able to recreate it exactly, I will reopen. Thank you for the fast response :+1: