Details
Description
The core function shorten_text is supposed to close any HTML tags that it cuts off. However this only occurs sometimes, depending on the parameters. The sequence of events that occurs is:
- Function divides input into blocks starting with each tag (open/close/empty)
- Loops through these input 'lines' until there is more text than the shorten_text allows
At this point, any tags that are not closed (ie that would be closed in future 'lines') are safe - they will be closed.
- Goes back looking for a space or suitable breakpoint to chop the text so it is under the limit
During this process close tags may be chopped off. These are not re-added.
Attachments
Issue Links
| This issue blocks: | ||||
| MDL-20609 | Analysis quiz report produces a very wide tables if correct answer doesn't contain spaces |
|
|
|
Note: I already committed a minor change to fix whitespace. This has the side effect of meaning the code is the same in HEAD.
Here is a patch that contains the fix and a small selection of unit tests that indicate I probably haven't broken everything.
The patch applies to 1.9 and 2.0
Tim, could you confirm your review please?