Skip to content

Commit e456b36

Browse files
committed
feat: integrate remark-ins for enhanced Markdown support across event components
1 parent 62e5084 commit e456b36

5 files changed

Lines changed: 12 additions & 7 deletions

File tree

src/Components/Event/EventCard.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import dayjs from "dayjs";
22
import ReactMarkdown from "react-markdown";
33
import remarkGfm from 'remark-gfm';
4+
import remarkIns from 'remark-ins';
45
import { Dic } from "~/Helpers/Entities";
56
import { Models } from "~/Services/Status.Models";
67
import { Authorized } from "../Auth/With";
@@ -94,8 +95,8 @@ export function EventCard({ Event }: { Event: Models.IEvent }) {
9495
</label>
9596

9697
{Event.Description &&
97-
<div className="w-full break-all text-xl font-medium text-slate-700">
98-
<ReactMarkdown remarkPlugins={[remarkGfm]}>{Event.Description}</ReactMarkdown>
98+
<div className="prose prose-sm w-full text-pretty text-xl font-medium text-slate-700">
99+
<ReactMarkdown remarkPlugins={[remarkGfm, remarkIns]}>{Event.Description}</ReactMarkdown>
99100
</div>}
100101
</div>
101102
</div>

src/Components/Event/EventEditor.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import dayjs from "dayjs";
44
import ReactMarkdown from 'react-markdown';
55
import MdEditor from 'react-markdown-editor-lite';
66
import remarkGfm from 'remark-gfm';
7+
import remarkIns from 'remark-ins';
78
import { Dic, MDDecsPlugins, MDUpdatePlugins } from "~/Helpers/Entities";
89
import { Models } from "~/Services/Status.Models";
910
import { EventStatus, EventType, GetStatusList, IsIncident, IsOpenStatus } from "./Enums";
@@ -122,7 +123,7 @@ export function EventEditor({ Event }: { Event: Models.IEvent }) {
122123
<label className="text-sm font-medium text-gray-700">Description</label>
123124
<MdEditor
124125
placeholder="Optional description for the event"
125-
renderHTML={(text) => <ReactMarkdown remarkPlugins={[remarkGfm]}>{text}</ReactMarkdown>}
126+
renderHTML={(text) => <ReactMarkdown remarkPlugins={[remarkGfm, remarkIns]}>{text}</ReactMarkdown>}
126127
value={State.description}
127128
onChange={({ text }) => Actions.setDescription(text)}
128129
plugins={MDDecsPlugins}
@@ -143,7 +144,7 @@ export function EventEditor({ Event }: { Event: Models.IEvent }) {
143144
<label className="text-sm font-medium text-gray-700">Update Message</label>
144145
<MdEditor
145146
placeholder="Message detailing the updates"
146-
renderHTML={(text) => <ReactMarkdown remarkPlugins={[remarkGfm]}>{text}</ReactMarkdown>}
147+
renderHTML={(text) => <ReactMarkdown remarkPlugins={[remarkGfm, remarkIns]}>{text}</ReactMarkdown>}
147148
value={State.update}
148149
onChange={({ text }) => Actions.setUpdate(text)}
149150
plugins={MDUpdatePlugins}

src/Components/Event/EventLog.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import dayjs from "dayjs";
33
import { chain } from "lodash";
44
import ReactMarkdown from "react-markdown";
55
import remarkGfm from 'remark-gfm';
6+
import remarkIns from 'remark-ins';
67
import { Dic } from "~/Helpers/Entities";
78
import { Models } from "~/Services/Status.Models";
89

@@ -52,8 +53,8 @@ export function EventLog({ Event }: { Event: Models.IEvent }) {
5253
</div>
5354
</td>
5455

55-
<td className="text-pretty break-all w-full">
56-
<ReactMarkdown remarkPlugins={[remarkGfm]}>{history.Message}</ReactMarkdown>
56+
<td className="prose text-pretty w-full">
57+
<ReactMarkdown remarkPlugins={[remarkGfm, remarkIns]}>{history.Message}</ReactMarkdown>
5758
</td>
5859
</tr>
5960
))}

src/Components/New/NewForm.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { orderBy } from "lodash";
44
import ReactMarkdown from 'react-markdown';
55
import MdEditor from 'react-markdown-editor-lite';
66
import remarkGfm from 'remark-gfm';
7+
import remarkIns from 'remark-ins';
78
import { Dic, MDDecsPlugins } from "~/Helpers/Entities";
89
import { useStatus } from "~/Services/Status";
910
import { EventType, IsIncident } from "../Event/Enums";
@@ -67,7 +68,7 @@ export function NewForm() {
6768
<label className="text-sm font-medium text-gray-700">Description</label>
6869
<MdEditor
6970
placeholder="If there is any known information, please write it down here."
70-
renderHTML={(text) => <ReactMarkdown remarkPlugins={[remarkGfm]}>{text}</ReactMarkdown>}
71+
renderHTML={(text) => <ReactMarkdown remarkPlugins={[remarkGfm, remarkIns]}>{text}</ReactMarkdown>}
7172
value={State.description}
7273
onChange={({ text }) => Actions.setDescription(text)}
7374
plugins={MDDecsPlugins}

src/index.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@import "tailwindcss";
2+
@plugin "@tailwindcss/typography";
23

34
:root {
45
color-scheme: light !important;

0 commit comments

Comments
 (0)