Closed oott123 closed 4 years ago
Why do you think current usage is not correct?
@meteorlxy because it wont find renderResourceHints tag correctly and it will add '<!--before-resource-hints-->'
and '<!--after-resource-hints-->'
tags every time you build the site, no matter they exists or not.
@oott123 Oh nice catch. Thanks :heart:
cc @Shigma
Summary
Which package does this PR involve? (check one)
What kind of change does this PR introduce? (check at least one)
Does this PR introduce a breaking change? (check one)
If yes, please describe the impact and migration path for existing applications:
The PR fulfills these requirements:
fix #xxx[,#xxx]
, where "xxx" is the issue number)Other information:
String.prototype.find
will treat the first argument as regexp.The vairable
resourceOriginal
, which contents is{{{ renderResourceHints() }}}
, was not works as expected because()
was treated as regex match groups. This leads to many unused tags generated in the ssr template.indexOf is safe for any string to find the neddle in string.