diff --git a/src/utils/documents.server.ts b/src/utils/documents.server.ts index 0dff458d..4cf69786 100644 --- a/src/utils/documents.server.ts +++ b/src/utils/documents.server.ts @@ -177,7 +177,7 @@ function replaceContent( * Perform tokenized sections replace in text. * - Discover sections based on token marker via RegExp in origin file. * - Discover sections based on token marker via RegExp in target file. - * - replace sections in target file staring from the end, with sections defined in origin file + * - replace sections in target file starting from the end, with sections defined in origin file * @param text File content * @param frontmatter Referencing file front-matter * @returns File content with replaced sections @@ -187,7 +187,7 @@ function replaceSections( frontmatter: graymatter.GrayMatterFile, ) { let result = text - // RegExp defining token pair to dicover sections in the document + // RegExp defining token pair to discover sections in the document // [//]: # (
) const sectionMarkerRegex = /\[\/\/\]: # '([a-zA-Z\d]*)'/g const sectionRegex = @@ -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.`, ) } @@ -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.`, ) }