-
Notifications
You must be signed in to change notification settings - Fork 142
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
Server error whenever I add a youtube embed #422
Comments
sometimes this error doesn't appear however i still have an issue as the youtube embed doesn't appear, the generated html5 is just the |
Firstly, Cofoundry targets .NET Core 3.1. We will not be targeting .NET 5 because it isn't a LTS release. I suspect though, it might because you are rendering the HTML using our HTML sanitizer which is removing the embed code. If you trust the HTML you can remove the sanitizer, or you can customize the sanitizer ruleset. If that's not it, you'll need to post your code or a minimal reproducable example, specifically I'd need to at least see the custom entity model and the page block template. |
I actually don’t even have a custom entity or anything it’s a straight up clean install of cofoundry that reproduced when i tried the default project. I'm going to try disabling the sanitizer (if i find how to)
|
I can't find how to disable it though |
So, there's two issues here:
In the samples we default to strict XSS prevention, because it does need to be taken into consideration, but I agree that it's not good to give you the option to embed a video when it won't actually render! We could disable the media button in the sample projects, or perhaps look at providing a range of sanitizer defaults for different situations to make it simpler or more discoverable e.g. "Strict", "Lax", "Balanced". I see you also mentioned the YouTube plugin, note that this doesn't affect the HTML editor. The YouTube plugin contains data annotations that lets you have specific properties in your models for YouTube video data, which you can then render however you like. Have a look at the sample project in YouTube plugin repo for an example. |
I was able to fix it in the template project by using @Html.Raw, thanks ! I guess one thing that could be done might be to instead of making the default content editors use direct iframes, they could use bbcode that is then interpreted and converted to an iframe when the bbcode is valid |
Hello, I am posting this issue because I've recently setup cofoundry and i'm liking it so far, however, I'm getting a server error whenever I embed a youtube video in a rich text component, I get a server error as well as a javascript error log
when I go to the admin panel to look at the logs i have no logs related to this so the error might be purely client side, I don't really know what could be the source of the issue
The text was updated successfully, but these errors were encountered: