Improve interaction with HTML filter
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3530906. -->
Reported by: [lostcarpark](https://www.drupal.org/user/346773)
Related to !22
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>As discussed in <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/markdown_easy/-/work_items/3493938" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/markdown_easy/-/work_items/3493938</a></span>, it can be difficult to configure the filter as tags missing from the HTML filter can be difficult to spot.</p>
<p>In that discussion, four solutions were suggested:</p>
<ol>
<li>Validate on save, and warn about any missing tags for the selected Markdown flavor.</li>
<li>Autoconfigure allowed tags based on selected flavor.</li>
<li>Make the HTML filter optional. This would be a potential security risk.</li>
<li>Move the HTML filter before the Markdown Easy filter.</li>
</ol>
<p>Please see that issue for full discussion and reasoning.</p>
<h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>I suggest continuing discussion on the above options, but to begin work on implementation of option 1, as this is useul, even if combined with one of the other options.</p>
<p>To do this, add additional validation to the <code>_markdown_easy_filter_format_form_submit</code> hook, to validate against list of tags for the selected flavor.</p>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<ul>
<li>Continue discussion</li>
<li>Add validation on filter save</li>
</ul>
<h3 id="summary-ui-changes">User interface changes</h3>
<p>None.</p>
<h3 id="summary-api-changes">API changes</h3>
<p>None.</p>
<h3 id="summary-data-model-changes">Data model changes</h3>
<p>None.</p>
issue