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. Pls have indentation work in "code" mode similar to "pre" mode

Pls have indentation work in "code" mode similar to "pre" mode

Scheduled Pinned Locked Moved Site Bugs / Suggestions
htmlhelpcode-review
4 Posts 3 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.
  • L Offline
    L Offline
    l_d_allan
    wrote on last edited by
    #1

    Here is a minor suggestion that might improve your wonderful website: I would expect the "code" option at the bottom of this page to not only highlight and use monospace, but also to leave spaces intact for indentation and lining up code ... which would be equivalent to what the "pre" button does. Perhaps this is not something you can control or change even if you wanted to. I am not that familiar with HTML ... my impression is that < pre > is a valid HTML tag, but I don't believe that < code > is ... so it isn't like the forum software has a standard to conform to. By the way, I like how this forum software works compared to some others that I am experienced with .... you can select a range of lines, click on the < code > button, and the selected code is "wrapped" within < code >selected lines< / code >. That isn't the case with some forum software. This is line 1 without the code tag. This line has iiiiiiiiii's This line has wwwwwwwwww's This line has a bunch of spaces This line is supposed to be indented three spaces This line is supposed to be indented six spaces This is line 1 with the code tag This line has iiiiiiiiii's This line has wwwwwwwwww's This line has a bunch of spaces This line is supposed to be indented three spaces This line is supposed to be indented six spaces

    This is line 1 with the pre tag
    This line has iiiiiiiiii's
    This line has wwwwwwwwww's
    This line has a bunch of spaces
    This line is indented three spaces
    This line is indented six spaces

    I may not be "the brightest bulb in the box", but I regularly have to use trial and error to get code snippets to show up correctly in messages I post. -- modified at 17:48 Tuesday 28th February, 2006

    P M 2 Replies Last reply
    0
    • L l_d_allan

      Here is a minor suggestion that might improve your wonderful website: I would expect the "code" option at the bottom of this page to not only highlight and use monospace, but also to leave spaces intact for indentation and lining up code ... which would be equivalent to what the "pre" button does. Perhaps this is not something you can control or change even if you wanted to. I am not that familiar with HTML ... my impression is that < pre > is a valid HTML tag, but I don't believe that < code > is ... so it isn't like the forum software has a standard to conform to. By the way, I like how this forum software works compared to some others that I am experienced with .... you can select a range of lines, click on the < code > button, and the selected code is "wrapped" within < code >selected lines< / code >. That isn't the case with some forum software. This is line 1 without the code tag. This line has iiiiiiiiii's This line has wwwwwwwwww's This line has a bunch of spaces This line is supposed to be indented three spaces This line is supposed to be indented six spaces This is line 1 with the code tag This line has iiiiiiiiii's This line has wwwwwwwwww's This line has a bunch of spaces This line is supposed to be indented three spaces This line is supposed to be indented six spaces

      This is line 1 with the pre tag
      This line has iiiiiiiiii's
      This line has wwwwwwwwww's
      This line has a bunch of spaces
      This line is indented three spaces
      This line is indented six spaces

      I may not be "the brightest bulb in the box", but I regularly have to use trial and error to get code snippets to show up correctly in messages I post. -- modified at 17:48 Tuesday 28th February, 2006

      P Offline
      P Offline
      PJ Arends
      wrote on last edited by
      #2

      I disagree. The <code> tag is meant for inline code segments like this, while the <pre> tag is meant for preformatted text blocks like

      this

      . Their intended uses are totally different, it is just that so many users use <code> when they should be using <pre>.


      You may be right I may be crazy But it just may be a lunatic you’re looking for -- Billy Joel -- Within you lies the power for good - Use it!

      1 Reply Last reply
      0
      • L l_d_allan

        Here is a minor suggestion that might improve your wonderful website: I would expect the "code" option at the bottom of this page to not only highlight and use monospace, but also to leave spaces intact for indentation and lining up code ... which would be equivalent to what the "pre" button does. Perhaps this is not something you can control or change even if you wanted to. I am not that familiar with HTML ... my impression is that < pre > is a valid HTML tag, but I don't believe that < code > is ... so it isn't like the forum software has a standard to conform to. By the way, I like how this forum software works compared to some others that I am experienced with .... you can select a range of lines, click on the < code > button, and the selected code is "wrapped" within < code >selected lines< / code >. That isn't the case with some forum software. This is line 1 without the code tag. This line has iiiiiiiiii's This line has wwwwwwwwww's This line has a bunch of spaces This line is supposed to be indented three spaces This line is supposed to be indented six spaces This is line 1 with the code tag This line has iiiiiiiiii's This line has wwwwwwwwww's This line has a bunch of spaces This line is supposed to be indented three spaces This line is supposed to be indented six spaces

        This is line 1 with the pre tag
        This line has iiiiiiiiii's
        This line has wwwwwwwwww's
        This line has a bunch of spaces
        This line is indented three spaces
        This line is indented six spaces

        I may not be "the brightest bulb in the box", but I regularly have to use trial and error to get code snippets to show up correctly in messages I post. -- modified at 17:48 Tuesday 28th February, 2006

        M Offline
        M Offline
        Michael Dunn
        wrote on last edited by
        #3

        CODE tag spec[^] <pre> means preformatted, that is, it overrides the HTML parsing rule that changes multiple consecutive whitespace chars into one space. <code> is by definition an inline tag (whereas <pre> is a block tag) so it doesn't make sense to override the space parsing rules for <code> --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ

        L 1 Reply Last reply
        0
        • M Michael Dunn

          CODE tag spec[^] <pre> means preformatted, that is, it overrides the HTML parsing rule that changes multiple consecutive whitespace chars into one space. <code> is by definition an inline tag (whereas <pre> is a block tag) so it doesn't make sense to override the space parsing rules for <code> --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ

          L Offline
          L Offline
          l_d_allan
          wrote on last edited by
          #4

          My bad ... I didn't realize that "code" was an html tag ... I did a quick check of the spec, but obviously should have looked more thoroughly.

          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