[vala] GIR writer: Replace escape_attribute_string by Markup.escape_text



commit 4ad71140774c5947091ed3b188132b9b1e630092
Author: Jürg Billeter <j bitron ch>
Date:   Tue May 5 18:36:34 2009 +0200

    GIR writer: Replace escape_attribute_string by Markup.escape_text
---
 gobject/valagirwriter.vala |   12 ++----------
 1 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/gobject/valagirwriter.vala b/gobject/valagirwriter.vala
index 5918d06..2dfc409 100644
--- a/gobject/valagirwriter.vala
+++ b/gobject/valagirwriter.vala
@@ -1,6 +1,6 @@
 /* valagirwriter.vala
  *
- * Copyright (C) 2008  Jürg Billeter
+ * Copyright (C) 2008-2009  Jürg Billeter
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -800,7 +800,7 @@ public class Vala.GIRWriter : CodeVisitor {
 		if (literal is StringLiteral) {
 			var lit = literal as StringLiteral;
 			if (lit != null) {
-				return escape_attribute_string (lit.eval ());
+				return Markup.escape_text (lit.eval ());
 			}
 		} else if (literal is CharacterLiteral) {
 			return "%lc".printf (((CharacterLiteral) literal).get_char ());
@@ -823,14 +823,6 @@ public class Vala.GIRWriter : CodeVisitor {
 		return null;
 	}
 
-	private string escape_attribute_string(string value) {
-		return value.replace ("&", "&amp;")
-			.replace ("<", "&lt;")
-			.replace (">", "&gt;")
-			.replace ("'", "&apos;")
-			.replace ("\"", "&quot;");
-	}
-
 	private string camel_case_to_canonical (string name) {
 		return Symbol.camel_case_to_lower_case (name).replace ("_", "-");
 	}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]