Using the PHP highlighting feature stops Drupa'ls break tag from working. No matter how long the post, or where the user manually put the break tag, the page will never break.

The code tag does not suffer from this.

CommentFileSizeAuthor
#3 node_32.patch1017 bytesUwe Hermann
#1 node_25.patch646 bytesDocSavage

Comments

DocSavage’s picture

Assigned: Unassigned » DocSavage
StatusFileSize
new646 bytes

The current version of node.module, when crafting teasers without any helper teaser module, looks for the break tag and simply uses the entire body for a teaser if any php code is present. It does that to prevent breaking php code in the middle, but when php code is included for documentary purposes, this is unnecessary. This bug is most obvious when using the codefilter module, since php code is specifically used for documentation.

This patch to node.module replaces the "if any php code then use body as teaser" with code that sets teaser break points to the beginning of the php block. It's assumed that there will be some comment before showing the code, which suffices for a teaser.

Steven’s picture

Project: Code Filter » Drupal core
Component: Code » node.module

Your patch does not comply to code standards (don't use tabs, don't add comments about who added it).

Reclassifying under node.module / core.

Uwe Hermann’s picture

Version: » x.y.z
Assigned: DocSavage » Uwe Hermann
Status: Active » Needs review
StatusFileSize
new1017 bytes

This is still a problem in HEAD. Attached patch (slightly modified version of the patch by DocSavage) fixes the bug. Please review / test.

Steven’s picture

Status: Needs review » Closed (works as designed)

-1... the original issue talked about PHP highlighting (with codefilter.module), not evaluated PHP code (in filter.module). Since then we've added that check to see if the PHP code evaluating filter is actually used or not.

So this patch only affects custom PHP code teasers, which IMO should be created by the admin using excerpt.module instead.