Fix the separator macro. Adds a method to WebGUI::HTML that splits
content based on the separator macro, and does a best effort to fill in tags that the splitting breaks by and start and end tags. Update Post and Article to use it.
This commit is contained in:
parent
5dbea78e69
commit
1a74cb056d
5 changed files with 172 additions and 3 deletions
|
|
@ -652,7 +652,9 @@ sub getSynopsisAndContent {
|
|||
unless ($synopsis) {
|
||||
my @content;
|
||||
if( $body =~ /\^\-\;/ ) {
|
||||
@content = split(/\^\-\;/, $body ,2);
|
||||
my @pieces = WebGUI::HTML::splitSeparator($body);
|
||||
$content[0] = shift @pieces;
|
||||
$content[1] = join '', @pieces;
|
||||
}
|
||||
elsif( $body =~ /<p>/ ) {
|
||||
@content = WebGUI::HTML::splitTag($body);
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ use WebGUI::Cache;
|
|||
use WebGUI::Paginator;
|
||||
use WebGUI::Asset::Wobject;
|
||||
use WebGUI::Storage;
|
||||
use WebGUI::HTML;
|
||||
|
||||
our @ISA = qw(WebGUI::Asset::Wobject);
|
||||
|
||||
|
|
@ -405,7 +406,7 @@ sub view {
|
|||
$var{description} =~ s/\^\-\;//g;
|
||||
$p->setDataByArrayRef([$var{description}]);
|
||||
} else {
|
||||
my @pages = split(/\^\-\;/,$var{description});
|
||||
my @pages = WebGUI::HTML::splitSeparator($var{description});
|
||||
$p->setDataByArrayRef(\@pages);
|
||||
$var{description} = $p->getPage;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue