Project

General

Profile

Actions

Bug #28741

closed

stdWrap.cropHTML does not respect line breaks

Added by Timo Webler over 12 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
TypoScript
Target version:
-
Start date:
2011-08-04
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Crop does not work for a number of character after a line break.

TypoScript:

 
page = PAGE
page {
    10 = TEXT
    10 {
        value (
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Aenean commodo <span>ligula eget dolor. Aenean massa.</span>
Cum sociis natoque penatibus et magnis dis parturient montes, nascetur.
        )
        cropHTML = 20 | ...
    }
}

Example 1 (correct):
cropHTML = 20 | ...

Expected:

Lorem ipsum dolor si...

Output:
Lorem ipsum dolor si...

Example 2 (not correct):
cropHTML = 66 | ...

Expected:

Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Aenean...

Output:
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.... 

Actions #1

Updated by Jigal van Hemert over 12 years ago

  • Status changed from New to Accepted

It looks like a problem with the regular expression which doesn't see line breaks as normal whitespace characters. Maybe the function needs to do some whitespace contraction before cropping (just like a browser combines series of various whitespace characters into a single space)?

Actions #2

Updated by Gerrit Code Review about 11 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/18219

Actions #3

Updated by Gerrit Code Review about 11 years ago

Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/19499

Actions #4

Updated by Gerrit Code Review about 11 years ago

Patch set 1 for branch TYPO3_4-7 has been pushed to the review server.
It is available at https://review.typo3.org/19500

Actions #5

Updated by Gerrit Code Review about 11 years ago

Patch set 1 for branch TYPO3_4-5 has been pushed to the review server.
It is available at https://review.typo3.org/19501

Actions #6

Updated by Alexander Stehlik about 11 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #7

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF