Closed (fixed)
Project:
Read More Link (Drupal 6 and earlier)
Version:
6.x-5.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
30 Aug 2009 at 04:32 UTC
Updated:
23 Dec 2010 at 03:20 UTC
Jump to comment: Most recent file
Comments
Comment #1
todd nienkerk commented@netbear: I'm not as familiar with regex as I'd like to be. Can you explain what this change does, exactly?
Before:
'!</?'. $block_tags .'[^>]*>$!i'After:
'!</?'. $block_tags .'[^>]*>s*$!mi'Comment #2
netbear commentedAs default preg_match() works in one_line mode, means that "\n" is not recognizable as space by this command.
In teaser after <p> tag seems the last simbol is linebreak "\n". My change of regexp takes this possibility into account.
Comment #3
todd nienkerk commentedCommitted to 6.x-5.x-dev. Thanks!
Comment #4
todd nienkerk commentedComment #6
flaviovs commentedI applied the proposed fix and it indeed worked, except that sometimes the link was being put in odd places, more specifically they're being put on the first closing tag of a multi paragraph teaser.
Something like:
I then did remove the "m" and changed the regexp to make it ignore whitespaces at the end of the teaser, which looked like the cause for the link not being put inline anymore. I.e. changed
To:
(Notice the "\s*" near the end of the regexp.)
Now the problem is gone. Inline is working as expected, and no read more link in odd places.
Comment #7
dboulet commentedI'm having the same problem as the original poster—it looks like the fix committed here has since been undone. Here's a patch with an alternative fix.
Comment #8
flaviovs commenteddboulet, the fix in #6 does the same thing and it's much faster and use less memory that the rtrim() method used in your patch. Please, consider using the changed regexp to fix the issue.
I'm so sorry I cannot provide a proper patch file now, but the change is straightforward, as can be seen in my comment.
Comment #9
dboulet commentedWorks for me, here's a new patch.
Comment #10
todd nienkerk commentedI will be committing this patch shortly. Thanks!