docs: fix status badge in toc (#83)

This commit is contained in:
Nolan Lawson 2020-12-13 11:40:05 -08:00 committed by GitHub
parent 64f88624b5
commit 6fb5d68bd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -5,11 +5,11 @@ import { replaceInReadme } from './replaceInReadme.js'
const TOC_START_MARKER = '<!-- toc start -->'
const TOC_END_MARKER = '<!-- toc end -->'
const TRAVIS_BADGE = /\[!\[Build Status]\(.*?\)]\(.*?\)/
const CI_BADGE = /\[!\[Build status]\(.*?\)]\(.*?\)/
async function main () {
const content = (await readFile('./README.md', 'utf8'))
.replace(TRAVIS_BADGE, '') // remove travis badge, it confuses markdown-toc
.replace(CI_BADGE, '') // remove travis badge, it confuses markdown-toc
const toc = markdownToc(content).content
.replace('#emoji-picker-element', '#emoji-picker-element-') // it confuses GitHub's anchor links too
await replaceInReadme(TOC_START_MARKER, TOC_END_MARKER, toc)