|
See the FAQ[^] for the points system.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
A suggestion...
In QA, a question I was attempting to answer got pretty cluttered. I deleted a couple of my answers as well as a comment I posted. On each of the questions, there were a bunch of comments. Since the questions and comment belonged to me, I can still see them (I assume others cannot). It would be nice if there was a button or setting or something that allows me to hide all the stuff I deleted to I can see the question/answers as others would see it (and also so I don't need to see all that junk).
|
|
|
|
|
We had exactly this feature but removed it because we felt it cluttered the UI.
I wonder if that counts as irony?
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
Chris Maunder wrote: we felt it cluttered the UI
That probably just means you should put it somewhere else in the UI. Perhaps next to each item, on the side panel on the page, or as a global setting (say, in "My Settings").
Chris Maunder wrote: I wonder if that counts as irony?
I would say so.
|
|
|
|
|
A suggestion...
I was just in the C# forum reading a question with a large block of text that used the CODE tag rather than the PRE tag. It would be nice if I could view the source text of that message, grab all the text, then paste it into a new message (and make some mods) and preview it so I can see the code as it should be. Since I can already do most of that, my suggestion is:
Add the ability to view the source text of a message in the forums. Like what we see when we edit one of our messages.
|
|
|
|
|
Basically what you're after is a non-HTML view of the code, right? What about a simple popup that shows the raw Text of the code in the PRE block?
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
Yeah, but not just for the PRE blocks. In the example I was talking about, the guy used a CODE block instead of a PRE block, so what I'm after is the raw text of the entire message (rather than for each PRE block).
|
|
|
|
|
I want to Add "Google" Tag to my CodeProject article, But I don't know why It has not being added to the article's tags when I publish it. All other tags work fine.
My article address is :<a href="http://www.codeproject.com/KB/DLL/GAConnect.aspx">http://www.codeproject.com/KB/DLL/GAConnect.aspx</a>
|
|
|
|
|
I'll get Sean to look into this.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
|
When you add it to the list of your article's tags it creates the tag, but in order to add it to your article you have to go edit the article a second time, and when you go to add "Google" to your list of tags you will see it appear.
We'll look into simplifying this
Thanks,
Sean Ewington
The Code Project
|
|
|
|
|
Take a look at the XSLT at the bottom of this page. When I paste it into a PRE block and set the LANG to XML, it gets cut off early:
<xsl:stylesheet version='1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
xmlns:msxsl='urn:schemas-microsoft-com:xslt'
xmlns:theScript='urn:CustomScript'>
<xsl:output omit-xml-declaration='yes' method='text'
media-type='text/plain' indent='no' />
<xsl:variable name='displayme' />
<msxsl:script implements-prefix='theScript' language='C#'>
<![CDATA[
</msxsl:script>
<xsl:template match='/'>
<xsl:text disable-output-escaping='yes'>Print Integers > 3</xsl:text>
<xsl:apply-templates select='Root/Numbers' />
Script Result: <xsl:value-of select='theScript:HelloName("Joe")' />
Done: <xsl:value-of select='$displayme' />
</xsl:template>
<xsl:template match='Numbers'>
Numbers:<xsl:apply-templates select='Integer[@value > 3]' />
</xsl:template>
<xsl:template match='Integer'>
Integer: <xsl:value-of select='@value' />
</xsl:template>
</xsl:stylesheet>
Now, if I use the same exact PRE block but set the LANG to TEXT, all the code shows up in full:
<xsl:stylesheet version='1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
xmlns:msxsl='urn:schemas-microsoft-com:xslt'
xmlns:theScript='urn:CustomScript'>
<xsl:output omit-xml-declaration='yes' method='text'
media-type='text/plain' indent='no' />
<xsl:variable name='displayme' />
<msxsl:script implements-prefix='theScript' language='C#'>
<![CDATA[
public string HelloName(string name)
{
return "Hello " + name;
}
]]>
</msxsl:script>
<xsl:template match='/'>
<xsl:text disable-output-escaping='yes'>Print Integers > 3</xsl:text>
<xsl:apply-templates select='Root/Numbers' />
Script Result: <xsl:value-of select='theScript:HelloName("Joe")' />
Done: <xsl:value-of select='$displayme' />
</xsl:template>
<xsl:template match='Numbers'>
Numbers:<xsl:apply-templates select='Integer[@value > 3]' />
</xsl:template>
<xsl:template match='Integer'>
Integer: <xsl:value-of select='@value' />
</xsl:template>
</xsl:stylesheet>
I think the XML formatter chokes on the Print Integers > 3 part. Remove that, and the world is happy again. However, that did mean I needed to tweak the example a bit when I was posting an answer here. Seems like the colorizer should not chop off code when it doesn't recognize it... it should just color it incorrectly (though, ideally, it would recognize the code correctly).
|
|
|
|
|
shouldn't you encode some data characters ( < > & ) to create valid XML?
(as you should for any code snippet you want to show in PRE tags)
|
|
|
|
|
The > is encoded, but it isn't double encoded. The .Net XSLT processor will forgive a greater than, but will sometimes choke on a less than. Inside of an xsl:text tag, though, less thans and greater thans may be legal (or maybe not... but the greater thans still work). In any event, the code colorizer shouldn't cut off code, even if the format is incorrect (if the HTML is icorrect, that's another matter entirely... but the HTML is encoded fine).
|
|
|
|
|
aspdotnetdev wrote: The > is encoded, but it isn't double encoded.
Just to clarify, I mean that the character is encoded in the pasted code sample. It is not encoded in the original XSLT sample.
|
|
|
|
|
aspdotnetdev wrote: the code colorizer shouldn't cut off code
that's the part I'm agreeing with most, however it still may be the browser is swallowing stuff due to incorrect HTML.
aspdotnetdev wrote: The > is encoded, but it isn't double encoded
IMO, and to make it very clear (I hope) it should be encoded one more time than your XML tags themselves.
aspdotnetdev wrote: the greater thans still work
yes, most often > seems to work without extra encoding, and < does or does not depending on circumstances (e.g. a forum message accepts them when the next character is a space or a digit). But it is not in accordance with the rules, some browser/HTML parser/XML parser might rightfully choke on them.
|
|
|
|
|
Just to be clear, it is only the XML that MAY be malformed (but will still work fine when put through an XSLT processor). The HTML is encoded as it should be. Every < is replaced by < and the same goes for the other characters. I selected "Encoded < When Pasting", so that should be perfectly fine. To demonstrate this, here is the XML code block from my above post, encoded further and wrapped in a PRE block with the LANG set to HTML:
<pre lang="xml"><xsl:stylesheet version='1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
xmlns:msxsl='urn:schemas-microsoft-com:xslt'
xmlns:theScript='urn:CustomScript'>
<xsl:output omit-xml-declaration='yes' method='text'
media-type='text/plain' indent='no' />
<xsl:variable name='displayme' />
<msxsl:script implements-prefix='theScript' language='C#'>
<![CDATA[
public string HelloName(string name)
{
return "Hello " + name;
}
]]>
</msxsl:script>
<xsl:template match='/'>
<xsl:text disable-output-escaping='yes'>Print Integers > 3</xsl:text>
<xsl:apply-templates select='Root/Numbers' />
Script Result: <xsl:value-of select='theScript:HelloName("Joe")' />
Done: <xsl:value-of select='$displayme' />
</xsl:template>
<xsl:template match='Numbers'>
Numbers:<xsl:apply-templates select='Integer[@value > 3]' />
</xsl:template>
<xsl:template match='Integer'>
Integer: <xsl:value-of select='@value' />
</xsl:template>
</xsl:stylesheet></pre>
The HTML is definitely not the issue. It's the colorizers interpretation of the XML that is the problem.
|
|
|
|
|
Sorry but I don't like the > which sits
here
|
V
<xsl:text disable-output-escaping='yes'>Print Integers > 3</xsl:text>
I'm not familiar with XSL, bowever I'm pretty convinced it should be escaped.
FWIW: Yes, it is unfortunate things may go wrong when escaping isn't applied correctly, and yes it would be nice if the forum and the browser would be as tolerant as the system that is intended to process your code.
FWIW2: jeez, these forums are much harder without proper mail notifications.
|
|
|
|
|
Luc Pattyn wrote: jeez, these forums are much harder without proper mail notifications.
Sucker! Notifications have been working fine for me. Maybe Jim just doesn't like you.
|
|
|
|
|
You must be living in an alternate reality...
|
|
|
|
|
I agree with Luc.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
You agree that "it would be nice if the forum and the browser would be as tolerant as the system that is intended to process your code"?
|
|
|
|
|
I agree that "I'm pretty convinced it should be escaped"
Even so, it's easy enough to add some code that will take <[non-alphanumeric] and convert it to <[non-alphanumeric]
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
I think what you mean is change this:
<xsl:text>xyz > abc</xsl:text>
Into this:
<xsl:text>xyz > abc</xsl:text>
That might change the meaning of the code (that's basically what I had to do though, unfortunately)... I'm not sure, but I think XSLT interprets anything inside of an XSL:TEXT block as a string literal (so a greater than would be output as a greater than and an ampersand would be output as an ampersand... not sure though). Also, I don't see how a character being alphanumeric or not is relevant.
I can't see any way to get the above to display with XML as the LANG:
<xsl:text>xyz > abc</xsl:text>
Are you saying I should modify the code content so the colorizer doesn't cut off the code? Probably a suitable workaround for most every scenario, but still seems like a bug, and one that takes time to figure out how to fix.
|
|
|
|
|
Luc Pattyn wrote: jeez, these forums are much harder without proper mail notifications
How are they now?
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|