Skip to content

Commit

Permalink
Docs: Fix TS error with generateMarkdownForExample props including ty…
Browse files Browse the repository at this point in the history
…pe undefined (#3659)
  • Loading branch information
tordans authored Feb 5, 2024
1 parent af6e183 commit 8749085
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions build/generate-docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ function generateExamplesFolder() {
htmlContent = htmlContent.replace(/\.\.\/\.\.\//g, maplibreUnpgk);
htmlContent = htmlContent.replace(/-dev.js/g, '.js');
const htmlContentLines = htmlContent.split('\n');
const title = htmlContentLines.find(l => l.includes('<title'))?.replace('<title>', '').replace('</title>', '').trim();
const description = htmlContentLines.find(l => l.includes('og:description'))?.replace(/.*content=\"(.*)\".*/, '$1');
const title = htmlContentLines.find(l => l.includes('<title'))?.replace('<title>', '').replace('</title>', '').trim()!;
const description = htmlContentLines.find(l => l.includes('og:description'))?.replace(/.*content=\"(.*)\".*/, '$1')!;
fs.writeFileSync(path.join(examplesDocsFolder, file), htmlContent);
const mdFileName = file.replace('.html', '.md');
indexArray.push({
title: title!,
description: description!,
title,
description,
mdFileName
});
const exampleMarkdown = generateMarkdownForExample(title, description, file, htmlContent);
Expand Down

0 comments on commit 8749085

Please sign in to comment.