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. In Q&A, TextBox messing user input.

In Q&A, TextBox messing user input.

Scheduled Pinned Locked Moved Site Bugs / Suggestions
htmlxmlquestion
8 Posts 4 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.
  • P Offline
    P Offline
    Patrice T
    wrote on last edited by
    #1

    In Q&A and probably in other places, TextBoxes (including comments) are changing user input on their own. - During user input/edition, preview look good. - When 'Submit you question' is hit, a process alter user input.

    // because of '< ' anything goes well
    for(int i=0; i< n; i++) {
    a += i;
    }

    // because of '<n' anything after it gets lost
    for(int i=0; i<n; i++) {
    a += i;
    }

    // if there is '<n' 2 times, everything in between is messed
    for(int i=0; i<n; i++) {
    a += i;
    }
    for(int i=0; i<n; i++) {
    a += i;
    }

    Encoding the input prevent problems. My understanding: As soon '<n' is encountered, process recognize as beginning of xml/html tag and remove anything after it if there is only 1. If there is 2 '<n', anything in between gets altered with some '=""' inserted between words. I think it would be more natural if the feature was deactivated by default I am sure I already reported same thing, but unable to find it in forum history.

    Patrice “Everything should be made as simple as possible, but no simpler.” Albert Einstein

    Greg UtasG M C 3 Replies Last reply
    0
    • P Patrice T

      In Q&A and probably in other places, TextBoxes (including comments) are changing user input on their own. - During user input/edition, preview look good. - When 'Submit you question' is hit, a process alter user input.

      // because of '< ' anything goes well
      for(int i=0; i< n; i++) {
      a += i;
      }

      // because of '<n' anything after it gets lost
      for(int i=0; i<n; i++) {
      a += i;
      }

      // if there is '<n' 2 times, everything in between is messed
      for(int i=0; i<n; i++) {
      a += i;
      }
      for(int i=0; i<n; i++) {
      a += i;
      }

      Encoding the input prevent problems. My understanding: As soon '<n' is encountered, process recognize as beginning of xml/html tag and remove anything after it if there is only 1. If there is 2 '<n', anything in between gets altered with some '=""' inserted between words. I think it would be more natural if the feature was deactivated by default I am sure I already reported same thing, but unable to find it in forum history.

      Patrice “Everything should be made as simple as possible, but no simpler.” Albert Einstein

      Greg UtasG Offline
      Greg UtasG Offline
      Greg Utas
      wrote on last edited by
      #2

      When you don't put a space before and after a binary operator, this is what happens. Cruel but fair. :laugh:

      Robust Services Core | Software Techniques for Lemmings | Articles
      The fox knows many things, but the hedgehog knows one big thing.

      <p><a href="https://github.com/GregUtas/robust-services-core/blob/master/README.md">Robust Services Core</a>
      <em>The fox knows many things, but the hedgehog knows one big thing.</em></p>

      P 1 Reply Last reply
      0
      • Greg UtasG Greg Utas

        When you don't put a space before and after a binary operator, this is what happens. Cruel but fair. :laugh:

        Robust Services Core | Software Techniques for Lemmings | Articles
        The fox knows many things, but the hedgehog knows one big thing.

        P Offline
        P Offline
        Patrice T
        wrote on last edited by
        #3

        See Solution 1 Find largest partial sum in the question below[^] OP (new menber) forgot to use the 'code' button.

        Patrice “Everything should be made as simple as possible, but no simpler.” Albert Einstein

        1 Reply Last reply
        0
        • P Patrice T

          In Q&A and probably in other places, TextBoxes (including comments) are changing user input on their own. - During user input/edition, preview look good. - When 'Submit you question' is hit, a process alter user input.

          // because of '< ' anything goes well
          for(int i=0; i< n; i++) {
          a += i;
          }

          // because of '<n' anything after it gets lost
          for(int i=0; i<n; i++) {
          a += i;
          }

          // if there is '<n' 2 times, everything in between is messed
          for(int i=0; i<n; i++) {
          a += i;
          }
          for(int i=0; i<n; i++) {
          a += i;
          }

          Encoding the input prevent problems. My understanding: As soon '<n' is encountered, process recognize as beginning of xml/html tag and remove anything after it if there is only 1. If there is 2 '<n', anything in between gets altered with some '=""' inserted between words. I think it would be more natural if the feature was deactivated by default I am sure I already reported same thing, but unable to find it in forum history.

          Patrice “Everything should be made as simple as possible, but no simpler.” Albert Einstein

          M Offline
          M Offline
          Matthew Dennis
          wrote on last edited by
          #4

          I will take a look at this.

          "Time flies like an arrow. Fruit flies like a banana."

          P 1 Reply Last reply
          0
          • M Matthew Dennis

            I will take a look at this.

            "Time flies like an arrow. Fruit flies like a banana."

            P Offline
            P Offline
            Patrice T
            wrote on last edited by
            #5

            Thank you. you can see problem in this question, OP just forgot to use the <pre> tag. How can I change this code to solve n equation? .[^] Would be nice to be able to block the changing process.

            Patrice “Everything should be made as simple as possible, but no simpler.” Albert Einstein

            1 Reply Last reply
            0
            • P Patrice T

              In Q&A and probably in other places, TextBoxes (including comments) are changing user input on their own. - During user input/edition, preview look good. - When 'Submit you question' is hit, a process alter user input.

              // because of '< ' anything goes well
              for(int i=0; i< n; i++) {
              a += i;
              }

              // because of '<n' anything after it gets lost
              for(int i=0; i<n; i++) {
              a += i;
              }

              // if there is '<n' 2 times, everything in between is messed
              for(int i=0; i<n; i++) {
              a += i;
              }
              for(int i=0; i<n; i++) {
              a += i;
              }

              Encoding the input prevent problems. My understanding: As soon '<n' is encountered, process recognize as beginning of xml/html tag and remove anything after it if there is only 1. If there is 2 '<n', anything in between gets altered with some '=""' inserted between words. I think it would be more natural if the feature was deactivated by default I am sure I already reported same thing, but unable to find it in forum history.

              Patrice “Everything should be made as simple as possible, but no simpler.” Albert Einstein

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

              I can't seem to replicate the issue.

              // if there is '

              // because of '

              In QA and forums this seems to work OK.

              In the QA you linked to, the code block wasn't enclosed in PRE, so it was treated as raw HTML. The <n was considered by our HTML cleaner as the start of a tag and it tried to correct it. It's kinda hard to fix issues like this because it could have easily been <i, which could legitimately been a mal-formed italic tag.

              Best solution: make new users use Markdown. Still, it has it's own quirks...

              cheers
              Chris Maunder

              P 2 Replies Last reply
              0
              • C Chris Maunder

                I can't seem to replicate the issue.

                // if there is '

                // because of '

                In QA and forums this seems to work OK.

                In the QA you linked to, the code block wasn't enclosed in PRE, so it was treated as raw HTML. The <n was considered by our HTML cleaner as the start of a tag and it tried to correct it. It's kinda hard to fix issues like this because it could have easily been <i, which could legitimately been a mal-formed italic tag.

                Best solution: make new users use Markdown. Still, it has it's own quirks...

                cheers
                Chris Maunder

                P Offline
                P Offline
                Patrice T
                wrote on last edited by
                #7

                Missing the <pre> tag is the common mistake of new members. I wonder if encoding suspicious text would not be a better approach ?

                Patrice “Everything should be made as simple as possible, but no simpler.” Albert Einstein

                1 Reply Last reply
                0
                • C Chris Maunder

                  I can't seem to replicate the issue.

                  // if there is '

                  // because of '

                  In QA and forums this seems to work OK.

                  In the QA you linked to, the code block wasn't enclosed in PRE, so it was treated as raw HTML. The <n was considered by our HTML cleaner as the start of a tag and it tried to correct it. It's kinda hard to fix issues like this because it could have easily been <i, which could legitimately been a mal-formed italic tag.

                  Best solution: make new users use Markdown. Still, it has it's own quirks...

                  cheers
                  Chris Maunder

                  P Offline
                  P Offline
                  Patrice T
                  wrote on last edited by
                  #8

                  An OP just posted a new question, he just forgot the <pre> tag: How do I...BFS and DFS algorithm. Implement the algorithm in this two files[^]

                  Patrice “Everything should be made as simple as possible, but no simpler.” Albert Einstein

                  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