Skip to content

Commit

Permalink
Merge pull request #621 from capricorn86/task/620-do-not-sanitize-val…
Browse files Browse the repository at this point in the history
…ues-in-htmloptionelement

#620@patch: HTMLOptionElement.value should not sanitize the value (ne…
  • Loading branch information
capricorn86 committed Oct 14, 2022
2 parents fca8d47 + 8356a0a commit 414e6ab
Showing 1 changed file with 1 addition and 3 deletions.
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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);
}
}

0 comments on commit 414e6ab

Please sign in to comment.