Skip to content

Commit

Permalink
fix: code block empty #119
Browse files Browse the repository at this point in the history
  • Loading branch information
Blinko committed Nov 18, 2024
1 parent e75fb77 commit c3c2b0f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/components/Common/Editor/editorPlugins.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const codeBlockLanguages = {
export const ProcessCodeBlocks = (content: string): string => {
if (!content) return '';
const codeBlockRegex = /```(?:(\w*)\n)?([\s\S]*?)```/g;

const htmlRegex = /(<[^>]+>)/gi;
try {
return content.replace(codeBlockRegex, (match, language, code) => {
Expand Down

0 comments on commit c3c2b0f

Please sign in to comment.