mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
feat(rules): render markdown in board rules display
This commit is contained in:
@@ -2,6 +2,7 @@ import { useEffect, useState, FormEvent } from 'react';
|
|||||||
import { useSubplebbit } from '@plebbit/plebbit-react-hooks';
|
import { useSubplebbit } from '@plebbit/plebbit-react-hooks';
|
||||||
import { Footer, HomeLogo } from '../home';
|
import { Footer, HomeLogo } from '../home';
|
||||||
import { useDirectories, DirectoryCommunity } from '../../hooks/use-directories';
|
import { useDirectories, DirectoryCommunity } from '../../hooks/use-directories';
|
||||||
|
import Markdown from '../../components/markdown';
|
||||||
import styles from './rules.module.css';
|
import styles from './rules.module.css';
|
||||||
|
|
||||||
const getBoardShortCode = (title?: string): string => {
|
const getBoardShortCode = (title?: string): string => {
|
||||||
@@ -73,7 +74,9 @@ const BoardRulesDisplay = ({ subplebbitAddress, directories }: { subplebbitAddre
|
|||||||
) : rules && rules.length > 0 ? (
|
) : rules && rules.length > 0 ? (
|
||||||
<ol>
|
<ol>
|
||||||
{rules.map((rule: string, index: number) => (
|
{rules.map((rule: string, index: number) => (
|
||||||
<li key={index}>{rule}</li>
|
<li key={index}>
|
||||||
|
<Markdown content={rule} />
|
||||||
|
</li>
|
||||||
))}
|
))}
|
||||||
</ol>
|
</ol>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
Reference in New Issue
Block a user