chore: rename module

userquin/feat-include-ids-and-anchor-check
userquin 1 year ago
parent 1feab5c05f
commit bbb229cdc4

@ -13,7 +13,7 @@ import { task } from '../utils/task'
import { bundle } from './bundle'
import { generateSitemap } from './generateSitemap'
import { renderPage } from './render'
import { checkIdsAndAnchorHrefs } from './checkAnchorRefs'
import { checkIdsAndAnchorHrefs } from './checkIdsAndAnchorHrefs'
export async function build(
root?: string,

@ -42,7 +42,7 @@ export async function* collectErrors(siteConfig: SiteConfig) {
const content = parse(
await fs.promises.readFile(resolve(outDir, entry.toString()), 'utf8')
)
// collect id headings and href anchors
// collect ids and href anchors
walkSync(content, (node) => {
if (node.type === ELEMENT_NODE) {
const id = node.attributes.id
@ -64,7 +64,7 @@ export async function* collectErrors(siteConfig: SiteConfig) {
})
// check for local hrefs and external links
for (const href of localLinks) {
// 1) check for local heading ids
// 1) check for local ids
if (href[0] === '#') {
const id = href.slice(1)
if (!localIds.has(id))
Loading…
Cancel
Save