Escape HTML in description
Co-authored-by: Keith Cirkel <keithamus@users.noreply.github.com>
This commit is contained in:
Родитель
1b529ebeca
Коммит
8fa0ce656c
|
@ -1,6 +1,6 @@
|
|||
# <details-dialog> element
|
||||
|
||||
A modal dialog opened with a <details> button.
|
||||
A modal dialog opened with a <details> button.
|
||||
|
||||
## Installation
|
||||
Available on [npm](https://www.npmjs.com/) as [**@github/details-dialog-element**](https://www.npmjs.com/package/@github/details-dialog-element).
|
||||
|
|
|
@ -43,6 +43,10 @@ Include with a script tag:
|
|||
\`\`\``
|
||||
}
|
||||
|
||||
const escapeHTML = (html) => {
|
||||
return html.replaceAll('&', '&').replaceAll('<', '<').replaceAll('>', '>').replaceAll('"', '"').replaceAll("'", ''');
|
||||
}
|
||||
|
||||
export function readme(options) {
|
||||
const {filename = 'README.md', exclude = [], title, preamble, footer} = options ?? {}
|
||||
|
||||
|
@ -53,7 +57,7 @@ export function readme(options) {
|
|||
async packageLinkPhase({customElementsManifest}) {
|
||||
const content = [
|
||||
`# ${title || generateTitle({packageJson})}`,
|
||||
packageJson.description,
|
||||
escapeHTML(packageJson.description),
|
||||
preamble,
|
||||
generateInstallationInstructions({packageJson}),
|
||||
`## Usage`,
|
||||
|
|
Загрузка…
Ссылка в новой задаче