Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/utils/documents.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ function replaceSections(
frontmatter: graymatter.GrayMatterFile<string>,
) {
let result = text
// RegExp defining token pair to dicover sections in the document
// RegExp defining token pair to discover sections in the document
// [//]: # (<Section Token>)
const sectionMarkerRegex = /\[\/\/\]: # '([a-zA-Z\d]*)'/g
const sectionRegex =
Expand All @@ -198,7 +198,7 @@ function replaceSections(
for (const match of frontmatter.content.matchAll(sectionRegex)) {
if (match[1] !== match[2]) {
console.error(
`Origin section '${match[1]}' does not have matching closing token (found '${match[2]}'). Please make sure that each section has corresponsing closing token and that sections are not nested.`,
`Origin section '${match[1]}' does not have matching closing token (found '${match[2]}'). Please make sure that each section has corresponding closing token and that sections are not nested.`,
)
}

Expand All @@ -210,7 +210,7 @@ function replaceSections(
for (const match of result.matchAll(sectionRegex)) {
if (match[1] !== match[2]) {
console.error(
`Target section '${match[1]}' does not have matching closing token (found '${match[2]}'). Please make sure that each section has corresponsing closing token and that sections are not nested.`,
`Target section '${match[1]}' does not have matching closing token (found '${match[2]}'). Please make sure that each section has corresponding closing token and that sections are not nested.`,
)
}

Expand Down