We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7311950 commit 18fdca5Copy full SHA for 18fdca5
1 file changed
src/stdlib/html/mod.nu
@@ -1,12 +1,7 @@
1
# HTML DSL for nushell
2
3
-# Escape HTML special characters for text content
+# Escape HTML special characters
4
def escape-html []: string -> string {
5
- $in | str replace -a '&' '&' | str replace -a '<' '<' | str replace -a '>' '>'
6
-}
7
-
8
-# Escape HTML special characters for attribute values
9
-def escape-html-attr []: string -> string {
10
$in
11
| str replace -a '&' '&'
12
| str replace -a '"' '"'
@@ -47,7 +42,7 @@ export def attrs-to-string []: record -> string {
47
42
} else {
48
43
$attr.value
49
44
}
50
- $'($attr.key)="($value | escape-html-attr)"'
45
+ $'($attr.key)="($value | escape-html)"'
51
46
52
| where $it != ""
53
| str join ' '
0 commit comments