mirror of
https://github.com/one-among-us/data.git
synced 2024-11-22 19:24:51 +08:00
commit
2f3236075e
@ -153,6 +153,9 @@ function buildPeoplePages() {
|
||||
// Handle Footnote
|
||||
markdown = handleFootnote(markdown)
|
||||
|
||||
// Handle Delete Line: ~~something~~ to <del>something</del>
|
||||
markdown = handleDeleteLine(markdown)
|
||||
|
||||
// Handle Icon
|
||||
markdown = handleNoteIcon(markdown)
|
||||
|
||||
@ -184,6 +187,12 @@ function handleFootnote(md: string) {
|
||||
.replace(/(<li id="footnote.*<\/li>)/gs, '<ol>\n$1\n</ol>')
|
||||
}
|
||||
|
||||
function handleDeleteLine(md: string): string {
|
||||
if (!md.includes('~~')) return md;
|
||||
|
||||
return md.replace(/~~(.*?)~~/g, (match, text) => ("<del>" + text + "</del>"));
|
||||
}
|
||||
|
||||
function handleNoteIcon(md: string): string {
|
||||
if (!md.includes('[!')) return md;
|
||||
return md.replace(/\[\!(\w+)\](?::\s*(.*))?/g, (match, icon, _) => (Icon[icon as string]));
|
||||
|
Loading…
Reference in New Issue
Block a user