<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title type="text">Blog posts by Robert Velnic</title><link href="http://world.optimizely.com" /><updated>2023-03-14T12:41:20.0000000Z</updated><id>https://world.optimizely.com/blogs/robert-velnic/</id> <generator uri="http://world.optimizely.com" version="2.0">Optimizely World</generator> <entry><title>Toggling content validation on TinyMCE</title><link href="https://world.optimizely.com/blogs/robert-velnic/dates/2023/2/tinymce-editor-validation/" /><id>&lt;p&gt;Recently, we received a request from one of our clients to add a feature to the TinyMCE editor that would allow them to disable or enable any validations being run on the content written into the editor. We are happy to announce that this feature is now available in version 4.1.0&lt;/p&gt;
&lt;h2&gt;Overview&lt;/h2&gt;
&lt;p&gt;The basic editor currently only runs a simple alt-text validation which checks whether or not the image inserted into the editor contains any alternative text used for accessibility. With this new feature, users can now choose whether or not they want to disable validation from happening.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/link/f07723f22c1a4263af19efbc5ad06427.aspx&quot; /&gt;&lt;/p&gt;
&lt;p&gt;As it stands, when validation runs on the editor, warnings will become visible while publishing a page and they might feel as if they are unnecessary or distracting.&lt;/p&gt;
&lt;h2&gt;Configuration&lt;/h2&gt;
&lt;p&gt;By default, validation on the editor will run as-is without any prior configuration. To disable it we have provided two methods:&lt;/p&gt;
&lt;h3&gt;Through an extension method on IServiceCollection&lt;/h3&gt;
&lt;p&gt;The method takes an optional bool parameter. If it is set to&amp;nbsp;&lt;em&gt;true,&amp;nbsp;&lt;/em&gt;validation will not run (this is the default). If it is set to&amp;nbsp;&lt;em&gt;false&lt;/em&gt; it will run.&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;services.AddTinyMce().DisableEditorValidation()&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;By disabling directly through TinyMceConfiguration&lt;/h3&gt;
&lt;p&gt;The usage is same as above, except the bool parameter is required.&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;services.Configure&amp;lt;TinyMceConfiguration&amp;gt;(config =&amp;gt; {
    config.Default()
          .DisableValidation(true);
});&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Disabling the validation on the editor no longer runs any checks on the content, and as such, no warnings will be shown.&lt;/p&gt;</id><updated>2023-03-14T12:41:20.0000000Z</updated><summary type="html">Blog post</summary></entry></feed>