17488 Posts in 4473 Topics by 1978 members
| Go to End | ||
| Author | Topic: | 4867 Views |
-
Re: why is the blog summary paragraph injecting line breaks?

12 July 2008 at 7:35am
I didn't need it, but it's a good idea. I didn't test all the scenarios where the line breaks are added and it is entirely possible that there are some where spaces are stripped.
-
Re: why is the blog summary paragraph injecting line breaks?

6 August 2008 at 9:36pm
Thanks so much for this fix, Hamish. It was a very annoying problem for me. I also needed a sentence summary of each post, so I adapted your fixed function:
function SentenceSummary(){
$content = new Text('Content');
$content->value = Convert::raw2xml($this->Content);
$firstParagraph = preg_replace( '/((\n)|(\r))/', ' ', $content->FirstSentence());
$parser = new BBCodeParser($firstParagraph);
return $parser->parse();
} -
Re: why is the blog summary paragraph injecting line breaks?

7 August 2008 at 4:22pm
In trac it appears this has been fixed properly, although it hasn't made it to release. This is the newer fix, which should work without the dodgy preg_replace's.
$parser = new BBCodeParser($this->Content);
$html = new HTMLText('Content');
$html->setValue($parser->parse());
return $html->FirstParagraph('html');Still waiting for an official next release of the blog module.. maybe they just assume that everyone uses subversion?
| 4867 Views | ||
| Go to Top |


