mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: parse embeddable srcdoc urls strictly (#7884)
This commit is contained in:
parent
4689a6b300
commit
afcde542f9
2 changed files with 26 additions and 10 deletions
|
@ -1,11 +1,15 @@
|
|||
import { sanitizeUrl } from "@braintree/sanitize-url";
|
||||
|
||||
export const sanitizeHTMLAttribute = (html: string) => {
|
||||
return html.replace(/"/g, """);
|
||||
};
|
||||
|
||||
export const normalizeLink = (link: string) => {
|
||||
link = link.trim();
|
||||
if (!link) {
|
||||
return link;
|
||||
}
|
||||
return sanitizeUrl(link);
|
||||
return sanitizeUrl(sanitizeHTMLAttribute(link));
|
||||
};
|
||||
|
||||
export const isLocalLink = (link: string | null) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue