Skip to content

Commit 5a02a31

Browse files
committed
Fixed #984 Don't ask about comment if no comments
1 parent 4806ba9 commit 5a02a31

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

FetchXmlBuilder/DockControls/XmlContentControl.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,11 @@ private void FormatAsMini()
316316
FormatAsXML();
317317
}
318318
var fetchxml = txtXML.Text;
319-
var removecomm = MessageBox.Show("Remove comments?", "Minify XML", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes;
319+
var removecomm = false;
320+
if (fetchxml.Contains("<!--"))
321+
{
322+
removecomm = MessageBox.Show("Remove comments?", "Minify XML", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes;
323+
}
320324
string result = GetFetchMini(fetchxml, fxb.settings.QueryOptions.UseSingleQuotation ? '\'' : '"', removecomm);
321325
txtXML.Text = result;
322326
}

0 commit comments

Comments
 (0)