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

Hydration error #70

Closed
teleskop150750 opened this issue Sep 25, 2024 · 3 comments · Fixed by #71
Closed

Hydration error #70

teleskop150750 opened this issue Sep 25, 2024 · 3 comments · Fixed by #71
Labels
wontfix This will not be worked on

Comments

@teleskop150750
Copy link

2024-09-25.12-57-45.mp4
@ubugeeei
Copy link
Owner

@teleskop150750

Thank you for the submission!
It seems to be a VitePress issue, so I’ve created an issue there.

vuejs/vitepress#4231

@ubugeeei ubugeeei added the wontfix This will not be worked on label Sep 25, 2024
@brc-dd
Copy link

brc-dd commented Sep 25, 2024

adjust https://github.com/ubugeeei/reading-vuejs-core-vapor/blob/main/.vitepress/plugins/markdown-it/github/index.ts to this:

export const previewGitHubSource: PluginSimple = (md) => {
  md.block.ruler.before('paragraph', 'github_link_block', (state, startLine) => {
    const lineText = state.getLines(startLine, startLine + 1, state.blkIndent, false).trim()

    if (!isGithubUrl(lineText)) {
      return false
    }

    const token = state.push('github_link', '', 0)
    token.content = lineText
    token.map = [startLine, startLine + 1]

    state.line = startLine + 1

    return true
  })

  md.renderer.rules.github_link = (tokens, idx) => {
    const c = tokens[idx].content
    const rawHtml = fetchHtmlSync(c)
    const parsed = parse(rawHtml, c)
    const res = renderToHtml(parsed)
    return res
  }
}

@ubugeeei
Copy link
Owner

Wow... how kind you are...
Even though I was just writing the plugin incorrectly, you went as far as proposing code to the repository.
It’s completely fixed! Thank you so much...! 💚

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants