Skip to content

Commit 5e6ee46

Browse files
committed
changed how the ::after icon is unset for changelog
1 parent ee5e892 commit 5e6ee46

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

app/components/Readme.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ function handleClick(event: MouseEvent) {
150150
@apply inline i-lucide:external-link rtl-flip ms-1 opacity-50;
151151
}
152152
153-
.readme :deep(:is(h1, h2, h3, h4, h5, h6) a[href^='#']:not([content-none])::after) {
153+
.readme :deep(:is(h1, h2, h3, h4, h5, h6) a[href^='#']::after) {
154154
/* I don't know what kind of sorcery this is, but it ensures this icon can't wrap to a new line on its own. */
155155
content: '__';
156156
@apply inline i-lucide:link rtl-flip ms-1 opacity-0;

app/pages/package-changelog/[[org]]/[name].vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ defineOgImageComponent('Default', {
9595
:resolved-version="version"
9696
:display-version="pkg?.requestedVersion"
9797
/>
98-
<section class="container w-full pt-3">
98+
<section class="container w-full pt-3" :class="$style.changelog">
9999
<div
100100
class="pa-3 z-2 flex justify-between gap-4 h-14 b-b-1 border-border bg-bg top-[--combined-header-height]"
101101
:class="{
@@ -177,3 +177,9 @@ defineOgImageComponent('Default', {
177177
</section>
178178
</main>
179179
</template>
180+
181+
<style module>
182+
.changelog :global(.readme) :is(h1, h2, h3, h4, h5, h6) a[href^='#']::after {
183+
content: unset !important;
184+
}
185+
</style>

server/utils/changelog/markdown.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export async function changelogRenderer(mdRepoInfo: MarkdownRepoInfo) {
108108
toc.push({ text: plainText, id, depth })
109109
}
110110

111-
return `<h${semanticLevel} id="${id}" data-level="${depth}">${text} <a content-none href="#${id}"><span class="i-lucide:link size-[1em]" aria-hidden="true"></span></a></h${semanticLevel}>\n`
111+
return `<h${semanticLevel} id="${id}" data-level="${depth}">${text} <a href="#${id}"><span class="i-lucide:link size-[1em]" aria-hidden="true"></span></a></h${semanticLevel}>\n`
112112
}
113113

114114
// Helper to prefix id attributes with 'user-content-'

server/utils/readme.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ export const ALLOWED_TAGS = [
184184

185185
export const ALLOWED_ATTR: Record<string, string[]> = {
186186
'*': ['id'], // Allow id on all tags
187-
'a': ['href', 'title', 'target', 'rel', 'content-none'],
187+
'a': ['href', 'title', 'target', 'rel'],
188188
'img': ['src', 'alt', 'title', 'width', 'height', 'align'],
189189
'source': ['src', 'srcset', 'type', 'media'],
190190
'button': ['class', 'title', 'type', 'aria-label', 'data-copy'],

0 commit comments

Comments
 (0)