From: Tara L Andrews Date: Sat, 7 Jun 2014 08:40:22 +0000 (+0200) Subject: suppress display of hyphens for joined-on punctuation X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6b6c70985b657009175c58ae18b1d68fdb7fe574;p=scpubgit%2Fstemmatology.git suppress display of hyphens for joined-on punctuation --- diff --git a/base/lib/Text/Tradition/Collation.pm b/base/lib/Text/Tradition/Collation.pm index 1c2a36b..425259a 100644 --- a/base/lib/Text/Tradition/Collation.pm +++ b/base/lib/Text/Tradition/Collation.pm @@ -60,6 +60,8 @@ has 'tradition' => ( weak_ref => 1, ); +=encoding utf8 + =head1 NAME Text::Tradition::Collation - a software model for a text collation @@ -1021,8 +1023,10 @@ sub as_dot { next if $reading->id eq $reading->text; my $rattrs; my $label = $reading->text; - $label .= '-' if $reading->join_next; - $label = "-$label" if $reading->join_prior; + unless( $label =~ /^[[:punct:]]+$/ ) { + $label .= '-' if $reading->join_next; + $label = "-$label" if $reading->join_prior; + } $label =~ s/\"/\\\"/g; $rattrs->{'label'} = $label; $rattrs->{'id'} = $reading->id;