25660: don't copy JS comments onto plaintext clipboard. r=sfraser

This commit is contained in:
akkana%netscape.com 2000-03-28 00:33:50 +00:00
parent 2071865ff0
commit 6b70e2a224
2 changed files with 12 additions and 2 deletions

View File

@ -647,7 +647,7 @@ nsHTMLToTXTSinkStream::CloseContainer(const nsIParserNode& aNode)
(type == eHTMLTag_pre) ||
(type == eHTMLTag_blockquote)) {
EnsureVerticalSpace(0);
} else {
} else if (type != eHTMLTag_script) {
// All other blocks get 1 vertical space after them
// in formatted mode, otherwise 0.
// This is hard. Sometimes 0 is a better number, but
@ -755,6 +755,11 @@ nsHTMLToTXTSinkStream::AddLeaf(const nsIParserNode& aNode)
// Might be nice, eventually, to output just the selected element.
return NS_OK;
}
else if (mTagStackIndex > 0 && mTagStack[mTagStackIndex-1] == eHTMLTag_script)
{
// Don't output the contents of <script> tags;
return NS_OK;
}
else if (type == eHTMLTag_text)
{
// Bug 31994 says we shouldn't output the contents of SELECT elements.

View File

@ -647,7 +647,7 @@ nsHTMLToTXTSinkStream::CloseContainer(const nsIParserNode& aNode)
(type == eHTMLTag_pre) ||
(type == eHTMLTag_blockquote)) {
EnsureVerticalSpace(0);
} else {
} else if (type != eHTMLTag_script) {
// All other blocks get 1 vertical space after them
// in formatted mode, otherwise 0.
// This is hard. Sometimes 0 is a better number, but
@ -755,6 +755,11 @@ nsHTMLToTXTSinkStream::AddLeaf(const nsIParserNode& aNode)
// Might be nice, eventually, to output just the selected element.
return NS_OK;
}
else if (mTagStackIndex > 0 && mTagStack[mTagStackIndex-1] == eHTMLTag_script)
{
// Don't output the contents of <script> tags;
return NS_OK;
}
else if (type == eHTMLTag_text)
{
// Bug 31994 says we shouldn't output the contents of SELECT elements.