common/tools/brag/logToBRAG.pl
changeset 580 0a42a7ed6d8d
parent 579 78b42fd9e2c4
child 753 5069de517698
--- a/common/tools/brag/logToBRAG.pl	Mon Oct 05 11:22:09 2009 +0100
+++ b/common/tools/brag/logToBRAG.pl	Mon Oct 05 11:33:00 2009 +0100
@@ -133,7 +133,7 @@
 	$tagName =~ s{^main::}{};
 	if ($tagName eq "Characters")
 	{
-		print $tree->{Text};
+		print escapeForXML($tree->{Text});
 		return;
 	}
 	
@@ -173,3 +173,11 @@
 	print ">";
 }
 
+sub escapeForXML
+{
+	$_ = shift;
+	s{&}{&}g;
+	s{<}{&lt;}g;
+	s{>}{&gt;}g;
+	return $_;
+}