EPrints Technical Mailing List Archive
Message: #02783
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
[EP-tech] Re: Paragraph in abstract field
- To: eprints-tech@ecs.soton.ac.uk
- Subject: [EP-tech] Re: Paragraph in abstract field
- From: Sebastien Francois <sf2@ecs.soton.ac.uk>
- Date: Mon, 17 Mar 2014 12:13:22 +0000
Hi,
In your local conf, add: $c->{render_paras} = sub { my( $session, $field, $value, $object ) = @_; my $frag = $session->make_doc_fragment; # normalise newlines $value =~ s/(\r\n|\n|\r)/\n/gs; my @paras = split( /\n\n/, $value ); foreach my $para( @paras ) { $para =~ s/^\s*\n?//; $para =~ s/\n?\s*$//; next if $para eq ""; my $p = $session->make_element( "p", class=>"ep_field_para" ); my @lines = split( /\n/, $para ); for( my $i=0; $i<scalar( @lines ); $i++ ) { $p->appendChild( $session->make_text( $lines[$i] ) ); $p->appendChild( $session->make_element( "br" ) ) unless $i == $#lines; } $frag->appendChild( $p ); } return $frag; } Then in your eprint_fields: { name=>'abstract', #etc render_value => 'render_paras' } Seb On 14/03/14 13:14, Lourdes Calvo Montero wrote:
|
- References:
- [EP-tech] Paragraph in abstract field
- From: Lourdes Calvo Montero <lcalvom@pas.ucm.es>
- [EP-tech] Paragraph in abstract field
- Prev by Date: [EP-tech] Re: EPrints Japanese 日本の
- Next by Date: [EP-tech] Re: Updating Subjects
- Previous by thread: [EP-tech] Paragraph in abstract field
- Next by thread: [EP-tech] Re: Paragraph in abstract field
- Index(es):