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

코드블럭 prism-react-renderer넣기 #31

Closed
byyoungjin opened this issue Mar 8, 2021 · 2 comments · Fixed by #36
Closed

코드블럭 prism-react-renderer넣기 #31

byyoungjin opened this issue Mar 8, 2021 · 2 comments · Fixed by #36

Comments

@byyoungjin
Copy link
Owner

코드 syntax highlight 하기
https://www.npmjs.com/package/prism-react-renderer

@byyoungjin
Copy link
Owner Author

issue 1 plugin 넣는게 힘들었다.

결국 plugin editor onChange handler 에서 block type 확인하고 highlight 해주는 방향으로 설정
withspectrum/draft-js-prism-plugin#8

처음엔 요걸로 할려고했으나, draft.js 와 연동이 필요했다.
https://github.com/FormidableLabs/prism-react-renderer

@byyoungjin
Copy link
Owner Author

현재는 shift+enter 를 해야지만 코드블럭간에 간극이 안생긴다.

block 안에있는 text 를 공백 포함해서 모두 가져오고
아래 라이브러리 이용해서 랜더링 하는방법 고려해보기
https://github.com/FormidableLabs/prism-react-renderer

atomic 으로 잡고 진행?

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

Successfully merging a pull request may close this issue.

1 participant