|
Luc Pattyn wrote: underline shows its tags
I see you beat me to this.
|
|
|
|
|
Yeah, I've been called Greased Lightning earlier today.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Luc Pattyn wrote: 1. title length checks, just silly.
Allowing single word or pointlessly short questions: automatically avoidable. You've put me on notice enough times saying I should do more automated checks and balances of input and I think this falls squarely into that realm. I am, however, open to adjusting the limits, but I stand by the opinion that yes, it's simple to craft a very small title or question, but that it is just as easy and usually more valuable to be more descriptive.
In your "Using PRE tags" tip the title suggests to me a tip about using PRE tags in HTML. It's actually a tip about using PRE tags in CodeProject content so I would call it "Using PRE tags in questions and articles". It would certainly satisfy those who continually push for the wording on the site to be more accurate and descriptive.
Luc Pattyn wrote: vertical spacing seems arbitrary; how can I get the first paragraph closer to its title, and consistently so?
The first paragraph is separated from the title by the abstract line and then the list of attrbiutes. You've added what looks like most of the main attributes to your "Using PRE Tags" tip which means when you shrink/expand your browser that line of attributes may wrap and drop the first paragraph down even more.
How about trimming the list of attributes to something reasonable? Or even just having the tags "CodeProject" and "Formatting" for example.
Luc Pattyn wrote: HTML tags inside PRE: bold "works" and is hardly noticeable, italics does nothing, underline shows its tags. This has been better before.
Bold hasn't changed in years and italics are certainly working for me (and again, haven't changed). It's the nature of the courier font that we've used since day one. I can't remember a time we supported underline. We have always reserved the underline decoration for hyperlinks.
[Edit: I've added in support for underlines. I can see bold really well on all my monitors, but if you're having problems maybe so are others so this will give you another option]
Luc Pattyn wrote: without lang="text" even the HTML-escape snippet would show odd coloring for no apparent reason.
You mean the block starting with <pre lang='cs'...?
Think what you're asking the colouriser to do: Do you want it to colourise the C# code, or the HTML tags? It can't do both because there's no syntax in practice that would ask for this. My best suggestion is to set the lang='html' and do something like
<pre lang='cs'> <!--
private static int multiply(int arg1, int arg2) {
return arg1*arg2;
}
</pre> <!--
Although I am guessing this isn't what you're after. Alternatively I could add the option to use a <span class='no-colour'>...</span> to give you the ability to uncolour parts of the PRE text.
[Edit: adding "no-color" and "no-colour" now.]
Luc Pattyn wrote: forums show some icon next to the author, Q&A lists total rep points, however articles and TT don't do any such thing, just a plain author name. why?
That's just the way the lists of those items evolved independently. I do have a task in the list to make these consistent.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
1.
yes I will lengthen that title next time, not for the reasons you envision though. If "CP Vanity" had to change it would loose part of its appeal IMO. The silly things are (1) your checks are inconsistent (new stuff versus edited stuff) and (2) your checks can be fooled as I have proven again today. Anyway I feel confined by whatever minimum length you impose.
2.
I have complained about vertical layout aspects over the years, just take a look at any article, TT, whatever and look for the rhythm of the white space, it ain't right. What I am referring to today is the amount of white space between every title (mostly h2 tags in this instance) and the first paragraph that follows as well as the last paragraph that precedes it. It should be something like 2.5 (before) and 1.5 (after) times the normal line distance, so the new header goes with the text that follows, not the text that precedes it, without wasting too much. As it is it is more the opposite, and not constant. I also have the impression preview and final view are different here.
Side note: I just discovered different heading levels in articles create different colors now (orange and blue); and TT header colors (blackish) differ from article colors. It is all getting pretty ugly.
3.
Look at my TT on PRE tags, where I explain italics and underline, italics doesn't work, and underline shows its tags. Tried FF 3.6.15, IE7 and Chrome 10. Do you see anything italicized or underlined where I explain them? My examples are failing.
4.
The snippet explaining how to escape <>& now has lang="text"; if you remove that it becomes a mixture of black, red and blue without any logic I can imagine. Like so:
< <
> >
& &
I wish the default had been lang="text" everywhere unless the context indicates otherwise (as in C# forum, or reliably sniffed). I know you can't just change the default, unless you also change all existing database content! Maybe a new command that allows to set the default would be nice, <prelang="xyz"> which would set lang="xyz" for all PRE blocks that follow. Then I could fix all PRE blocks in one step.
BTW: You will have noticed I am limiting the number (and length) of my posts in S&B as I'm not impressed by their effectiveness; CP is running in circles too much to my liking.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Luc Pattyn wrote: If "CP Vanity" had to change it would loose part of its appeal IMO
"CP Vanity" is an article which I'm happy to treat differently. A question should be asked in a way that makes it clear what is being asked in order to allow those scanning the questions to know which they can answer. Articles are not required to encapsulate full meaning in their title (though I think you're mad not to).
Luc Pattyn wrote: What I am referring to today is the amount of white space between every title (mostly h2 tags in this instance) and the first paragraph that follows as well as the last paragraph that precedes it.
We set the line height to be 1.2em but make no other changes to the default spacing between paragraphs that browsers choose to implement. I may be getting forgetful but I can't recall you voicing a complaint on this before. Happy to tweak.
Luc Pattyn wrote: My examples are failing.
Your italic example is working perfectly on my browser (Chrome, IE, FF). My edit to my previous answer said I had implemented underline and next release (hopefully tomorrow) will add that to the list of supported tags.
Luc Pattyn wrote: <prelang="xyz"> which would set lang="xyz" for all PRE blocks that follow
You've missed the point: the default setting is for those who don't know anything about the lang tag. Your solution is interesting, though I would prefer something like a <meta tag, or possibly offer the ability to wrap the entire article in a DIV and set the defaultlang=... on that
Luc Pattyn wrote: CP is running in circles too much to my liking
Anything specific that I'm doing or not doing you're unhappy with? We've been extremely short on resources for the past few months due to us trying to get some core projects done instead of nipping at the edges of current systems. "Running in circles" usually means a lot of movement but zero net forward motion. If so, what's your personal #1?
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
When upvoting answers in the forums, you get the message "You voted 5. Rating now 5 (votes: 3). Message marked as answered."
What exactly does the last part mean? Well, I understand what it *means*, but what happens? The thread/message doesn't seem to get changed in any way (for example, adding a check mark next to the subject line to show it has been answered), so I'm just wondering what the point of the message is.
Just out of curiosity.
|
|
|
|
|
It's not marked as answered - it's green because it's been voted a good answer by enough people.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
Are we talking about the same thing here?
I'm talking about the answers in the "regular" forums, not Q&A, and they don't seem to change color or anything, that's why I was wondering what actually happened.
|
|
|
|
|
Ah. Right
The forum "mark as answer" system is going to be removed. It was being used to provide lists of unanswered questions but wasn't being used consistently. It still marks questions as answered (and gives them a vote of 5) but is not being used as it was first designed.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
As the subject says : WYSIWIG article editor "refactors" code in <pre> blocks - When that code contains Generics (.NET)
"Just change to HTML view then".
Too late... As the WYSIWIG is the default, and the code will already be altered.
I recently posted an article ASP.NET OO SessionWrapper - As an integral part of the objects them self.[^] which contains 3 such codeblocks (containing Generics)
On each edit I have to redo those codeblocks.
I even added a "note to editors" text warning about this - Not sure if that warning is actually displayed to editors at all.. As one other editor did some edits, and screwed up the code...
The other codeblocks are fine - Hence why I'm thinking it's related to the Generics syntax somehow.
|
|
|
|
|
Are you properly HTML-escaping the relevant characters, not just < but also > and & ?
You really must use < and > and &
Your article currently is containing weird things such as
<</span>T> where T :
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
I need to escape inside <pre> tags?
---
The example you listed is deffo weird - where did you find that one
---
EDIT
lol - in the first post I could write <pre> without escaping it - But not in my reply - Hence this edit
---
Double EDIT (ftw)
Think I found what you are referring to - You missed the starting span tag
<span class="code-keyword">></span> where T :
That's perfectly legal - and not of my doing either. It's autogenerated by the site...
modified on Monday, March 14, 2011 11:35 AM
|
|
|
|
|
mgkr wrote: I need to escape inside <pre> tags?
definitely yes.
mgkr wrote: You missed the starting span tag
I saw what I saw and reported.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
mgkr wrote: you listed is deffo weird
Please do not use textspeak. It's the fastest way I know of to lose everyone's attention.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
Hehe - I agree actually.
I hate the practice myself.
While the result is the same, in my case it's actually not a question of being perverted by "textspeaking", as I rarely ever send a text (10-20 a year perhaps), but more an old habit from not quite knowing how to spell a few words (english not being my native language).
As I said, I hate the practice myself, so I really try to catch my self - But once in a while you can catch me in slipping one of the following in.
ofc - Of course
ppl - People (no idea how that one got added to my bad habit list...)
def/deffo - Definitely (And I'm sad to say it's not more than maybe 3-4 years ago I learned it's not spelled "definatly"...)
Theres probably a couple more, but that's what I can think of at the top of my head.
So yeah - I know. And I try
|
|
|
|
|
I took a crack at it, is that better?
Thanks,
Sean Ewington
The Code Project
|
|
|
|
|
Holy cow - That was some quick bug fixing.
Hats of to you Sir!
--
I haven't dared actually submitting - But the pre blocks seems to be escaped correctly now - rather than refactored/mangled
|
|
|
|
|
Luc kindly and accurately described the problem, < > and & must be changed to < > and &
All I did was change the ">"s
Thanks,
Sean Ewington
The Code Project
|
|
|
|
|
Aaah - You changed the actual text, not the WYSIWIG editor code - Gotcha
(I was wondering how the hell you managed to fix code so quick)
Thanks a bunch!
---
It remains that the WYSIWIG editor is buggy though (as an FYI)
In all the pre blocks I've done, I've not escaped anything by hand at all, I've simply copy/pasted from my code files (this done in HTML view ofc).
The editor has then made the syntax highlighting and (partial ) escaping on the code.
But workaround noted should I run into this again.
---
Thanks all for the super speedy responses - That's truly amazing.
|
|
|
|
|
Alternatively, if you're pasting in, check the 'Encode "<" (and other HTML) characters when pasting' in the Options below the message.
|
|
|
|
|
Thanks for the tip!
Hadn't really noticed that toggle.
It's on by default - which explains why I was struggling (not understanding) what was going on when sometimes pasting bits and pieces.
Seeing as the top of the editor window here has 3 distinct buttons for <,> and & respectively - Wouldn't it be nice with one for "encode selected text" as well
I mean, if I'm writing stuff, say about html formatting, I'd end up using a lot of <'s and >'s, and having to move to the mouse to click those buttons for each (or writing the escape code by hand) is a tad cumbersome.
Just writing normally, and then when done mark up the text, and click that button would be sweet.
Not a huge priority I agree - Just a "nice to have".
- workaround is of course to just type your text normally, and then ctrl+a/ctrl+x/ctrl+c (with the encode option checked) - Which I just did
|
|
|
|
|
I have updated my tip/trick on PRE tags, link is in my sig.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Hey guys,
I was just going through some of my answers in the Q&A and noticed that this one had been marked as the correct answer and then unmarked. There is nothing wrong with the points allocation, but I find it curious that (at least for me) the answer still has the "accepted" green background? Is this behavior what was intended? If not, my QA's would be proud of me for finding a bug instead of just creating them.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
The Beginners Hardware and Device Programming Competition was supposed to end on February 28th but I haven't heard anything about it. I noticed that the hardware zone seems to have been completely removed from the site as well and the only way I can even see that the competition existed is by using the link I saved from when I first saw it. Was the competition cancelled?
|
|
|
|
|
K-Sid?
I thought you had been upgraded to L-Sid[^]
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|