简体   繁体   中英

Drupal PHP field stripping HTML tags

This is Drupal 9 specific PHP issue: so bear with me.

I have several fields in Drupal field which are stored as RAW HTML, in Drupal terms which are called - Fields and the Values are stored - in field definition formatted html.

Problem: During re-edit, editor/edit screen pulls stripped html. HTML imported are strpped off HTML tags and HTML classes. And when re-edited post is saved the stripped html is getting stored( Overwritten )

This is causing serious issues for my site, cause this is a required feature. And some of my website-structue is depends upon the RAW HTML .

This could be PHP specific issue. If someone has experience regarding this, and how to get away with this - would be a help.

I need to get away with this, this is causing serious troubles with my Website Structure.

Description: Original HTML

<ul class="nav flex-column pl-0">

<li class="nav-head">Xamarin</li>

<li class="nav-item"><a class="nav-link" href="#">Overview</a></li>
<li class="nav-item"><a class="nav-link active" href="#">Analytics</a></li>
<li class="nav-item"><a class="nav-link" href="#">Export</a></li>
<li class="nav-item"><a class="nav-link" href="#">Snippets</a></li>
<li class="nav-item"><a class="nav-link" href="#">Flexbox</a></li>

<li class="nav-header">Xamarin Installation</li>

<li class="nav-item"><a class="nav-link" href="#">Layouts</a></li>
<li class="nav-item"><a class="nav-link" href="#">Templates</a></li>
<li class="nav-item"><a class="nav-link" href="#">Themes</a></li>

</ul>

When input through text-formatted-longHTML 输入

When imported - During re-edit the formatted-field is striping html tags, and does not pull full html. 导入剥离的 html

**For post visibility, I have posted the same issue, in several forums. So, this is not spammy qusetion, genuine development question

Choose Text format as Full HTML , your HTML will not be stripped anymore. 在此处输入图像描述

Update:

It seems that your use of module Gutenberg did not display the Text format options. So, install the module Allowed Formats then enable the format Full HTML for your field.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM