@zeropress/build-core 0.6.8 → 0.6.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeropress/build-core",
3
- "version": "0.6.8",
3
+ "version": "0.6.10",
4
4
  "description": "Shared ZeroPress build core",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -329,6 +329,7 @@ function sanitizeHtml(html) {
329
329
  'ul', 'ol', 'li',
330
330
  'blockquote', 'aside',
331
331
  'figure', 'figcaption', 'picture', 'source',
332
+ 'video', 'audio', 'track',
332
333
  'table', 'thead', 'tbody', 'tr', 'th', 'td',
333
334
  'div', 'span', 'nav',
334
335
  'iframe', 'input',
@@ -338,9 +339,12 @@ function sanitizeHtml(html) {
338
339
  a: new Set(['href', 'title', 'class', 'id']),
339
340
  aside: new Set(['role', 'class', 'id']),
340
341
  img: new Set(['src', 'srcset', 'sizes', 'alt', 'title', 'class', 'id', 'width', 'height', 'loading', 'decoding']),
341
- iframe: new Set(['src', 'width', 'height', 'frameborder', 'allowfullscreen', 'class']),
342
+ iframe: new Set(['src', 'width', 'height', 'frameborder', 'allowfullscreen', 'class', 'title']),
342
343
  input: new Set(['type', 'checked', 'disabled', 'class', 'id', 'aria-label']),
343
344
  source: new Set(['src', 'srcset', 'sizes', 'type', 'media', 'width', 'height', 'class', 'id']),
345
+ video: new Set(['src', 'controls', 'autoplay', 'loop', 'muted', 'playsinline', 'poster', 'preload', 'width', 'height', 'class', 'id', 'title']),
346
+ audio: new Set(['src', 'controls', 'autoplay', 'loop', 'muted', 'preload', 'class', 'id', 'title']),
347
+ track: new Set(['src', 'kind', 'srclang', 'label', 'default', 'class', 'id']),
344
348
  '*': new Set(['class', 'id']),
345
349
  };
346
350
 
@@ -377,7 +381,7 @@ function sanitizeHtml(html) {
377
381
  continue;
378
382
  }
379
383
 
380
- if ((attributeName === 'href' || attributeName === 'src') && !safeUriPattern.test(attributeValue)) {
384
+ if ((attributeName === 'href' || attributeName === 'src' || attributeName === 'poster') && !safeUriPattern.test(attributeValue)) {
381
385
  continue;
382
386
  }
383
387
 
@@ -393,7 +397,7 @@ function sanitizeHtml(html) {
393
397
  }
394
398
  }
395
399
 
396
- const isSelfClosing = match.endsWith('/>') || normalizedTag === 'br' || normalizedTag === 'hr' || normalizedTag === 'img' || normalizedTag === 'input' || normalizedTag === 'source';
400
+ const isSelfClosing = match.endsWith('/>') || normalizedTag === 'br' || normalizedTag === 'hr' || normalizedTag === 'img' || normalizedTag === 'input' || normalizedTag === 'source' || normalizedTag === 'track';
397
401
  const attributeSuffix = filteredAttributes.length > 0 ? ` ${filteredAttributes.join(' ')}` : '';
398
402
  return isSelfClosing ? `<${normalizedTag}${attributeSuffix} />` : `<${normalizedTag}${attributeSuffix}>`;
399
403
  });