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
20070e45
authored
2024-11-22 08:48:01 -0600
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Change parseHtml to only have a single return statement, a single call
to proxyNode.
1 parent
e77956e4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
lib/html.ts
lib/html.ts
View file @
20070e4
...
...
@@ -386,11 +386,12 @@ const proxyNode = (node, options, parent) => {
}
export
const
parseHtml
=
(
html
:
string
,
options
):
NodeType
=>
{
const
cached
=
parsedHtmlCache
.
get
(
html
)
if
(
cached
)
return
proxyNode
(
cached
,
options
)
const
doc
=
ultraParse
(
html
)
parsedHtmlCache
.
set
(
html
,
doc
)
return
proxyNode
(
doc
,
options
)
let
cached
=
parsedHtmlCache
.
get
(
html
)
if
(
!
cached
)
{
cached
=
ultraParse
(
html
)
parsedHtmlCache
.
set
(
html
,
cached
)
}
return
proxyNode
(
cached
,
options
)
}
export
const
findNode
=
(
doc
:
NodeType
,
selector
:
string
):
NodeType
=>
{
...
...
Please
register
or
sign in
to post a comment