Commit 4ad71140 authored by Jürg Billeter's avatar Jürg Billeter

GIR writer: Replace escape_attribute_string by Markup.escape_text

parent 71dd86b3
/* 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 ("&", "&")
.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 ("_", "-");
}
......
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