mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Webatrice: KnownHosts component (#4456)
* refactor dexie services for future schema updates Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
This commit is contained in:
parent
37879c4255
commit
6ce346af4a
54 changed files with 1381 additions and 1291 deletions
|
|
@ -17,13 +17,13 @@ export function sanitizeHtml(msg: string): string {
|
|||
}
|
||||
|
||||
function enforceTagWhitelist($el: JQuery<HTMLElement>, tags: string): void {
|
||||
$el.find('*').not(tags).each(() => {
|
||||
$el.find('*').not(tags).each(function enforceTag() {
|
||||
$(this).replaceWith(this.innerHTML);
|
||||
});
|
||||
}
|
||||
|
||||
function enforceAttrWhitelist($el: JQuery<HTMLElement>, attrs: string[]): void {
|
||||
$el.find('*').each(() => {
|
||||
$el.find('*').each(function enforceAttribute() {
|
||||
const attributes = this.attributes;
|
||||
let i = attributes.length;
|
||||
while (i--) {
|
||||
|
|
@ -36,7 +36,7 @@ function enforceAttrWhitelist($el: JQuery<HTMLElement>, attrs: string[]): void {
|
|||
}
|
||||
|
||||
function enforceHrefWhitelist($el: JQuery<HTMLElement>, hrefs: string[]): void {
|
||||
$el.find('[href]').each(() => {
|
||||
$el.find('[href]').each(function enforceHref() {
|
||||
const $_el = $(this);
|
||||
const attributeValue = $_el.attr('href');
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue