about summary refs log tree commit diff stats
path: root/WWW/Library/Implementation/SGML.c
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2009-05-30 12:57:46 -0400
committerThomas E. Dickey <dickey@invisible-island.net>2009-05-30 12:57:46 -0400
commit1d1833659f91e213385bb741e424b4a197f54ceb (patch)
tree0cd26ba003e9eee4c251eb674ea88d79750b9596 /WWW/Library/Implementation/SGML.c
parenta321a1e3ce91c7cd6a97cc4a652062ebfa20363f (diff)
downloadlynx-snapshots-1d1833659f91e213385bb741e424b4a197f54ceb.tar.gz
snapshot of project "lynx", label v2-8-7pre_4b
Diffstat (limited to 'WWW/Library/Implementation/SGML.c')
-rw-r--r--WWW/Library/Implementation/SGML.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/WWW/Library/Implementation/SGML.c b/WWW/Library/Implementation/SGML.c
index e89d74b2..35379e2d 100644
--- a/WWW/Library/Implementation/SGML.c
+++ b/WWW/Library/Implementation/SGML.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: SGML.c,v 1.130 2009/05/25 18:17:36 tom Exp $
+ * $LynxId: SGML.c,v 1.131 2009/05/30 11:21:28 tom Exp $
  *
  *			General SGML Parser code		SGML.c
  *			========================
@@ -2359,13 +2359,31 @@ static void SGML_character(HTStream *context, char c_in)
 		testlast >= 0 && !testtag->name[testlast]) {
 #ifdef USE_PRETTYSRC
 		if (psrc_view) {
+		    char *trailing = NULL;
+
+		    if (context->trailing_spaces) {
+			StrAllocCopy(trailing,
+				     string->data
+				     + string->size
+				     - 1
+				     - context->trailing_spaces);
+			trailing[context->trailing_spaces] = '\0';
+		    }
+
 		    PSRCSTART(abracket);
 		    PUTS("</");
 		    PSRCSTOP(abracket);
 		    PSRCSTART(tag);
+
 		    strcpy(string->data, context->current_tag->name);
 		    transform_tag(context, string);
 		    PUTS(string->data);
+
+		    if (trailing) {
+			PUTS(trailing);
+			FREE(trailing);
+		    }
+
 		    PSRCSTOP(tag);
 		    PSRCSTART(abracket);
 		    PUTC('>');