mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-12-18 03:14:06 +00:00
Fix display of abbreviations contained '-' character
This commit is contained in:
parent
72a8a09513
commit
010b4dc974
9
dsl.cc
9
dsl.cc
|
@ -1022,14 +1022,23 @@ string DslDictionary::nodeToHtml( ArticleDom::Node const & node )
|
||||||
title.reserve( i->second.size() );
|
title.reserve( i->second.size() );
|
||||||
|
|
||||||
for( char const * c = i->second.c_str(); *c; ++c )
|
for( char const * c = i->second.c_str(); *c; ++c )
|
||||||
|
{
|
||||||
if ( *c == ' ' || *c == '\t' )
|
if ( *c == ' ' || *c == '\t' )
|
||||||
{
|
{
|
||||||
// u00A0 in utf8
|
// u00A0 in utf8
|
||||||
title.push_back( 0xC2 );
|
title.push_back( 0xC2 );
|
||||||
title.push_back( 0xA0 );
|
title.push_back( 0xA0 );
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
if( *c == '-' ) // Change minus to non-breaking hyphen (uE28091 in utf8)
|
||||||
|
{
|
||||||
|
title.push_back( 0xE2 );
|
||||||
|
title.push_back( 0x80 );
|
||||||
|
title.push_back( 0x91 );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
title.push_back( *c );
|
title.push_back( *c );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
title = i->second;
|
title = i->second;
|
||||||
|
|
|
@ -348,14 +348,23 @@ string convert( string const & in, DICT_TYPE type, map < string, string > const
|
||||||
title.reserve( i->second.size() );
|
title.reserve( i->second.size() );
|
||||||
|
|
||||||
for( char const * c = i->second.c_str(); *c; ++c )
|
for( char const * c = i->second.c_str(); *c; ++c )
|
||||||
|
{
|
||||||
if ( *c == ' ' || *c == '\t' )
|
if ( *c == ' ' || *c == '\t' )
|
||||||
{
|
{
|
||||||
// u00A0 in utf8
|
// u00A0 in utf8
|
||||||
title.push_back( 0xC2 );
|
title.push_back( 0xC2 );
|
||||||
title.push_back( 0xA0 );
|
title.push_back( 0xA0 );
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
if( *c == '-' ) // Change minus to non-breaking hyphen (uE28091 in utf8)
|
||||||
|
{
|
||||||
|
title.push_back( 0xE2 );
|
||||||
|
title.push_back( 0x80 );
|
||||||
|
title.push_back( 0x91 );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
title.push_back( *c );
|
title.push_back( *c );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
title = i->second;
|
title = i->second;
|
||||||
|
|
Loading…
Reference in a new issue