-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rt 360 #67
Rt 360 #67
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we avoid usage of https://www.youtube.com/embed/VD6xJq8NguY
links for testing since those will be caught during secret scan ?
src/toRedactor.tsx
Outdated
@@ -494,6 +494,15 @@ export const toRedactor = (jsonValue: any,options?:IJsonToHtmlOptions) : string | |||
} | |||
figureStyles.fieldsEdited.push(figureStyles.caption) | |||
} | |||
if (jsonValue['type'] === 'social-embeds') { | |||
const sanitizedHTML = DOMPurify.sanitize(allattrs['src']) | |||
const urlMatch:any = sanitizedHTML.match(/https?:\/\/[^\s"'>]+/); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the avoid usage of any
be avoided ?
src/toRedactor.tsx
Outdated
if (urlMatch && urlMatch[0] !== 'undefined') { | ||
attrsJson['src'] = decodeURIComponent(urlMatch[0]) | ||
} else{ | ||
attrsJson['src'] = " " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could avoid adding empty space here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good to me
No description provided.