mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-07-24 08:54:05 +10:00
Merge pull request #2186 from ADecametre/main
Fix broken hyperlinks, images and custom CSS (#2182)
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
import { sanitize } from "@reactive-resume/utils";
|
|
||||||
import { useEffect, useMemo } from "react";
|
import { useEffect, useMemo } from "react";
|
||||||
import { Helmet } from "react-helmet-async";
|
import { Helmet } from "react-helmet-async";
|
||||||
import { Outlet } from "react-router";
|
import { Outlet } from "react-router";
|
||||||
@@ -64,7 +63,7 @@ export const ArtboardPage = () => {
|
|||||||
<title>{name} | Reactive Resume</title>
|
<title>{name} | Reactive Resume</title>
|
||||||
{metadata.css.visible && (
|
{metadata.css.visible && (
|
||||||
<style id="custom-css" lang="css">
|
<style id="custom-css" lang="css">
|
||||||
{sanitize(metadata.css.value)}
|
{metadata.css.value}
|
||||||
</style>
|
</style>
|
||||||
)}
|
)}
|
||||||
</Helmet>
|
</Helmet>
|
||||||
|
|||||||
@@ -63,6 +63,8 @@ export const sanitize = (html: string, options?: sanitizeHtml.IOptions) => {
|
|||||||
allowedAttributes: {
|
allowedAttributes: {
|
||||||
...options?.allowedAttributes,
|
...options?.allowedAttributes,
|
||||||
"*": ["class", "style"],
|
"*": ["class", "style"],
|
||||||
|
"a": ["href", "target"],
|
||||||
|
"img": ["src", "alt"],
|
||||||
},
|
},
|
||||||
allowedStyles: {
|
allowedStyles: {
|
||||||
...options?.allowedStyles,
|
...options?.allowedStyles,
|
||||||
|
|||||||
Reference in New Issue
Block a user