Commit 86f8742f authored by Sebastian Pipping's avatar Sebastian Pipping

Whitescape handling fixed


git-svn-id: https://svn.xiph.org/websites/validator.xspf.org@13871 0101bb08-14d6-0310-b084-bc0e0c8e3800
parent 21a2b99f
......@@ -32,6 +32,10 @@
# -----------------------------------------------------------------------
# 2007-09-21 -- Sebastian Pipping <webmaster@hartwork.org>
#
# * Fixed: Whitespace handling fixes copied over from libSpiff
#
# 2007-09-21 -- Sebastian Pipping <webmaster@hartwork.org>
#
# * Added: RFC 3986 URI validation
# * Changed: Code re-licensed under LGPLv3 (LGPL-Any before) to be
# able to use 4Suite's Apache-licensed URI validation code
......@@ -1032,19 +1036,41 @@ def handleCharacters(s):
if s.strip() != "":
fail("No character data allowed")
elif stackTop in [TAG_PLAYLIST_INFO, TAG_PLAYLIST_LOCATION, \
TAG_PLAYLIST_IDENTIFIER, TAG_PLAYLIST_IMAGE, TAG_PLAYLIST_DATE, \
TAG_PLAYLIST_LICENSE, TAG_PLAYLIST_LINK, TAG_PLAYLIST_META]:
# Collapse elements
# NOTE: whitespace in the middle of <dateTime>,
# <nonNegativeInteger>, and <anyURI> is illegal anyway
# which is why we we only cut head and tail here
globals()["accum"] += s.strip()
else:
globals()["accum"] += s
elif level == 3:
if (stackTop == TAG_PLAYLIST_TRACKLIST_TRACK):
if stackTop in [TAG_PLAYLIST_ATTRIBUTION_IDENTIFIER, TAG_PLAYLIST_ATTRIBUTION_LOCATION]:
globals()["accum"] += s.strip()
elif (stackTop == TAG_PLAYLIST_TRACKLIST_TRACK):
if s.strip() != "":
fail("No character data allowed")
else:
globals()["accum"] += s
elif level == 4:
globals()["accum"] += s
if stackTop in [TAG_PLAYLIST_TRACKLIST_TRACK_LOCATION, \
TAG_PLAYLIST_TRACKLIST_TRACK_IDENTIFIER, \
TAG_PLAYLIST_TRACKLIST_TRACK_INFO, \
TAG_PLAYLIST_TRACKLIST_TRACK_IMAGE, \
TAG_PLAYLIST_TRACKLIST_TRACK_TRACKNUM, \
TAG_PLAYLIST_TRACKLIST_TRACK_DURATION, \
TAG_PLAYLIST_TRACKLIST_TRACK_LINK, \
TAG_PLAYLIST_TRACKLIST_TRACK_META]:
globals()["accum"] += s.strip()
else:
globals()["accum"] += s
else:
globals()["accum"] += s
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment