Created
January 17, 2023 11:40
-
-
Save nryeouo/b60bccaa9d7471cf3ac9db483b461aaf to your computer and use it in GitHub Desktop.
백두산절세위인들의 존함을 굵게 하는 Misskey v13 확장기능 (Plugin)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// @ 0.12.0 | |
### { | |
name: "존함 - 게시용" | |
version: "1.3" | |
author: "maronu" | |
description: "글을 게시할 때 백두산절세위인들의 존함을 굵게 합니다." | |
permission: [] | |
config: {} | |
} | |
@convert(note) { | |
if (note.text == null) || (note.text == "") { | |
return note | |
} | |
// Code blocks이 있을 때 처리하지 않음 | |
elif note.text.incl("`") { | |
return note | |
} else { | |
let text = note.text | |
var great_names = [ | |
"김일성" "김정일" "김정은" | |
"Kim Il Sung" "Kim Jong Il" "Kim Jong Un" | |
"Ким Ир Сен" "Ким Чен Ир" "Ким Чен Ын" | |
"金日成" "金正日" "金正恩"] | |
each (let gname, great_names) { | |
text = text.replace(gname `**{gname}**`) | |
text = text.replace("****" "**") | |
} | |
note.text = text | |
note | |
} | |
} | |
Plugin:register_note_post_interruptor(convert) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment