Skip to content

HTML escape should accept only string and null - #3223

Closed
mvorisek wants to merge 4 commits into
fomantic:developfrom
mvorisek:escape_strict_string
Closed

HTML escape should accept only string and null#3223
mvorisek wants to merge 4 commits into
fomantic:developfrom
mvorisek:escape_strict_string

Conversation

@mvorisek

Copy link
Copy Markdown
Contributor

#3222 fixes missing number.replace function well, but null type is converted to "null". "" is mostly wanted to be displayed instead.

undefined is converted to "undefined". But most undefined cases are handled explicitly and values passed using setting.someValue should always be defined. Thus do not have to handle this case in general.

Casting object or array types using String() is bad and should never be done.

@mvorisek

mvorisek commented Mar 18, 2025

Copy link
Copy Markdown
Contributor Author

This PR addresses #3222 (comment).

Refs:

This behaviour is sadly caused by https://github.com/jquery/jquery/blob/3.7.1/src/data.js#L24-L47. This is impossible to be fully fixed in Fomantic-UI JS without patching jQuery on the page load (prior any jQuery operations).

See related atk4/ui#2274 / atk4/ui@45d47a9.

@mvorisek
mvorisek force-pushed the escape_strict_string branch from cf7db60 to f833e4c Compare March 19, 2025 12:02
@mvorisek
mvorisek force-pushed the escape_strict_string branch from f833e4c to 531d655 Compare March 26, 2025 22:39
@mvorisek mvorisek closed this Mar 26, 2025
@mvorisek
mvorisek deleted the escape_strict_string branch March 26, 2025 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant