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

[FIX] Notion Token Error #185

Merged
merged 2 commits into from
May 20, 2023
Merged

[FIX] Notion Token Error #185

merged 2 commits into from
May 20, 2023

Conversation

WhiteHyun
Copy link
Contributor

@WhiteHyun WhiteHyun commented May 18, 2023

Description

현재 main 브랜치에서 JavaScript 외 여러 코드들이 토큰처리가 되지 않은 채 rawString으로 들어가고 있습니다. 이 이슈는 React Notion X에서도 언급이 되고 있는데[1], 공식문서에 따르면, 아래와 같이 써져있습니다.[2]

The Code component uses Prism under the hood. It comes bundled with support for JavaScript, TypeScript, and CSS by default. To add support for additional language syntaxes, follow the example in components/NotionPage.tsx which lazily loads Prism components at runtime.

즉, 여러 언어를 지원하기 위해 const Code = dynamic(() => 내부에 여러 언어 정보를 import해야하는데, 이 때 prism을 인식하지 못해서 index.d.ts도 별도로 추가하여 구현했습니다.

참고로 다른 언어들은 해결이 되었는데 C++만 토큰 처리가 되어있지 않아 확인해보니, 태그가 language-c++로 들어가지더라구요. prism에서는 cpp로 들어가야 인식이 되는 것이다 보니 notion쪽에서 수정해주지 않는 한 어찌할 방도가 없을 것 같습니다..

language-c++ screenshots

image

Screenshots

Before & After
before after
Screenshot 2023-05-16 at 3 51 40 PM Screenshot 2023-05-16 at 3 50 27 PM

Related tickets

PR Checklist

References

  1. Code block highlight Golang not supported?
  2. Optional Components | NotionX/React Notion X

@vercel
Copy link

vercel bot commented May 18, 2023

Someone is attempting to deploy a commit to a Personal Account owned by @morethanmin on Vercel.

@morethanmin first needs to authorize it.

@morethanmin morethanmin self-requested a review May 19, 2023 01:10
@morethanmin morethanmin added the enhancement New feature or request label May 19, 2023
@vercel
Copy link

vercel bot commented May 20, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
morethan-log ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 20, 2023 8:25am

Copy link
Owner

@morethanmin morethanmin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

상세한 설명 감사합니다. 👍 머지할게요 :)

@morethanmin morethanmin merged commit 612365e into morethanmin:main May 20, 2023
@WhiteHyun WhiteHyun deleted the feat/notion-token branch May 20, 2023 12:05
gusleyva added a commit to gusleyva/c4cydonia-vercel-blog that referenced this pull request Dec 17, 2023
* feat: update favicon and icon

