Skip to content

Instantly share code, notes, and snippets.

@salano-ym
Forked from nryeouo/great_leaders.plugin
Last active February 22, 2023 15:59
Show Gist options
  • Save salano-ym/46e539ef3ef47d41effd92a6131dba7b to your computer and use it in GitHub Desktop.
Save salano-ym/46e539ef3ef47d41effd92a6131dba7b to your computer and use it in GitHub Desktop.
(AiScript 0.12.4) 백두산절세위인들의 존함을 굵게 하는 Misskey 확장기능 (Plugin)
/// @ 0.12.4
### {
name: "존함 - 게시용 (AS0.12.4版)"
version: "1.1"
author: "@salano_ym (Original: maronu)"
description: "글을 게시할 때 백두산절세위인들의 존함을 굵게 합니다."
permission: []
config: {}
}
@convert(note) {
if ((note.text == null) || (note.text == "")) {
return note
}
// Code blocks이 있을 때 처리하지 않음
elif note.text.incl("`") {
return note
} else {
var text = note.text
let 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