답변 감사합니다! 그런데 BOLD 버튼을 클릭하면 ** 코드가 표시되고, 다시 클릭하면 사라지는 것을 확인했습니다. 제 커스텀 버튼은 다시 클릭했을 때 코드를 제거하는 기능이 없습니다.
해결 방법이 있을까요? 제 커스텀 버튼의 코드는 다음과 같습니다:
<script type="text/discourse-plugin" version="0.8">
const currentLocale = I18n.currentLocale();
if (!I18n.translations[currentLocale].js.composer) {
I18n.translations[currentLocale].js.composer = {};
}
I18n.translations[currentLocale].js.composer.ttl_spoiler_text = "Insert hidden content";
I18n.translations[currentLocale].js.ttl_dice_title = "ttl-spoiler";
api.onToolbarCreate(function(toolbar) {
toolbar.addButton({
id: "ttl-spoiler",
icon: "ttl-spoiler-icon",
group: "extras",
preventFocus: true,
trimLeading: true,
perform: (e) => e.applySurround("[spoiler]", "[/spoiler]", "ttl_spoiler_text")
});
});
</script>