Skip to content

Commit

Permalink
fix: script 标签中内容被转义
Browse files Browse the repository at this point in the history
  • Loading branch information
Jinbao1001 committed Apr 23, 2024
1 parent e0972d3 commit 04fd819
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/preset-umi/src/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ umi build --clean
MetadataLoaderOmitKeys.Meta,
]) as Omit<
typeof args,
MetadataLoaderOmitKeys.Title & MetadataLoaderOmitKeys.Meta
MetadataLoaderOmitKeys.Title | MetadataLoaderOmitKeys.Meta
>)
: args;
const finalMarkUpArgs = {
Expand Down
8 changes: 5 additions & 3 deletions packages/renderer-react/src/html.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,11 @@ const HydrateMetadata = (props: IHtmlProps) => {
{htmlPageOpts?.headScripts?.map((script: IScript, key: number) => {
const { content, ...rest } = normalizeScripts(script);
return (
<script key={key} {...(rest as any)}>
{content}
</script>
<script
key={key}
{...(rest as any)}
dangerouslySetInnerHTML={{ __html: content }}
/>
);
})}
</>
Expand Down

0 comments on commit 04fd819

Please sign in to comment.