Skip to content

Instantly share code, notes, and snippets.

@nryeouo
Last active February 14, 2023 09:24
Show Gist options
  • Save nryeouo/d8eeda79586442b04a16eb1d74c19485 to your computer and use it in GitHub Desktop.
Save nryeouo/d8eeda79586442b04a16eb1d74c19485 to your computer and use it in GitHub Desktop.
백두산절세위인들의 존함을 굵게 하는 Misskey 확장기능 (Plugin)
### {
name: "존함 - 게시용"
version: "1.1"
author: "maronu"
description: "글을 게시할 때 백두산절세위인들의 존함을 굵게 합니다."
permission: []
config: {}
}
@convert(note) {
? ((note.text = _) | (note.text = "")) {
<< note
}
// Code blocks이 있을 때 처리하지 않음
.? Str:incl(note.text "`") {
<< note
} . {
$text <- note.text
#great_names = [
"김일성" "김정일" "김정은"
"Kim Il Sung" "Kim Jong Il" "Kim Jong Un"
"Ким Ир Сен" "Ким Чен Ир" "Ким Чен Ын"
"金日成" "金正日" "金正恩"]
~~ (#gname, great_names) {
text <- Str:replace(text gname `**{gname}**`)
text <- Str:replace(text "****" "**")
}
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