-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Raw HTML embedding #8204
Comments
I think gathering usage ideas would be awesome. The first thing that came to my mind are:
This rise a question - should we allow JS in there? If yes - document it as a potential security risk. |
The same could happen with |
Much sites should be able to be embedded using OEmbed or services like iframely → https://iframely.com/embed/https%3A%2F%2Fblog.comandeer.pl%2F Additionally nearly every kind of embed uses JS in some form (see the example above), so stripping JS out of the pasted content could make the whole thing pretty useless. At the same time keeping JS can be dangerous… |
Notes from my sync with @pomek:
|
How do we want to call the new package?
I don't know. |
👍 |
Docs: We must mention clearly and visibly that this is a special feature. |
First results of the conversion. It works. However, there are my 3 cents:
I guess the concept of the UI is required in order to continue work on the feature. |
A question. We can provide a default configuration that the end-users could modify in order to match their needs. The question is – should we? |
That depends on whether you see a use case for that. And it's easier to start with no option, that's for sure. Plus, we will be able to change the sanitizer with time if it's our internal thing. |
👍
You can use an instance of HtmlDataProcessor to turn a view structure into a string. |
We discussed this f2f and the problem is that the default options of sanitize-html strip, among others, iframes and inline styles. It is highly configurable, though. Same for DOMPurify – it also strips iframes by default, although keeps inline styles. In our case, stripping inline styles, iframes, video elements, etc. would make the preview feature quite useless. Therefore, we'd need to loosen the default settings. However, if we change anything we risk allowing for a bit too much. So, we need to be very careful with that and test the final solution ourselves. Things that should be previewable to make the preview useful:
Things that should not be allowed (other than obvious things):
Let's try to configure sanitize-html and DOMPurify to these requirements and test both with payloads from some XSS database. |
What should we do with <form action="/my-handling-form-page" method="post">
<ul>
<li>
<label for="name">Name:</label>
<input type="text" id="name" name="user_name">
</li>
<li>
<label for="mail">E-mail:</label>
<input type="email" id="mail" name="user_email">
</li>
<li>
<label for="msg">Message:</label>
<textarea id="msg" name="user_message"></textarea>
</li>
</ul>
</form> ATM, I would prefer to do the same that the sanitizer does (remove): |
UI/UX proposalI'm for the inline editing strategy, as suggested by @pkwasnik. It sounds simple and if we pull it off this will lay the groundwork and pave the way for the code snippet feature (editing in a black-box inside editor content but beyond engine's reach). But first, let's see if there are some serious blockers in this approach. ViewsAdding and editing the embedAn afterthought: this widget needs a selection handler (like tables). Previewing the raw contentUX enhancements related to sanitizationRisks
|
@psmyrek, did you test how a textarea works within the editor when working on #4600? |
This feature is targetted at more advanced users, so using the word "HTML" would be fine. Would it somehow fit in the icon? |
I'm not so sure about this. They could use PHP there. Or virtually anything for that matter (e.g. markdown?). So using "HTML" is not the best decision IMO (not very future-proof) although people may get a general idea.
Yes, but this is going to be ugly. |
In order to have a textarea and the toggle button inside the widget, we must use changes from this PR – #8243. |
Hi, is it necessary to print the |
Exact same problem here.
Fazit, with CKEditor you can currently not build your own HTML. It is either wrapped in unnecessary HTML div, or stripped, which as said, is extremely confusing, since editing source code really means that: editing source code. If anything, the insert HTML feature should be used to insert HTML like "insert code snippet" and the editing source code, should be what we use if we want to build our own HTML. Is there any solution at least to either allow more HTML when editing source code, or to strip that |
📝 Provide a description of the new feature
An idea of the feature is the ability to paste any HTML markup to the editor that will be displayed as a widget in the editing area and the raw HTML in the output data.
View:
editor.getData()
Most probably, in the view, we will generate a preview that the user will not be able to interact with.
If you'd like to see this feature implemented, add a 👍 reaction to this post.
The text was updated successfully, but these errors were encountered: