开发者

Drupal trimmer causes nested div's

开发者 https://www.devze.com 2023-04-09 13:29 出处:网络
I work with views. A view manages the display of some text. I checked under REWRITE RESULTS the Trim this field to a maximul length-box and alsoo the Trim only a word-box and Add an eclips...-box.

I work with views. A view manages the display of some text. I checked under REWRITE RESULTS the Trim this field to a maximul length-box and alsoo the Trim only a word-box and Add an eclips...-box.

Where the pages used to look like this:

<div class="test"></div>
<div class="test"></div>
<div class="test"></div>
<div class="test"></div>

now it's like this:

<开发者_C百科;div class="test"><div class="test"><div class="test"><div class="test"></div></div></div></div>

Is this a (known) Drupalbug or what am I doing wrong here?


Try toggeling "Strip HTML tags". It did work for me!


How many characters are you restricting the field to?

If it is trimming the closing 's from the field and trying to output

<div class="test"><div class="test"><div class="test"><div class="test">

Then it maybe that either Firefox is closing the divs by itself or it may be that the views trim function tries to tidy the HTML up before outputting it - and it has to guess where the divs should be closed and unfortunately for you, it's guessed wrong by closing them all at the end of string.

Your best option is to either get the view to strip the HTML before trimming, or display it untrimmed. Trimming HTML to a fixed length can cause all kinds of strange issues if you chop off the ends.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号