매우 기본적인 테마 컴포넌트입니다(로봇의 도움으로 제작): 하드코딩된 도메인 목록을 사용합니다:
<script type="text/discourse-plugin" version="0.8.25">
api.decorateCookedElement((element) => {
const domainsToUnlink = ["example.com", "specificdomain.com"];
const links = element.querySelectorAll("a");
links.forEach((link) => {
const url = new URL(link.href);
if (domainsToUnlink.includes(url.hostname)) {
const textNode = document.createTextNode(link.textContent);
link.replaceWith(textNode);
}
});
}, { id: "unlink-specific-domains" });
</script>
