DEV: Add slug parameter to hashtag-decorator (#27917)

In order to facilitate discourse-tag-icons and discourse-category-icons to render icons for post content, we need to provide an additional slug parameter here
This commit is contained in:
锦心 2024-07-15 17:22:02 +08:00 committed by GitHub
parent cf5174da69
commit 4d64205eef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

@ -100,6 +100,7 @@ export function decorateHashtags(element, site) {
.generateIconHTML({ .generateIconHTML({
icon: site.hashtag_icons[hashtagType], icon: site.hashtag_icons[hashtagType],
id: hashtagEl.dataset.id, id: hashtagEl.dataset.id,
slug: hashtagEl.dataset.slug,
}) })
.trim(); .trim();
iconPlaceholderEl.replaceWith(domFromString(hashtagIconHTML)[0]); iconPlaceholderEl.replaceWith(domFromString(hashtagIconHTML)[0]);