build: fix url error of docs in code prompt file (#3735)

This commit is contained in:
qiang 2021-09-30 17:22:26 +08:00 committed by GitHub
parent 11f2c267c4
commit f0bddd5da7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,10 +13,9 @@ const reComponentName: InstallOptions['reComponentName'] = (title: string) =>
const reDocUrl: InstallOptions['reDocUrl'] = (fileName, header) => {
const docs = 'https://element-plus.org/en-US/component/'
const _header = header
? header.replace(/[ ]+/g, '-').toLowerCase()
: undefined
return docs + fileName + (_header ? `#${_header}` : '')
const _header = header ? header.replaceAll(/\s+/g, '-').toLowerCase() : ''
return `${docs}${fileName}.html${_header ? '#' : ''}${_header}`
}
const reWebTypesSource: InstallOptions['reWebTypesSource'] = (title) => {