diff options
| author | bulia byak <buliabyak@gmail.com> | 2007-02-10 20:39:52 +0000 |
|---|---|---|
| committer | buliabyak <buliabyak@users.sourceforge.net> | 2007-02-10 20:39:52 +0000 |
| commit | 570920bffe713ff3e953379eac46da914fe6587d (patch) | |
| tree | 023525f3211c00ec20788245716216a6d5fdc290 /src | |
| parent | Remove ca.new form ALL_LINGUAS. (diff) | |
| download | inkscape-570920bffe713ff3e953379eac46da914fe6587d.tar.gz inkscape-570920bffe713ff3e953379eac46da914fe6587d.zip | |
more correct whitespace handling per http://www.w3.org/TR/SVG11/text.html#WhiteSpace, fixes what remains of bug 1614678. Note that our parser does not seem to fully comply - it does not convert 0xd into 0xa, so here we must handle both.
(bzr r2351)
Diffstat (limited to 'src')
| -rw-r--r-- | src/sp-string.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sp-string.cpp b/src/sp-string.cpp index ddea5abc7..871338ad5 100644 --- a/src/sp-string.cpp +++ b/src/sp-string.cpp @@ -121,7 +121,7 @@ sp_string_read_content(SPObject *object) if (object->xml_space.value == SP_XML_SPACE_PRESERVE) { for ( ; *xml_string ; xml_string = g_utf8_next_char(xml_string) ) { gunichar c = g_utf8_get_char(xml_string); - if (c == '\n' || c == '\t') c = ' '; + if (c == 0xa || c == 0xd || c == '\t') c = ' '; string->string += c; } } @@ -129,7 +129,7 @@ sp_string_read_content(SPObject *object) bool whitespace = false; for ( ; *xml_string ; xml_string = g_utf8_next_char(xml_string) ) { gunichar c = g_utf8_get_char(xml_string); - if (c == '\n') continue; + if (c == 0xa || c == 0xd) continue; if (c == ' ' || c == '\t') whitespace = true; else { if (whitespace && (!string->string.empty() || SP_OBJECT_PREV(object) != NULL)) |
