Code Formatting

  • Hi all,

    As the current syntax highlighter appears to not really be up to the job, we're trying out a new one. For the time being, we've just put it on our beta site. I've set up a thread on that site's forums here:

    http://beta.sqlservercentral.com/Forums/Topic761344-83-1.aspx

    (Red Gate people reading this, you'll need a different link - drop me an email). It's now using the syntax highlighting engine that powers (amongst other things) Google Code. Our initial testing seems to look as if it's faster and more reliable than the one on the live site, but we'd like you guys to give it your best shot and see whether it is good enough!

    Note that we haven't quite got it doing XML highlighting as well as we'd like yet, so you may have to wait for that a bit. Let's see whether T-SQL is handled ok first!

    Mel

    Mel HarbourProject ManagerRed Gate Software

  • Thanks, Mel.

    Give it a try if you can.

  • Seems to work okay, although it does seem to get the coloring (colouring for you Brits) messed up with multiple single quotes.

  • looks like you've already fixed the issue where the multiple single quotes; that was fast.

    I still see the issue in my example where a less-than-symbol was assumed to start an html tag and stripped out a decent sized portion of the code i pasted.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • We've tweaked the Regex regarding the quotes. Seems to look better now.

    All bets are off regarding non-SQL code for the time being, I'm afraid. We're following the 80/20 rule at the moment.

    Oh, and before anyone mentions it, we know that copy and paste into SSMS in IE is broken in it. That's a stylesheet issue that we can fix. We're just avoiding making too many tweaks until we know whether it fundamentally works or not!

    Mel HarbourProject ManagerRed Gate Software

  • Mel Harbour (8/3/2009)


    ...

    All bets are off regarding non-SQL code for the time being, I'm afraid. We're following the 80/20 rule at the moment.

    ...

    In that case, as someone who has already posted a bunch of non-sql code in the forums, I respectfully request that a "plain" formatting option also be provided that just provides a fixed-font, and does not otherwise change the formatting in anyway. And also, that any "code" tags other than {code} or {code="sql"} , just fall back to the "plain" format.

    I foresee a lot of backward-compatibility problems otherwise.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • I'd agree with Barry. My order of fixes is:

    SQL

    XML

    plain code

    VB.NET

    C#

  • Hi Everyone,

    We've updated the highlighter on the beta site. We've now added XML, as well as [ code="other" ] for languages other than SQL or XML, and [ code="plain" ] which just provides a fixed-width font.

    http://beta.sqlservercentral.com/Forums/Topic761344-83-1.aspx

    If you could give it a try, we'd appreciate your feedback!

    Cheers

    Ben

    Ben AddersonWeb TesterRed Gate Software

  • Thanks, Ben.

    I'll let the heavy coders give it a try, but it looks pretty good so far.

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply