mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-06 17:11:55 +00:00
Update RemarkRenderer.tsx
This commit is contained in:
@@ -209,11 +209,6 @@ const RE_EMPTY_LINE = /^\s*?$/gm;
|
|||||||
*/
|
*/
|
||||||
const RE_PLUS = /^\s*\+(?:$|[^+])/gm;
|
const RE_PLUS = /^\s*\+(?:$|[^+])/gm;
|
||||||
|
|
||||||
/**
|
|
||||||
* Regex for replaceing a newline with <br> within a table
|
|
||||||
*/
|
|
||||||
const RE_TABLE_NEWLINE = /(?<=\|[^\|]*)\n(?=[^\|]*\|)/g;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sanitise Markdown input before rendering
|
* Sanitise Markdown input before rendering
|
||||||
* @param content Input string
|
* @param content Input string
|
||||||
@@ -222,9 +217,6 @@ const RE_TABLE_NEWLINE = /(?<=\|[^\|]*)\n(?=[^\|]*\|)/g;
|
|||||||
function sanitise(content: string) {
|
function sanitise(content: string) {
|
||||||
return (
|
return (
|
||||||
content
|
content
|
||||||
// Makes a newline within a table replace with <br> rather then start a new cell
|
|
||||||
.replace(RE_TABLE_NEWLINE, "<br>")
|
|
||||||
|
|
||||||
// Strip excessive blockquote or list indentation
|
// Strip excessive blockquote or list indentation
|
||||||
.replace(RE_RECURSIVE, (_, m0, m1) => m0 + m1)
|
.replace(RE_RECURSIVE, (_, m0, m1) => m0 + m1)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user