Skip to content

Commit

Permalink
chore(core): remove redundant async definition (#1264)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope authored Feb 19, 2023
1 parent 37e7077 commit 6e63dba
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/page/createPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const createPage = async (
links,
sfcBlocks,
title,
} = await renderPageContent({
} = renderPageContent({
app,
content,
filePath,
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/page/renderPageContent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type { App, PageFrontmatter, PageOptions } from '../types/index.js'
/**
* Render page content and extract related info
*/
export const renderPageContent = async ({
export const renderPageContent = ({
app,
content,
filePath,
Expand All @@ -21,15 +21,15 @@ export const renderPageContent = async ({
filePath: string | null
filePathRelative: string | null
options: PageOptions
}): Promise<{
}): {
contentRendered: string
deps: string[]
frontmatter: PageFrontmatter
headers: MarkdownHeader[]
links: MarkdownLink[]
sfcBlocks: MarkdownSfcBlocks
title: string
}> => {
} => {
const markdownEnv: MarkdownEnv = {
base: app.options.base,
filePath,
Expand Down
24 changes: 12 additions & 12 deletions packages/core/tests/page/renderPageContent.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ const app = createBaseApp({
app.markdown = createMarkdown()

describe('core > page > renderPageContent', () => {
it('should render page content correctly', async () => {
const resolved = await renderPageContent({
it('should render page content correctly', () => {
const resolved = renderPageContent({
app,
content: `\
foobar
Expand Down Expand Up @@ -64,8 +64,8 @@ const msg = 'msg'
})

describe('page title', () => {
it('should use title in frontmatter', async () => {
const resolved = await renderPageContent({
it('should use title in frontmatter', () => {
const resolved = renderPageContent({
app,
content: '# title in header',
filePath: null,
Expand All @@ -80,8 +80,8 @@ const msg = 'msg'
expect(resolved.title).toEqual('title in frontmatter')
})

it('should use title in the first h1 header', async () => {
const resolved = await renderPageContent({
it('should use title in the first h1 header', () => {
const resolved = renderPageContent({
app,
content: '# title in header',
filePath: null,
Expand All @@ -92,8 +92,8 @@ const msg = 'msg'
expect(resolved.title).toEqual('title in header')
})

it('should use empty title', async () => {
const resolved = await renderPageContent({
it('should use empty title', () => {
const resolved = renderPageContent({
app,
content: '',
filePath: null,
Expand All @@ -106,8 +106,8 @@ const msg = 'msg'
})

describe('page frontmatter', () => {
it('should merge markdown frontmatter and options frontmatter', async () => {
const resolved = await renderPageContent({
it('should merge markdown frontmatter and options frontmatter', () => {
const resolved = renderPageContent({
app,
content: `\
---
Expand All @@ -129,8 +129,8 @@ title: title in markdown frontmatter
})
})

it('should use fields from markdown frontmatter first', async () => {
const resolved = await renderPageContent({
it('should use fields from markdown frontmatter first', () => {
const resolved = renderPageContent({
app,
content: `\
---
Expand Down

0 comments on commit 6e63dba

Please sign in to comment.