[ci] yarn format

This commit is contained in:
natemoo-re 2022-01-28 02:38:13 +00:00 committed by GitHub Actions
parent 005751a920
commit d97d61ec45
2 changed files with 3 additions and 6 deletions

View file

@ -1,3 +1,3 @@
const entities = { '"': 'quot', '&': 'amp', '\'': 'apos', '<': 'lt', '>': 'gt' } as const
const entities = { '"': 'quot', '&': 'amp', "'": 'apos', '<': 'lt', '>': 'gt' } as const;
export const escapeHTML = (string: any) => string.replace(/["'&<>]/g, (char: keyof typeof entities) => '&' + entities[char] + ';')
export const escapeHTML = (string: any) => string.replace(/["'&<>]/g, (char: keyof typeof entities) => '&' + entities[char] + ';');

View file

@ -309,10 +309,7 @@ export function createAstro(filePathname: string, site: string, projectRootStr:
const toAttributeString = (value: any) => String(value).replace(/&/g, '&#38;').replace(/"/g, '&#34;');
const STATIC_DIRECTIVES = new Set([
'set:html',
'set:text'
])
const STATIC_DIRECTIVES = new Set(['set:html', 'set:text']);
// A helper used to turn expressions into attribute key/value
export function addAttribute(value: any, key: string) {