mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Don't write internal quotes during normal use (fixes #30)
This commit is contained in:
@@ -137,6 +137,10 @@ namespace SabreTools.Library.IO
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
// If we're writing quotes, don't write out quote characters internally
|
||||||
|
if (Quotes)
|
||||||
|
name = name.Replace("\"", "''");
|
||||||
|
|
||||||
AutoComplete(Token.StartElement);
|
AutoComplete(Token.StartElement);
|
||||||
PushStack();
|
PushStack();
|
||||||
stack[top].Name = name;
|
stack[top].Name = name;
|
||||||
@@ -200,6 +204,10 @@ namespace SabreTools.Library.IO
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
// If we're writing quotes, don't write out quote characters internally
|
||||||
|
if (Quotes)
|
||||||
|
name = name.Replace("\"", "''");
|
||||||
|
|
||||||
AutoComplete(Token.StartAttribute);
|
AutoComplete(Token.StartAttribute);
|
||||||
sw.Write(name);
|
sw.Write(name);
|
||||||
sw.Write(" ");
|
sw.Write(" ");
|
||||||
@@ -266,6 +274,14 @@ namespace SabreTools.Library.IO
|
|||||||
if (string.IsNullOrEmpty(name))
|
if (string.IsNullOrEmpty(name))
|
||||||
throw new ArgumentException();
|
throw new ArgumentException();
|
||||||
|
|
||||||
|
// If we're writing quotes, don't write out quote characters internally
|
||||||
|
if ((quoteOverride == null && Quotes)
|
||||||
|
|| (quoteOverride == true))
|
||||||
|
{
|
||||||
|
name = name.Replace("\"", "''");
|
||||||
|
value = value.Replace("\"", "''");
|
||||||
|
}
|
||||||
|
|
||||||
AutoComplete(Token.Standalone);
|
AutoComplete(Token.Standalone);
|
||||||
sw.Write(name);
|
sw.Write(name);
|
||||||
sw.Write(" ");
|
sw.Write(" ");
|
||||||
@@ -315,6 +331,11 @@ namespace SabreTools.Library.IO
|
|||||||
if (!string.IsNullOrEmpty(value))
|
if (!string.IsNullOrEmpty(value))
|
||||||
{
|
{
|
||||||
AutoComplete(Token.Content);
|
AutoComplete(Token.Content);
|
||||||
|
|
||||||
|
// If we're writing quotes, don't write out quote characters internally
|
||||||
|
if (Quotes)
|
||||||
|
value = value.Replace("\"", "''");
|
||||||
|
|
||||||
sw.Write(value);
|
sw.Write(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user