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

Client side render: parseMarkdown returns null on Safari for iOS 16 and below #280

Open
JayChuan opened this issue Nov 14, 2024 · 2 comments

Comments

@JayChuan
Copy link

app.vue

<template>
  <div>
    <nuxt-link to="/">Home</nuxt-link>
    <br />
    <nuxt-link href="/article">Article</nuxt-link>
    <NuxtPage />
  </div>
</template>

/pages/article

<template>
  <section class="article">
<!--    <MDC :value="`# heading 1`" tag="article" />-->  <! -- not work -->
    <MDCRenderer :data="ast?.data" :body="ast?.body" />
  </section>
</template>
<script lang="ts" setup>
import { parseMarkdown } from '@nuxtjs/mdc/runtime'
const props = defineProps({
  content: { type: String, required: true },
})
const { data: ast } = await useAsyncData('markdown', () => parseMarkdown(`# heading 1`))
console.log('AST: ', ast) // returns null  on Safari for iOS 16

</script>

Client side: click to article page,returns null on Safari for iOS 16 and below

@farnabaz
Copy link
Collaborator

Unfortunately, I don't have access to iOS 16 to reproduce it.

Do you have ay error log in the console? What error do you get in asyndata?

const { data: last, error } = await useAsyncData('markdown', () => parseMarkdown(`# heading 1`))

console.log(error)

@JayChuan
Copy link
Author

Thanks for your help!

I got this error: Error: Invalid regular expression: invalid group specifier name

I guess some regex patterns of MDC are not supported on Safari for iOS 16 and below.

Looking forward to your reply.

Thank you again!

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