Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [v0.2.34] - 2026-03-13

### Changed
- Allow comments in sanitizer for `html` (needed for `@aegisjsproject/iota`)

## [v0.2.33] - 2026-01-12

### Added
Expand Down
57 changes: 32 additions & 25 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aegisjsproject/core",
"version": "0.2.33",
"version": "0.2.34",
"description": "A fast, secure, modern, light-weight, and simple JS library for creating web components and more!",
"keywords": [
"aegis",
Expand Down Expand Up @@ -92,22 +92,22 @@
"homepage": "https://github.com/AegisJSProject/core#readme",
"devDependencies": {
"@aegisjsproject/component": "^0.1.7",
"@aegisjsproject/dev-server": "^1.0.5",
"@aegisjsproject/dev-server": "^1.0.6",
"@aegisjsproject/http-utils": "^1.0.4",
"@aegisjsproject/styles": "^0.2.7",
"@rollup/plugin-node-resolve": "^16.0.3",
"@rollup/plugin-terser": "^1.0.0",
"@shgysk8zer0/eslint-config": "^1.0.4",
"@shgysk8zer0/importmap": "^1.7.5",
"@shgysk8zer0/polyfills": "^0.6.0",
"eslint": "^10.0.0",
"rollup": "^4.9.6"
"@shgysk8zer0/eslint-config": "^1.0.7",
"@shgysk8zer0/importmap": "^1.8.1",
"@shgysk8zer0/polyfills": "^0.6.2",
"eslint": "^10.0.3",
"rollup": "^4.59.0"
},
"dependencies": {
"@aegisjsproject/callback-registry": "^2.0.0",
"@aegisjsproject/callback-registry": "^2.0.2",
"@aegisjsproject/escape": "^1.0.4",
"@aegisjsproject/parsers": "^0.1.5",
"@aegisjsproject/router": "^1.1.3",
"@aegisjsproject/parsers": "^0.1.6",
"@aegisjsproject/router": "^1.1.15",
"@aegisjsproject/sanitizer": "^0.2.4",
"@aegisjsproject/state": "^1.0.7",
"@aegisjsproject/url": "^1.0.3"
Expand Down
13 changes: 7 additions & 6 deletions parsers/html.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
import { stringify } from '../stringify.js';
import { sanitizer as sanitizerConfig } from '@aegisjsproject/sanitizer/config/base.js';
import { elements, attributes } from '@aegisjsproject/sanitizer/config/base.js';
import { getRegisteredComponentTags } from '../componentRegistry.js';
import { createHTMLParser, doc } from '@aegisjsproject/parsers/html.js';
import { isTrustPolicy } from '../trust.js';
import { observeEvents } from '@aegisjsproject/callback-registry';

const sanitizer = Object.freeze({
...sanitizerConfig,
const sanitizerConfig = Object.freeze({
comments: true,
dataAttributes: true,
get elements() {
return [...sanitizerConfig.elements, ...getRegisteredComponentTags()];
return [...elements, ...getRegisteredComponentTags()];
},
get attributes() {
return ['theme', ...sanitizerConfig.attributes];
return ['theme', ...attributes];
},
});

export const html = createHTMLParser(sanitizer, { mapper: stringify });
export const html = createHTMLParser(sanitizerConfig, { mapper: stringify });

export const el = (...args) => html.apply(null, args)?.firstElementChild;

Expand Down
2 changes: 1 addition & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ h1.textContent = 'Hello, World!';
frag.append(h1);

try {
document.body.append(html`<header onclick="alert(location)" foo="bar">
document.body.append(html`<!-- Testing comment --><header onclick="alert(location)" foo="bar">
${frag}
<hello-world></hello-world><h1 foo="bar">Click Me!</h1>
<svg viewBox="0 0 10 10" height="24" width="24">
Expand Down
Loading