From 036e8fa5c7edca409a2a6889b4270db284ff1553 Mon Sep 17 00:00:00 2001 From: "igor.luckenkov" Date: Sun, 30 Oct 2022 14:16:43 +0000 Subject: [PATCH] Prevent translation of code blocks by wrapping them in tag --- src/components/Prism/index.tsx | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/components/Prism/index.tsx b/src/components/Prism/index.tsx index 98010be56d..250f510b24 100644 --- a/src/components/Prism/index.tsx +++ b/src/components/Prism/index.tsx @@ -16,20 +16,22 @@ const Basic = ({ code, language }: Props) => ( Prism={Prism} > {({ className, tokens, getLineProps, getTokenProps }: any) => ( -
-        {tokens.map((line, i) => {
-          if (line.length === 1 && line[0].content === "") {
-            line[0].content = " "
-          }
-          return (
-            
- {line.map((token, key) => ( - - ))} -
- ) - })} -
+ +
+          {tokens.map((line, i) => {
+            if (line.length === 1 && line[0].content === "") {
+              line[0].content = " "
+            }
+            return (
+              
+ {line.map((token, key) => ( + + ))} +
+ ) + })} +
+
)} )