mirror of https://github.com/usememos/memos
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
302 B
TypeScript
17 lines
302 B
TypeScript
3 years ago
|
export const BR_REG = /^(\n+)/;
|
||
|
|
||
|
const renderer = (rawStr: string) => {
|
||
|
const length = rawStr.split("\n").length - 1;
|
||
|
const brList = [];
|
||
|
for (let i = 0; i < length; i++) {
|
||
|
brList.push(<br />);
|
||
|
}
|
||
|
return <>{...brList}</>;
|
||
|
};
|
||
|
|
||
|
export default {
|
||
|
name: "br",
|
||
|
regexp: BR_REG,
|
||
|
renderer,
|
||
|
};
|