Skip to content

Commit

Permalink
fix: do not escape GitHub alerts in readmes (#1512)
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain committed May 1, 2024
1 parent bfa7622 commit 3b58126
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/docs/readme-updater-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,15 @@ function updateReadme (aboutMd, manifestPath, readmePath, app) {
parsedReadme.children.push(child)
})

const updatedReadmeContents = writeMarkdown(parsedReadme)
let updatedReadmeContents = writeMarkdown(parsedReadme)

// workaround for https://github.com/syntax-tree/mdast-util-to-markdown/issues/61
updatedReadmeContents = updatedReadmeContents
.replaceAll('\\[!NOTE]', '[!NOTE]')
.replaceAll('\\[!TIP]', '[!TIP]')
.replaceAll('\\[!IMPORTANT]', '[!IMPORTANT]')
.replaceAll('\\[!WARNING]', '[!WARNING]')
.replaceAll('\\[!CAUTION]', '[!CAUTION]')

fs.writeFileSync(readmePath, updatedReadmeContents, {
encoding: 'utf-8'
Expand Down

0 comments on commit 3b58126

Please sign in to comment.