From b7769c6df1f2f272348ece389e8ef6ca6c05931f Mon Sep 17 00:00:00 2001 From: Abs62 Date: Tue, 14 Apr 2015 18:01:16 +0300 Subject: [PATCH] DSL: Fix escaped symbols handling in <<...>> tag --- dsl_details.cc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/dsl_details.cc b/dsl_details.cc index 1d3d4c22..1789c612 100644 --- a/dsl_details.cc +++ b/dsl_details.cc @@ -274,7 +274,7 @@ ArticleDom::ArticleDom( wstring const & str, string const & dictName, nextChar(); } while( Folding::isWhitespace( ch ) ); - wstring linkTo; + wstring linkTo, linkText; for( ; ; nextChar() ) { @@ -289,10 +289,21 @@ ArticleDom::ArticleDom( wstring const & str, string const & dictName, { linkTo.push_back( L'>' ); linkTo.push_back( ch ); + + linkText.push_back( L'>' ); + if( escaped ) + linkText.push_back( L'\\' ); + linkText.push_back( ch ); } } else + { linkTo.push_back( ch ); + + if( escaped ) + linkText.push_back( L'\\' ); + linkText.push_back( ch ); + } } // Add the corresponding node @@ -304,7 +315,7 @@ ArticleDom::ArticleDom( wstring const & str, string const & dictName, textNode = 0; } - wstring linkText = Folding::trimWhitespace( linkTo ); + linkText = Folding::trimWhitespace( linkText ); processUnsortedParts( linkText, true ); ArticleDom nodeDom( linkText, dictName, headword_ );