Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. Site Bugs / Suggestions
  4. Pasting bug

Pasting bug

Scheduled Pinned Locked Moved Site Bugs / Suggestions
htmljsonhelp
13 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    fly904
    wrote on last edited by
    #1

    When pasting HTML into pre tags with the "Encode HTML tags when pasting" option selected, if the first character pasted is a < it is not autmoatically encoded like the rest are.

    If at first you don't succeed, you're not Chuck Norris.

    C 1 Reply Last reply
    0
    • F fly904

      When pasting HTML into pre tags with the "Encode HTML tags when pasting" option selected, if the first character pasted is a < it is not autmoatically encoded like the rest are.

      If at first you don't succeed, you're not Chuck Norris.

      C Offline
      C Offline
      Chris Maunder
      wrote on last edited by
      #2

      <It is for me> (IE8, FireFox, and Chrome) Which browser are you using?

      cheers, Chris Maunder The Code Project Co-founder Microsoft C++ MVP

      F L 2 Replies Last reply
      0
      • C Chris Maunder

        <It is for me> (IE8, FireFox, and Chrome) Which browser are you using?

        cheers, Chris Maunder The Code Project Co-founder Microsoft C++ MVP

        F Offline
        F Offline
        fly904
        wrote on last edited by
        #3

        Firefox. But you didn't paste into pre tags

        If at first you don't succeed, you're not Chuck Norris.

        1 Reply Last reply
        0
        • C Chris Maunder

          <It is for me> (IE8, FireFox, and Chrome) Which browser are you using?

          cheers, Chris Maunder The Code Project Co-founder Microsoft C++ MVP

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          Hi Chris, any progress in the automatic code recognition you ordered and I provided here[^]? I haven't heared from you on this subject since this[^] rather off-topic message. :confused:

          Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


          Happy New Year to all.
          We hope 2010 soon brings us automatic PRE tags!
          Until then, please insert them manually.


          C 1 Reply Last reply
          0
          • L Luc Pattyn

            Hi Chris, any progress in the automatic code recognition you ordered and I provided here[^]? I haven't heared from you on this subject since this[^] rather off-topic message. :confused:

            Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


            Happy New Year to all.
            We hope 2010 soon brings us automatic PRE tags!
            Until then, please insert them manually.


            C Offline
            C Offline
            Chris Maunder
            wrote on last edited by
            #5

            Nice hijack. I was actually halfway through a reply to your previous message but illness and now travel have thrown me completely off schedule. I'm trying to work through a bunch of emails today. Quick Answer: your excellent code is server, not client side, so will require an Ajax call if we're going to use it to automatically wrap pasted code in PRE tags. There is an alternative: We could use a Markdown-type-thing whereby any text that is indented 4 spaces is considered code and gets wrapped in PRE tags on the server side. This would mean never even needing to see a PRE tag because they would be added behind the scenes, and your language sniffer could then add the lang= part. I was also thinking we should just ditch PRE tags in favour of CODE tags. Much more intuitive. (Sorry for the scattered reply - juggling lots in the brain today)

            cheers, Chris Maunder The Code Project Co-founder Microsoft C++ MVP

            L 1 Reply Last reply
            0
            • C Chris Maunder

              Nice hijack. I was actually halfway through a reply to your previous message but illness and now travel have thrown me completely off schedule. I'm trying to work through a bunch of emails today. Quick Answer: your excellent code is server, not client side, so will require an Ajax call if we're going to use it to automatically wrap pasted code in PRE tags. There is an alternative: We could use a Markdown-type-thing whereby any text that is indented 4 spaces is considered code and gets wrapped in PRE tags on the server side. This would mean never even needing to see a PRE tag because they would be added behind the scenes, and your language sniffer could then add the lang= part. I was also thinking we should just ditch PRE tags in favour of CODE tags. Much more intuitive. (Sorry for the scattered reply - juggling lots in the brain today)

              cheers, Chris Maunder The Code Project Co-founder Microsoft C++ MVP

              L Offline
              L Offline
              Luc Pattyn
              wrote on last edited by
              #6

              1. No sir. If you were to play with the test bench for a couple of minutes, you would be sold to the idea and accept a little server action to support it. Have you ever tried to copy a few dozen lines of code from Visual Studio to the CP editor? it goes wrong easily and in many ways: HTML encoding check box forgotten, language not specified, too many tabs, ... Try again in the test bench, it is all automatic. I copied all kinds of text snippets and code snippets, without worrying a bit, and it all came out the way I intended. So that is what we should have in all CP editors, if you ask me, and the people who voted for my article. BTW: are the "hyperlink become two links and possibly an article title" tricks not server side? and you did ask for a C# solution! 2. The markdown idea does not solve the main problems; it may be a nice additional feature, but it does not touch the heart of the matter: a lot of people just pasting without worrying about anything, AND to be operational it requires people to learn yet another language or behavior, and pay attention. So IMO markdown is NOT an alternative, it is another feature, not really a solution. 3.

              Chris Maunder wrote:

              ditch PRE tags in favour of CODE tags

              with my stuff, the user does not enter PRE tags, he gets them for free. And at the moment, at least in forums, PRE tags change the background color and offer useful syntax coloring with improved readability, whereas CODE tags don't change the background color making syntax coloring horribly unreadable lacking contrast (that is why I have been asking all the time to select lang='text' by default for CODE tags and not for PRE tags). I wish you'd only spend a few minutes with the test bench... :)

              Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


              Happy New Year to all.
              We hope 2010 soon brings us automatic PRE tags!
              Until then, please insert them manually.


              C 1 Reply Last reply
              0
              • L Luc Pattyn

                1. No sir. If you were to play with the test bench for a couple of minutes, you would be sold to the idea and accept a little server action to support it. Have you ever tried to copy a few dozen lines of code from Visual Studio to the CP editor? it goes wrong easily and in many ways: HTML encoding check box forgotten, language not specified, too many tabs, ... Try again in the test bench, it is all automatic. I copied all kinds of text snippets and code snippets, without worrying a bit, and it all came out the way I intended. So that is what we should have in all CP editors, if you ask me, and the people who voted for my article. BTW: are the "hyperlink become two links and possibly an article title" tricks not server side? and you did ask for a C# solution! 2. The markdown idea does not solve the main problems; it may be a nice additional feature, but it does not touch the heart of the matter: a lot of people just pasting without worrying about anything, AND to be operational it requires people to learn yet another language or behavior, and pay attention. So IMO markdown is NOT an alternative, it is another feature, not really a solution. 3.

                Chris Maunder wrote:

                ditch PRE tags in favour of CODE tags

                with my stuff, the user does not enter PRE tags, he gets them for free. And at the moment, at least in forums, PRE tags change the background color and offer useful syntax coloring with improved readability, whereas CODE tags don't change the background color making syntax coloring horribly unreadable lacking contrast (that is why I have been asking all the time to select lang='text' by default for CODE tags and not for PRE tags). I wish you'd only spend a few minutes with the test bench... :)

                Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


                Happy New Year to all.
                We hope 2010 soon brings us automatic PRE tags!
                Until then, please insert them manually.


                C Offline
                C Offline
                Chris Maunder
                wrote on last edited by
                #7

                Luc Pattyn wrote:

                you would be sold to the idea and accept a little server action to support it

                :D It's not me who needs to be sold. It's the poor sops with slow connections that may get cranky. I've used the test rig and it's very nice.

                Luc Pattyn wrote:

                And at the moment, at least in forums, PRE tags change the background color and offer useful syntax coloring

                What I was suggesting (though not clearly) was making the CODE tag behave as the PRE tag does currently. There would still be nice formatting and colourisation. It would just mean that members would wrap code in CODE tags (when they need to, of course ;))

                cheers, Chris Maunder The Code Project Co-founder Microsoft C++ MVP

                L 1 Reply Last reply
                0
                • C Chris Maunder

                  Luc Pattyn wrote:

                  you would be sold to the idea and accept a little server action to support it

                  :D It's not me who needs to be sold. It's the poor sops with slow connections that may get cranky. I've used the test rig and it's very nice.

                  Luc Pattyn wrote:

                  And at the moment, at least in forums, PRE tags change the background color and offer useful syntax coloring

                  What I was suggesting (though not clearly) was making the CODE tag behave as the PRE tag does currently. There would still be nice formatting and colourisation. It would just mean that members would wrap code in CODE tags (when they need to, of course ;))

                  cheers, Chris Maunder The Code Project Co-founder Microsoft C++ MVP

                  L Offline
                  L Offline
                  Luc Pattyn
                  wrote on last edited by
                  #8

                  Well, if CODE starts doing what PRE does, and not the other way around, then I don't really care. But then, how does one deal with a less-than-a-line snippet like this one, which also comes handy? For the slow connections, why not do something special; I mean if you keep concentrating on narrow screens and slow connections, a lot of people (software developers that have been willing to pay for powerful hardware) don't get what they could get; why not focus on the average user having a wide monitor and a high-speed connection, and then provide one or two switches to make the site less demanding when hardware dictates. So you could assume a screen width >= 1280 unless "keep below 1024" is checked in personal settings; and you could avoid postbacks/AJAX when "slow connection" is checked. Then slow connection would imply no automatic pasting, back to what it is now; and narrow screen could e.g. cause a smaller rep graph (actually all large images being reduced by a fixed factor, say 2/3, something very predictable). I'm in favor of automating things than can be automated (and providing an override if that could be useful, e.g. when automation could go wrong); but I also prefer getting more out of a non-minimal set-up rvrn if that means fiddling with some switches. If they are easy to understand, that should not cause too much trouble overall. IMO it is similar to the bunch of Windows Display settings such as "suppress window move animation", "disable form shadows", etc: the features are on by default, people having performance issues will soon figure it out and disable some. Well, that's my 2 eurocents anyway. :)

                  Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


                  Happy New Year to all.
                  We hope 2010 soon brings us automatic PRE tags!
                  Until then, please insert them manually.


                  R D 2 Replies Last reply
                  0
                  • L Luc Pattyn

                    Well, if CODE starts doing what PRE does, and not the other way around, then I don't really care. But then, how does one deal with a less-than-a-line snippet like this one, which also comes handy? For the slow connections, why not do something special; I mean if you keep concentrating on narrow screens and slow connections, a lot of people (software developers that have been willing to pay for powerful hardware) don't get what they could get; why not focus on the average user having a wide monitor and a high-speed connection, and then provide one or two switches to make the site less demanding when hardware dictates. So you could assume a screen width >= 1280 unless "keep below 1024" is checked in personal settings; and you could avoid postbacks/AJAX when "slow connection" is checked. Then slow connection would imply no automatic pasting, back to what it is now; and narrow screen could e.g. cause a smaller rep graph (actually all large images being reduced by a fixed factor, say 2/3, something very predictable). I'm in favor of automating things than can be automated (and providing an override if that could be useful, e.g. when automation could go wrong); but I also prefer getting more out of a non-minimal set-up rvrn if that means fiddling with some switches. If they are easy to understand, that should not cause too much trouble overall. IMO it is similar to the bunch of Windows Display settings such as "suppress window move animation", "disable form shadows", etc: the features are on by default, people having performance issues will soon figure it out and disable some. Well, that's my 2 eurocents anyway. :)

                    Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


                    Happy New Year to all.
                    We hope 2010 soon brings us automatic PRE tags!
                    Until then, please insert them manually.


                    R Offline
                    R Offline
                    ragnaroknrol
                    wrote on last edited by
                    #9

                    I find your points intriguing and wish to suscribe to your newsletter. If you weren't an MVP already this suggestion should make you one. It is an excellent idea to allow the user's personal settings to customize the site in order to deal with anything they may need as a special case and make the site better for everyone in general. Heck, when someone makes their account for the first time it could simply ask them a few questions and adjust settings according to their answers. What resolution does the monitor you view CP on use? (radio buttons with 3 common settings and "other") What sort of connection do you use? (again, radio buttons with common types)

                    L A 2 Replies Last reply
                    0
                    • R ragnaroknrol

                      I find your points intriguing and wish to suscribe to your newsletter. If you weren't an MVP already this suggestion should make you one. It is an excellent idea to allow the user's personal settings to customize the site in order to deal with anything they may need as a special case and make the site better for everyone in general. Heck, when someone makes their account for the first time it could simply ask them a few questions and adjust settings according to their answers. What resolution does the monitor you view CP on use? (radio buttons with 3 common settings and "other") What sort of connection do you use? (again, radio buttons with common types)

                      L Offline
                      L Offline
                      Luc Pattyn
                      wrote on last edited by
                      #10

                      Thanks. I would carry that a little further, and maybe provide "configurations", so I have one setting at home on a large machine and DSL, and maybe another on the road, with a netbook that, depending on where I am, has low to medium Internet bandwidth. :)

                      Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


                      Happy New Year to all.
                      We hope 2010 soon brings us automatic PRE tags!
                      Until then, please insert them manually.


                      1 Reply Last reply
                      0
                      • L Luc Pattyn

                        Well, if CODE starts doing what PRE does, and not the other way around, then I don't really care. But then, how does one deal with a less-than-a-line snippet like this one, which also comes handy? For the slow connections, why not do something special; I mean if you keep concentrating on narrow screens and slow connections, a lot of people (software developers that have been willing to pay for powerful hardware) don't get what they could get; why not focus on the average user having a wide monitor and a high-speed connection, and then provide one or two switches to make the site less demanding when hardware dictates. So you could assume a screen width >= 1280 unless "keep below 1024" is checked in personal settings; and you could avoid postbacks/AJAX when "slow connection" is checked. Then slow connection would imply no automatic pasting, back to what it is now; and narrow screen could e.g. cause a smaller rep graph (actually all large images being reduced by a fixed factor, say 2/3, something very predictable). I'm in favor of automating things than can be automated (and providing an override if that could be useful, e.g. when automation could go wrong); but I also prefer getting more out of a non-minimal set-up rvrn if that means fiddling with some switches. If they are easy to understand, that should not cause too much trouble overall. IMO it is similar to the bunch of Windows Display settings such as "suppress window move animation", "disable form shadows", etc: the features are on by default, people having performance issues will soon figure it out and disable some. Well, that's my 2 eurocents anyway. :)

                        Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


                        Happy New Year to all.
                        We hope 2010 soon brings us automatic PRE tags!
                        Until then, please insert them manually.


                        D Offline
                        D Offline
                        Dan Neely
                        wrote on last edited by
                        #11

                        Luc Pattyn wrote:

                        you could avoid postbacks/AJAX when "slow connection" is checked.

                        I'm not sure what exactly you're suggesting here, but I read recently that ajax has generally improved performance for the poor saps on dialup because they didn't have to reload the entire page any longer.

                        3x12=36 2x12=24 1x12=12 0x12=18

                        L 1 Reply Last reply
                        0
                        • D Dan Neely

                          Luc Pattyn wrote:

                          you could avoid postbacks/AJAX when "slow connection" is checked.

                          I'm not sure what exactly you're suggesting here, but I read recently that ajax has generally improved performance for the poor saps on dialup because they didn't have to reload the entire page any longer.

                          3x12=36 2x12=24 1x12=12 0x12=18

                          L Offline
                          L Offline
                          Luc Pattyn
                          wrote on last edited by
                          #12

                          yes, but what we were discussing is adding new functionality ("smart pasting") that will increase traffic: the Internet connection permitting, we would apply server-side logic on every paste you perform in a CP message/article/whatever editor, whereas right now pasting is a client-side matter only, unless it looks like a hyperlink. :)

                          Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


                          Happy New Year to all.
                          We hope 2010 soon brings us automatic PRE tags!
                          Until then, please insert them manually.


                          1 Reply Last reply
                          0
                          • R ragnaroknrol

                            I find your points intriguing and wish to suscribe to your newsletter. If you weren't an MVP already this suggestion should make you one. It is an excellent idea to allow the user's personal settings to customize the site in order to deal with anything they may need as a special case and make the site better for everyone in general. Heck, when someone makes their account for the first time it could simply ask them a few questions and adjust settings according to their answers. What resolution does the monitor you view CP on use? (radio buttons with 3 common settings and "other") What sort of connection do you use? (again, radio buttons with common types)

                            A Offline
                            A Offline
                            AspDotNetDev
                            wrote on last edited by
                            #13

                            I like the idea of having the user select what options they would like when they sign up, but there may be obstacles to overcome. One would be that many users just sign up to get at an article download real quick, and forcing them to go through more overhead may reduce adoption rates. It would be neat to reserve a section of each page (e.g., the section that is currently reserved for ads) to present the user with those questions, so they could answer them whenever they happened to notice them. And once they've answered those questions (e.g., "would you like to disable programming language detection when you paste"), then that section of the page could be again given back to whatever it is temporarily replacing (or could be shown only half of the time, if replacing a section of the page is not desirable).

                            [Forum Guidelines]

                            1 Reply Last reply
                            0
                            Reply
                            • Reply as topic
                            Log in to reply
                            • Oldest to Newest
                            • Newest to Oldest
                            • Most Votes


                            • Login

                            • Don't have an account? Register

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • World
                            • Users
                            • Groups