--- loncom/lonnet/perl/lonnet.pm 2003/01/28 00:09:57 1.320 +++ loncom/lonnet/perl/lonnet.pm 2003/01/31 22:12:13 1.321 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.320 2003/01/28 00:09:57 albertel Exp $ +# $Id: lonnet.pm,v 1.321 2003/01/31 22:12:13 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -3137,11 +3137,17 @@ sub metadata { foreach (@{$token->[3]}) { $metacache{$uri.':'.$unikey.'.'.$_}=$token->[2]->{$_}; } - unless ( - $metacache{$uri.':'.$unikey}=&HTML::Entities::decode($parser->get_text('/'.$entry)) - ) { $metacache{$uri.':'.$unikey}= - $metacache{$uri.':'.$unikey.'.default'}; - } + my $internaltext=&HTML::Entities::decode($parser->get_text('/'.$entry)); + my $default=$metacache{$uri.':'.$unikey.'.default'}; + if ( $internaltext =~ /^\s*$/ && $default !~ /^\s*$/) { + # only ws inside the tag, and not in default, so use default + # as value + $metacache{$uri.':'.$unikey}=$default; + } else { + # either something interesting inside the tag or default + # uninteresting + $metacache{$uri.':'.$unikey}=$internaltext; + } # end of not-a-package not-a-library import } # end of not-a-package start tag