Skip to content

Commit

Permalink
Open url in new tab (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
devleejb authored Feb 27, 2024
1 parent 07a6e61 commit ec633f5
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
29 changes: 29 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"react-social-login-buttons": "^3.9.1",
"react-use": "^17.5.0",
"redux-persist": "^6.0.0",
"rehype-external-links": "^3.0.0",
"rehype-katex": "^7.0.0",
"rehype-rewrite": "^4.0.2",
"remark-math": "^6.0.0",
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/editor/Preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import katex from "katex";
import { getCodeString } from "rehype-rewrite";
import remarkMath from "remark-math";
import rehypeKatex from "rehype-katex";
import rehypeExternalLinks from "rehype-external-links";
import "katex/dist/katex.min.css";

function Preview() {
Expand Down Expand Up @@ -56,7 +57,7 @@ function Preview() {
},
}}
remarkPlugins={[remarkMath]}
rehypePlugins={[rehypeKatex]}
rehypePlugins={[rehypeKatex, [rehypeExternalLinks, { target: "_blank" }]]}
components={{
code: ({ children = [], className, ...props }) => {
// https://www.npmjs.com/package/@uiw/react-markdown-preview#support-custom-katex-preview
Expand Down

0 comments on commit ec633f5

Please sign in to comment.