DSL: properly handle [m] tag

In short, [m] = [m0].
This commit is contained in:
Tvangeste 2013-07-03 15:59:32 +02:00
parent 80b462b0fa
commit f0a122e740
3 changed files with 11 additions and 2 deletions

View file

@ -348,6 +348,11 @@ div.xdxf
color: green;
}
.dsl_m, .dsl_m0
{
padding-left: 0px;
}
.dsl_m1
{
padding-left: 9px;

3
dsl.cc
View file

@ -739,6 +739,9 @@ string DslDictionary::nodeToHtml( ArticleDom::Node const & node )
result += "<div class=\"dsl_opt\" id=\"" + id + "\">" + processNodeChildren( node ) + "</div>";
}
else
if ( node.tagName == GD_NATIVE_TO_WS( L"m" ) )
result += "<div class=\"dsl_m\">" + processNodeChildren( node ) + "</span>";
else
if ( node.tagName.size() == 2 && node.tagName[ 0 ] == L'm' &&
iswdigit( node.tagName[ 1 ] ) )
result += "<div class=\"dsl_" + Utf8::encode( node.tagName ) + "\">" + processNodeChildren( node ) + "</div>";

View file

@ -224,9 +224,10 @@ ArticleDom::ArticleDom( wstring const & str ):
if ( !isClosing )
{
if ( name.size() == 2 && name[ 0 ] == L'm' && iswdigit( name[ 1 ] ) )
if ( name == GD_NATIVE_TO_WS( L"m" ) ||
( name.size() == 2 && name[ 0 ] == L'm' && iswdigit( name[ 1 ] ) ) )
{
// Opening an 'mX' tag closes any previous 'm' tag
// Opening an 'mX' or 'm' tag closes any previous 'm' tag
closeTag( GD_NATIVE_TO_WS( L"m" ), stack, false );
}