Skip to content

Commit

Permalink
allow html in announcements
Browse files Browse the repository at this point in the history
  • Loading branch information
colinhartigan committed Sep 30, 2024
1 parent 0828497 commit c602427
Show file tree
Hide file tree
Showing 4 changed files with 173 additions and 0 deletions.
168 changes: 168 additions & 0 deletions 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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"react-native-text-ticker": "^1.14.0",
"react-scroll": "^1.9.0",
"react-text-transition": "^3.1.0",
"rehype-raw": "^7.0.0",
"remark-gfm": "^4.0.0"
},
"devDependencies": {
Expand Down
2 changes: 2 additions & 0 deletions src/components/Notices.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { motion, useAnimationControls } from "framer-motion";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import Markdown from "react-markdown";
import { animateScroll, Element } from "react-scroll";
import rehypeRaw from "rehype-raw";
import remarkGfm from "remark-gfm";
import useInfo from "../hooks/useInfo";

Expand Down Expand Up @@ -113,6 +114,7 @@ export default function Notices({}) {
<Markdown
className="prose prose-2xl prose-neutral prose-invert prose-headings:font-bold"
remarkPlugins={[remarkGfm]}
rehypePlugins={[rehypeRaw]}
>
{currentSlide}
</Markdown>
Expand Down
2 changes: 2 additions & 0 deletions src/components/config/AnnouncementEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { AlertDialog, Button, Flex, RadioCards, ScrollArea, Switch, Text, TextAr
import dayjs from "dayjs";
import { useCallback, useState } from "react";
import Markdown from "react-markdown";
import rehypeRaw from "rehype-raw";
import remarkGfm from "remark-gfm";
import useInfo from "../../hooks/useInfo";

Expand Down Expand Up @@ -129,6 +130,7 @@ export default function AnnouncementEditor({}) {
<Markdown
className="prose prose-lg prose-neutral prose-invert h-auto w-full flex-grow overflow-auto px-2 prose-headings:font-bold"
remarkPlugins={[remarkGfm]}
rehypePlugins={[rehypeRaw]}
>
{selectedSlide?.content}
</Markdown>
Expand Down

0 comments on commit c602427

Please sign in to comment.