Added simple MD support for sidenote content
This commit is contained in:
@@ -17,7 +17,7 @@ export function Row({ style, children }: RowProps) {
|
||||
<div
|
||||
className={`${styles.row}`}
|
||||
style={{
|
||||
gridTemplateColumns: `repeat(${style.cols}, 1 fr)`,
|
||||
gridTemplateColumns: `repeat(${style.cols}, 1fr)`,
|
||||
gap: `${style.gap}`,
|
||||
alignItems: `${style.align}`,
|
||||
justifyContent: `${style.justify}`,
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import React from 'react';
|
||||
import { marked } from 'marked';
|
||||
|
||||
import type { Sidenote } from '@/lib/types/components';
|
||||
import styles from './Container.module.css';
|
||||
|
||||
@@ -21,12 +24,15 @@ export default function Container({ items }: ContainerProps) {
|
||||
<span className={styles.marker}>
|
||||
<span className={styles.symbol}>{sidenote.marker}</span>
|
||||
</span>
|
||||
<div className={styles.content}>
|
||||
{sidenote.content}
|
||||
<a href={`#ref-${sidenote.id}`} className={styles.ref}>
|
||||
↩
|
||||
</a>
|
||||
</div>
|
||||
<div
|
||||
className={`${styles.content} content`}
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: marked.parseInline(sidenote.content),
|
||||
}}
|
||||
/>
|
||||
<a href={`#ref-${sidenote.id}`} className={styles.ref}>
|
||||
↩
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user