From 8356a0ab78aa0ebf23afb4ef46be648648e28a90 Mon Sep 17 00:00:00 2001 From: David Ortner Date: Fri, 14 Oct 2022 19:38:24 +0200 Subject: [PATCH] #620@patch: HTMLOptionElement.value should not sanitize the value (new lines and trimming). --- .../src/nodes/html-option-element/HTMLOptionElement.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/happy-dom/src/nodes/html-option-element/HTMLOptionElement.ts b/packages/happy-dom/src/nodes/html-option-element/HTMLOptionElement.ts index 2f19d364f..a2b7a615b 100644 --- a/packages/happy-dom/src/nodes/html-option-element/HTMLOptionElement.ts +++ b/packages/happy-dom/src/nodes/html-option-element/HTMLOptionElement.ts @@ -3,8 +3,6 @@ import IHTMLElement from '../html-element/IHTMLElement'; import IHTMLFormElement from '../html-form-element/IHTMLFormElement'; import IHTMLOptionElement from './IHTMLOptionElement'; -const NEW_LINES_REGEXP = /[\n\r]/gm; - /** * HTML Option Element. * @@ -113,6 +111,6 @@ export default class HTMLOptionElement extends HTMLElement implements IHTMLOptio * @param value Value. */ public set value(value: string) { - this.setAttributeNS(null, 'value', String(value).trim().replace(NEW_LINES_REGEXP, '')); + this.setAttributeNS(null, 'value', value); } }