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

Table render failed. react-markdown + remak-gfm #629

Closed
4 tasks done
luffyZh opened this issue Aug 10, 2021 · 5 comments
Closed
4 tasks done

Table render failed. react-markdown + remak-gfm #629

luffyZh opened this issue Aug 10, 2021 · 5 comments
Labels
👯 no/duplicate Déjà vu 👎 phase/no Post cannot or will not be acted on

Comments

@luffyZh
Copy link

luffyZh commented Aug 10, 2021

Initial checklist

Affected packages and versions

react-markdown: latest remark-gfm: latest

Link to runnable example

No response

Steps to reproduce

image

import ReactMarkdown from "react-markdown";
import gfm from "remark-gfm";

const value = `
# 标题1

## 标题2

可以的,写得不错

## 代码

## 图片

![](https://musicfe.nos-jd.163yun.com/582d36e7-9097-4e14-a269-047ba2c41ea5.png)

## 表格
|  表头   | 表头  |
|  ----  | ---- |
| 单元格  | 单元格 |
| 单元格  | 单元格 |
`;

export default function App() {
  return (
    <div>
      <ReactMarkdown remarkPlugins={[gfm]} children={value} />
    </div>
  );
}

https://codesandbox.io/s/crimson-rain-uzxig?file=/src/App.js

Expected behavior

no crash,no throw error,table render normal

Actual behavior

Throw Error

Runtime

Node v14

Package manager

npm v6

OS

macOS

Build and bundle tools

Webpack

@sdjnes
Copy link

sdjnes commented Aug 10, 2021

Also experiencing the same problem.

It seems the issue is with remark-gfm@2.0.0. An interim solution is to downgrade to 1.0.0.

@luffyZh
Copy link
Author

luffyZh commented Aug 10, 2021

@sdjnes yes,downgrade 1.0.0 works, but i think the bug needs to be fixed~

@wooorm
Copy link
Member

wooorm commented Aug 10, 2021

#626

@wooorm
Copy link
Member

wooorm commented Aug 13, 2021

Solved in 02bac83

@wooorm wooorm closed this as completed Aug 13, 2021
@github-actions

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👯 no/duplicate Déjà vu 👎 phase/no Post cannot or will not be acted on
Development

No branches or pull requests

4 participants