Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
astro-wt
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
a63cda21
authored
2024-11-27 10:27:03 -0600
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Remove special react handling from html, it has been managed fix
fixAttributes in react.
1 parent
2d8750b4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 additions
and
18 deletions
lib/html.ts
lib/react.jsx
lib/html.ts
View file @
a63cda2
...
...
@@ -356,12 +356,6 @@ export const createAdjuster = (adjustments = {}) => {
return
adjuster
}
const
reactAttributeMap
=
{
'class'
:
'className'
,
'srcset'
:
'srcSet'
,
'maxlength'
:
'maxLength'
,
}
class
NodeProxyHandler
{
#
options
#
cache
...
...
@@ -379,15 +373,7 @@ class NodeProxyHandler {
if
(
!
origValue
)
return
origValue
switch
(
prop
)
{
case
'attributes'
:
return
this
.
#
cache
[
prop
]
=
(
origValue
?
Object
.
fromEntries
(
Object
.
entries
(
origValue
).
map
(([
key
,
value
])
=>
{
const
decoded
=
decode
(
value
)
if
(
this
.
#
options
.
react
)
{
const
{
[
key
]:
newKey
}
=
reactAttributeMap
if
(
newKey
)
return
[
newKey
,
decoded
]
}
return
[
key
,
decoded
]
}))
:
origValue
)
return
newValue
return
this
.
#
cache
[
prop
]
=
origValue
case
'parent'
:
return
this
.
#
parent
case
'children'
:
...
...
lib/react.jsx
View file @
a63cda2
...
...
@@ -25,9 +25,6 @@ export const fixAttributes = (attributes) => {
if
(
maxLength
!==
undefined
)
result
.
maxLength
=
maxLength
if
(
htmlFor
!==
undefined
)
result
.
htmlFor
=
htmlFor
return
result
return
Object
.
fromEntries
(
Object
.
entries
(
result
).
map
(([
key
,
value
])
=>
{
return
[
key
,
decode
(
value
)
]
}))
}
export
const
CreateReplacement
=
(
Element
,
propsOrCreator
)
=>
(
matchOptions
)
=>
{
...
...
Please
register
or
sign in
to post a comment