summaryrefslogtreecommitdiffstats
path: root/misc/alevt/files/patch-ab
blob: c23be7e251df2f956c3bd4b5e4e943cea6f02d51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--- exp-html.c.orig	Tue May 30 02:09:15 2000
+++ exp-html.c	Wed Oct 18 08:50:59 2000
@@ -214,7 +214,7 @@
 	      {
 		if (last_space)
 		  {
-		    fprintf(fp," ");
+		    fprintf(fp,"&nbsp");
 		    last_space=0;
 		    nbsp=1;
 		  }
@@ -251,7 +251,7 @@
 		      {
 			if (last_space)
 			  {
-			    fprintf(fp," ");
+			    fprintf(fp,"&nbsp");
 			    last_space=0;
 			    nbsp=1;
 			  }
@@ -268,7 +268,12 @@
 		  {
 		    //if previous nbsp --> put semicolon!!!
 		    if (nbsp) fputc(';',fp);
-		    fputc(pg->data[y][z].ch,fp);
+
+		    // Handle ascii characters which have HTML meanings
+		    if (pg->data[y][z].ch == '<') fprintf(fp,"&lt;");
+		    else if (pg->data[y][z].ch == '>') fprintf(fp,"&gt;");
+		    else if (pg->data[y][z].ch == '&') fprintf(fp,"&amp;");
+		    else fputc(pg->data[y][z].ch,fp);
 		    last_space=0;
 		    nbsp=0;
 		  }
OpenPOWER on IntegriCloud