hunghg255 / reactjs-tiptap-editor

A modern WYSIWYG rich text editor based on tiptap and shadcn ui for Reactjs
https://reactjs-tiptap-editor.vercel.app/
MIT License
203 stars 37 forks source link

[Feat] Add more supported languages in CodeBlock component #82

Closed TungNguyen-C4U closed 1 month ago

TungNguyen-C4U commented 1 month ago

Hi, Currently I found that the codeblock component support quite few languages (only HTML, CSS, JS, Bash). Some popular languages like SQL, JSON, XML .. had not been supported! Can you add more please since the lowlight library which was used in Tiptap support so many coding lanaguages

hunghg255 commented 1 month ago

@TungNguyen-C4U Hi, I understand what you mean, lowlight is recommended from tiptap docs But I integrated another lib use Shiki

you can config your language from configure

 CodeBlock.configure({
    defaultTheme: 'dracula',
    languages: ['javascript', 'typescript', 'bash', 'json', 'html', 'css', 'markdown', 'sql', 'xml']
  }),
Screenshot 2024-10-21 at 15 08 41