Make WordPress Core

Opened 16 years ago

Closed 16 years ago

#7686 closed defect (bug) (wontfix)

WordPress Sandwiches MORE tag Improperly when Submitting via XML-RPC cCLient

Reported by: iacas's profile iacas Owned by:
Milestone: Priority: high
Severity: normal Version: 2.6.1
Component: XML-RPC Keywords: more tag, xml-rpc, newline
Focuses: Cc:

Description

The <!--more--> tag used to be on its own line:

if ($post_more) {
    $post_content = $post_content . "\n<!--more-->\n" . $post_more;
}

I believe a change was made in 2.6 to strip the newlines, which results in awkward and I would say incorrect behavior. Paragraphs that are not meant to be together are instead smooshed together, as the auto-paragraphing done by WordPress doesn't account for the <!--more--> tag being stuck on anything but its own line.

Two supporting links:
http://infinite-sushi.com/support/viewtopic.php?f=11&t=1021&start=0&st=0&sk=t&sd=a
http://nslog.com/2008/09/04/wordpress_bug_in_26x_sandwiched_more_tag

Change History (8)

#1 @josephscott
16 years ago

  • Cc josephscott added

Please read up on the history of this in ticket #6016

#2 @redsweater
16 years ago

iacas - I can appreciate that the fix in 2.6 isn't ideal. I think it was a good first step to bring the behavior of the XMLRPC interface closer to the web editing interface.

One of the things that motivated my submission of #6016 is that some customers of mine were annoyed that they could achieve greater control over the base/extra content in the web admin interface than they could through a remote editor such as MarsEdit.

So, how can we make the behavior better across the board? Keep the behaviors the same between the web and XMLRPC interfaces, but achieve more happiness all around?

#3 @redsweater
16 years ago

  • Cc redsweater added

#4 follow-up: @ecto
16 years ago

  • Cc ecto added

redsweater, I think your original suggestion was to use "$post_content = trim($post_content) . "\n<!--more-->\n" . trim($post_more);", which looks good to me, but the current version has "$post_content = trim($post_content) . "<!--more-->" . trim($post_more);" which fails to work if body and extended aren't ending with a linebreak. That means the blogger has to manually append a linebreak. I doubt that's how it works in the web interface.

I recommend to fix per your original suggestion. i.e. "$post_content = trim($post_content) . "\n<!--more-->\n" . trim($post_more);"

#5 in reply to: ↑ 4 @josephscott
16 years ago

Replying to ecto:

I doubt that's how it works in the web interface.

That's exactly how it works in the web interface. The new lines were removed to bring it in line with how wp-admin did things.

#6 @redsweater
16 years ago

Yeah, my memory of it is that my suggestion was risky because it didn't match what the admin interface does. I think the admin interface is flawed, but in lieu of a complete fix I thought it was a move in the right direction to have them behave identically.

#7 @ecto
16 years ago

Well, I guess it has to be done smarter then. You need code that verifies whether $post_content ends in a linebreak or an HTML linebreak (closing p, div, pre, blockquote, ul or a br tag) and if not, appends a linebreak, then slaps on the more tag. Then verify the same for post_more but at start of it.

#8 @josephscott
16 years ago

  • Milestone 2.7 deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Since the XML-RPC approach matches wp-admin I'm going to go ahead and close this ticket. If we come up with a new approach that's coordinated with wp-admin then we can revisit the issue.

Note: See TracTickets for help on using tickets.