Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(client): use v-html in VPDocFooter #1580

Merged
merged 8 commits into from Nov 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions examples/configured/.vitepress/config.js
Expand Up @@ -16,6 +16,15 @@ export default defineConfig({
}
]
},
{
text: '& &#60;Text Literals &> <code>code</code>',
items: [
{
text: '& &#60;Test Page &> <code>code</code>',
link: '/text-literals/'
}
]
},
{
text: 'Static Data',
items: [
Expand Down
1 change: 1 addition & 0 deletions examples/configured/__test__/multisidebar.spec.ts
Expand Up @@ -17,6 +17,7 @@ describe('test multi sidebar sort root', () => {
const sidebarContent = await sidebarLocator.allTextContents()
expect(sidebarContent).toEqual([
'Frontmatter',
'& <Text Literals &> code',
'Static Data',
'Multi Sidebar Test'
])
Expand Down
5 changes: 5 additions & 0 deletions examples/configured/text-literals/index.md
@@ -0,0 +1,5 @@
---
title: Text Literals
---

# Text Literals Test
8 changes: 4 additions & 4 deletions src/client/theme-default/components/VPDocFooter.vue
Expand Up @@ -42,14 +42,14 @@ const showFooter = computed(() => {
<div v-if="control.prev || control.next" class="prev-next">
<div class="pager">
<a v-if="control.prev" class="pager-link prev" :href="normalizeLink(control.prev.link)">
<span class="desc">{{ theme.docFooter?.prev ?? 'Previous page' }}</span>
<span class="title">{{ control.prev.text }} </span>
<span class="desc" v-html="theme.docFooter?.prev ?? 'Previous page'"></span>
<span class="title" v-html="control.prev.text"></span>
</a>
</div>
<div class="pager" :class="{ 'has-prev': control.prev }">
<a v-if="control.next" class="pager-link next" :href="normalizeLink(control.next.link)">
<span class="desc">{{ theme.docFooter?.next ?? 'Next page' }}</span>
<span class="title">{{ control.next.text }}</span>
<span class="desc" v-html="theme.docFooter?.next ?? 'Next page'"></span>
<span class="title" v-html="control.next.text"></span>
</a>
</div>
</div>
Expand Down