Skip to content

Commit 6e63dba

Browse files
authored
chore(core): remove redundant async definition (#1264)
1 parent 37e7077 commit 6e63dba

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

packages/core/src/page/createPage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const createPage = async (
3939
links,
4040
sfcBlocks,
4141
title,
42-
} = await renderPageContent({
42+
} = renderPageContent({
4343
app,
4444
content,
4545
filePath,

packages/core/src/page/renderPageContent.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import type { App, PageFrontmatter, PageOptions } from '../types/index.js'
99
/**
1010
* Render page content and extract related info
1111
*/
12-
export const renderPageContent = async ({
12+
export const renderPageContent = ({
1313
app,
1414
content,
1515
filePath,
@@ -21,15 +21,15 @@ export const renderPageContent = async ({
2121
filePath: string | null
2222
filePathRelative: string | null
2323
options: PageOptions
24-
}): Promise<{
24+
}): {
2525
contentRendered: string
2626
deps: string[]
2727
frontmatter: PageFrontmatter
2828
headers: MarkdownHeader[]
2929
links: MarkdownLink[]
3030
sfcBlocks: MarkdownSfcBlocks
3131
title: string
32-
}> => {
32+
} => {
3333
const markdownEnv: MarkdownEnv = {
3434
base: app.options.base,
3535
filePath,

packages/core/tests/page/renderPageContent.spec.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ const app = createBaseApp({
1111
app.markdown = createMarkdown()
1212

1313
describe('core > page > renderPageContent', () => {
14-
it('should render page content correctly', async () => {
15-
const resolved = await renderPageContent({
14+
it('should render page content correctly', () => {
15+
const resolved = renderPageContent({
1616
app,
1717
content: `\
1818
foobar
@@ -64,8 +64,8 @@ const msg = 'msg'
6464
})
6565

6666
describe('page title', () => {
67-
it('should use title in frontmatter', async () => {
68-
const resolved = await renderPageContent({
67+
it('should use title in frontmatter', () => {
68+
const resolved = renderPageContent({
6969
app,
7070
content: '# title in header',
7171
filePath: null,
@@ -80,8 +80,8 @@ const msg = 'msg'
8080
expect(resolved.title).toEqual('title in frontmatter')
8181
})
8282

83-
it('should use title in the first h1 header', async () => {
84-
const resolved = await renderPageContent({
83+
it('should use title in the first h1 header', () => {
84+
const resolved = renderPageContent({
8585
app,
8686
content: '# title in header',
8787
filePath: null,
@@ -92,8 +92,8 @@ const msg = 'msg'
9292
expect(resolved.title).toEqual('title in header')
9393
})
9494

95-
it('should use empty title', async () => {
96-
const resolved = await renderPageContent({
95+
it('should use empty title', () => {
96+
const resolved = renderPageContent({
9797
app,
9898
content: '',
9999
filePath: null,
@@ -106,8 +106,8 @@ const msg = 'msg'
106106
})
107107

108108
describe('page frontmatter', () => {
109-
it('should merge markdown frontmatter and options frontmatter', async () => {
110-
const resolved = await renderPageContent({
109+
it('should merge markdown frontmatter and options frontmatter', () => {
110+
const resolved = renderPageContent({
111111
app,
112112
content: `\
113113
---
@@ -129,8 +129,8 @@ title: title in markdown frontmatter
129129
})
130130
})
131131

132-
it('should use fields from markdown frontmatter first', async () => {
133-
const resolved = await renderPageContent({
132+
it('should use fields from markdown frontmatter first', () => {
133+
const resolved = renderPageContent({
134134
app,
135135
content: `\
136136
---

0 commit comments

Comments
 (0)