Using the default setting should place the Read More anchor at the end of the teaser, but on certain posts I am seeing the link placed before the end of the teaser.

For example, on a post with a short paragraph followed by an H3 header where the H3 is just before the automatic cut-off, the Read More is placed at the end of the paragraph, not just after the H3 tag as would be expected.

Comments

mcurry’s picture

Would you mind attaching the source content (html or whatever) from the post in question, or a test posting that demonstrates this problem?

Also, I need to know what your 'teaser length' settings are, if you are not using

for manual break positioning.

I believe I know why this is happening, I need a good test case.

A cheesy workaround, if you are using

is to always place a

...

around the last bit of text (or create an empty

..

section before the

mcurry’s picture

Oops, sorry about that - the invisible text is my bad... forgot to escape the HTML entities...

Would you mind attaching the source content (html or whatever) from the post in question, or a test posting that demonstrates this problem?

Also, I need to know what your 'teaser length' settings are, if you are not using for manual break positioning.

I believe I know why this is happening, I need a good test case.

A cheesy workaround, if you are using is to always place a

<p>...</p>

around the last bit of text (or create an empty

<p>..</p>

section just before the <!--break-->

mcurry’s picture

Title: Read More lable placed not quite at the teaser end » Read More label placed not quite at the teaser end
teledyn’s picture

Here is the original text:

<em>A picture is worth a thousand words</em> and nothing spiffs up the sight of your favourite website like a few well-chosen photos of our peninsular paradise.  Got a shot you want to share with your neighbours and the world?  Got a snap that's just too pertinent to the topic?  You can post it here, and it's a bit of a tangle to get set up, but once you have it, it's a breeze to <i>shoot and post</i>
<h4>Here's how ...</h4>

In this particular case it made more sense to place the break flag just before the h4, but this is an example that clearly demonstrates the flag being placed before the end of the preview text segment. I have seen it happen with other code as well, but this was a recent example so it was easy to find.

The teaser length is 800, and here's the generated HTML code as it appears in a preview:

<p><em>A picture is worth a thousand words</em> and nothing spiffs up the sight of your favourite website like a few well-chosen photos of our peninsular paradise.  Got a shot you want to share with your neighbours and the world?  Got a snap that's just too pertinent to the topic?  You can post it here, and it's a bit of a tangle to get set up, but once you have it, it's a breeze to <i>shoot and post</i> <span class="read-more"><a href="http://sbp.teledyn.com/node/725">&nbsp;read&nbsp;more&nbsp;»</a></span></p>
<h4>Here's how ...</h4>

Unfortunately my site is frequented by predominantly non-technical people, so it's not really possible to enforce coding standards to their HTML (and the wysiayg editors were very unpopular); for that reason, I'm going to try one of the alternate settings for positioning the link, but I just thought you'd like to know about this placement bug.

mcurry’s picture

Assigned: Unassigned » mcurry
Priority: Normal » Critical

Yes, this is a general problem - if the last item in a teaser isn't a

then the read more link is placed in an unexpected location. I'll work on this ASAP.

mcurry’s picture

argh... html...

Yes, this is a general problem - if the last html tag in a teaser isn't a </p> then the read more link is placed in an unexpected location. I'll work on this ASAP.

teledyn’s picture

Since my input filters actually do place the <p> tags around that paragraph, could the issue be solved by making the ReadMore into an input filter that can be folded into a custom filter and placed after the auto-paragraph-break filter? That might solve my problem since I always auto-P the member posts.

mcurry’s picture

That's an interesting idea, and I might investigate it next time I'm in the code.

I would expect that approach to create its own challenges and problems, though, so I will try for a simpler solution to this problem.

mcurry’s picture

Priority: Critical » Normal

non-critical.

todd nienkerk’s picture

Status: Active » Closed (won't fix)

The 5.x branch is no longer supported. If this is still a problem, please reopen.