* adding post author  (morethanmin#41)

* feat: update typescript

* fix: build error

* refactor: refactoring code

* refactor: refactoring code

* chore: update config

* chore: update README.md

* feat: updating author property

* Adding mobile profile section, Updating README (morethanmin#44)

* refactor: refactoring code

* refactor: refactoring code

* feat: adding responsive profile component

* fix: disable profile info

* feat: add bio and role

* chore: update README.md

* feat: mobile view

* feat: darkmode color

* chore: update config

* chore: update config

* Adding Post Custom Thumbnail (morethanmin#56)

* refactor: refactoring code

* refactor: refactoring code

* feat: adding responsive profile component

* fix: disable profile info

* feat: add bio and role

* chore: update README.md

* feat: mobile view

* feat: darkmode color

* fix: setting orderby variable

* feat: add thumbnail

* fix: build error

* fix: build error

* Adding Error Page, Fixing Some Issue (morethanmin#63)

* feat: add profile in post card component

* feat: style post header

* fix: updating profile_photo undefind check

* feat: adding 404 page

* feat: adding thumbnail in post detail page

* fix: using default next image loader

* fix: fixing user name issue

* Workflow Changes + Refactoring (morethanmin#67)

* feat: add prettier config file

* refactor: Move config files to site.config

* feat: Updated the Pull request template

* feat: Add Bug report Form

* feat: Updated the bug_report template

* feat: Updated code of conduct

* feat: Updated Contributing Docs

* feat: update Pull Request template

* fix: adding image domain (morethanmin#71)

* [Fix] notion-toggle 내부 element overflow 해결 (morethanmin#68)

* Bugfix: notion-toggle 내부 element overflow 해결

* Refactor: delete useless important

* [DOCUMENTATION] Documentation Updates (morethanmin#73)

* chore: move 2 files, update 2 files and delete 1 file

* docs: update PULL_REQUEST_TEMPLATE.md

* feat: update Footer.tsx

* feat: support mermaid digram  close morethanmin#77 (morethanmin#78)

* [REFACTOR] refactoring code (morethanmin#79)

* refactor: adding mermaid hook

* refactor: adding some type, refactoring get post

* chore: update config

* refactor: refactoring detail page

* feat: changing font (morethanmin#80)

* [UPDATE] tailwind.config.js (morethanmin#84)

* chore: update document

* chore: add contributors and sponsors

* docs: add contributors

* [FIX] no notion profile photo error (morethanmin#97)

* fix: no notion profile photo error (morethanmin#91)

* chore: change profile image src path to const

* docs: update contributors

* docs: update FUNDING.yml

* [FEAT] add cusdis comment support (morethanmin#103)

* feat: add cusdis feature

* docs: add cusdis to readme

* docs: update contributors

* fix: make cusdis theme same to blog theme (morethanmin#107)

* fix not applied fonts "Pretendard" (morethanmin#114)

* docs: update contributors

* typo: fix typo (morethanmin#120)

* docs: update contributors

* [FEAT] add "category" property (morethanmin#122)

* feat: add category

* feat: update coloring logic

* fix: update tailwind

* fix: add category readOnly props

* feat: add category inputs

* fix: category ui issue

* fix: typo

* [FIX] category overflow issue (morethanmin#123)

* feat: add category

* feat: update coloring logic

* fix: update tailwind

* fix: add category readOnly props

* feat: add category inputs

* fix: category ui issue

* fix: typo

* fix: navbar z-index

* fix: fix typo (TPostStatus) (morethanmin#132)

* fix: table notion overflow on mobile (morethanmin#144)

* docs: update contributors

* change to overflow auto (morethanmin#145)

* Fix:google analytics not working even though I have add ga id correctly (morethanmin#146)

* rename all env use in next build to NEXT_PUBLIC_

* fix document

* feat: ✨ adding sticky section (morethanmin#163)

* chore: 📦 update notion-client (morethanmin#171)

* [FEAT] react notion x 및 NotionRender 업데이트 (morethanmin#174)

* Feat: getPosts 요청 감소 로직 추가

* Feat: react-notion-x 업데이트 및 NotionRederer 수정

* build: 📦 update package

* feat: ✨ update background color

* [FIX] Notion Token Error (morethanmin#185)

* feat: add `index.d.ts` to declare `prismjs`

* feat: add code token recognition for multiple languages

* chore: add contributor

* chore: fix readme.md

* Update README.md (morethanmin#199)

Add user guide in english

* fix: fix serviceCard (morethanmin#238)

* chore: update readme.md

* [Feat] on demand revalidate api (morethanmin#224)

* feat: upgrade next, react, react-dom

* fix: remove a tag in link tag

- for next13

* chore: revalidateTime to confing

* feat: on demand revalidate api 추가

* doc: revalidate api 설명 주석 추가

* [FEAT] migrate emotion to tailwind (morethanmin#246)

* feat: update next.js

* feat: install emotion

* feat: convert layout style

* refactor: rename containers folder

* feat: convert category css

* feat: convert feed, taglist style

* feat: convert MobileProfileCard style

* feat: convert feed style

* feat: convert feed page style

* feat: ✨ remove tailwind

* feat: ✨ add themeProvider

* refactor: refactor structure

* refactor: refactor structure

* feat: darkmode

* feat: update theme

* fix: fix build error

* fix: fix post card ui (morethanmin#247)

* fix: fix comment darkmode (morethanmin#248)

* fix: fix tag background color

* fix: refactor comment box

* feat: improve notion css

* refactor: refactor error page

* refactor: refactor api

* refactor: ♻️ update meta config

* feat: refactoring ssr using react query

* fix: fix build error

* fix: remove console.log

* fix: set queryKey argument

* fix: fix default category not visible

* fix: fix type error

* feat: update feed ui

* feat: change utterances value

* FIX :: color set code to use record

* fix: change utterances value (morethanmin#271)

* docs: update readme.md

* docs: update README.md

* chore: update README.md

* feat: naver site verification

* Update site.config.js

* revert site.config.js

* clarification to README.md

* 20231217 - Download latest updates

---------

Co-authored-by: front_이상민 <[email protected]>
Co-authored-by: Lee Sang Min <[email protected]>
Co-authored-by: Vaishak Kaippanchery <[email protected]>
Co-authored-by: JaeSang1998 <[email protected]>
Co-authored-by: Obaid Al Teneiji <[email protected]>
Co-authored-by: Jinhwan Kim <[email protected]>
Co-authored-by: morethanmin <[email protected]>
Co-authored-by: itjustbong <[email protected]>
Co-authored-by: 도다 <[email protected]>
Co-authored-by: lisiver <[email protected]>
Co-authored-by: Octoping <[email protected]>
Co-authored-by: Octoping <[email protected]>
Co-authored-by: linnil <[email protected]>
Co-authored-by: 홍승현 <[email protected]>
Co-authored-by: halang <[email protected]>
Co-authored-by: SEOKKAMONI <[email protected]>
Co-authored-by: Randall <[email protected]>
Co-authored-by: Yongjun Cho <[email protected]>
Co-authored-by: Evelyn Gaskin <[email protected]>
Co-authored-by: Gustavo Leyva <[email protected]>
cheongsan pushed a commit to cheongsan/blog that referenced this pull request Dec 12, 2024
* feat: add `index.d.ts` to declare `prismjs`

* feat: add code token recognition for multiple languages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants