Bug #103144
opencrop ViewHelper has a curious interpretation of respecting word boundaries
0%
Description
Hello,
the f:format.crop ViewHelper does not take the full string into account to cut at position of maxCharacters.
```
<f:format.crop maxCharacters="18" respectHtml="true" respectWordBoundaries="true"><p>Ein schönes Bild</p><img src="#" width="128" height="128" title="nice" alt="sonne"><p>Nicht wahr?</p></f:format.crop>
```
Results in:
```
<p>Ein schönes Bild</p><img src="#" width="128" height="128" title="nice" alt="sonne"/><p>Ni…</p>
```
The HtmlCropper cuts all text and html parts into sections. So, we have sections with p, sections with img and of cause two text sections in the resulting array. The expected behavior is, that the HtmlCropper should cut in front of "Nicht", but instead it cuts inside of that word. That's because internally this text is in another section and does not know anything about the previous text. That's why HtmlCropper thinks, that "Nichts" would be the first and only word and that why it cuts within the word instead of in front of that word.
German explanation with example: https://www.typo3lexikon.de/typo3-tutorials/core/systemextensions/fluid/viewhelper/format/#beispiel-nicht-im-html-trennen
Stefan