www.webdeveloper.com
Results 1 to 7 of 7

Thread: Forum Software [i] tag Glitch

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Location
    Los Angeles, CA
    Posts
    4,887

    Forum Software [i] tag Glitch

    Code:
    var a1=b1[i];
    Code:
    true equals 1 and false equals 0
    Quote me to see what I actually typed. Note that the I tag is running through one CODE tag to the next.

  2. #2
    Join Date
    Jan 2005
    Location
    Los Angeles, CA
    Posts
    4,887
    The "b" tag should have the exact same behavior as the "i" tag but instead it displays properly
    Code:
    var a1=b1[i];
    Code:
    true equals 1 and false equals 0

  3. #3
    Join Date
    Jun 2004
    Location
    48°46′36″ N 9°10′48″ E
    Posts
    3,747
    just a test
    Code:
    var a1=b1[b];
    Code:
    true equals 1 and false equals 0
    see it does do the same with "b", its just that in your second example, you mixed both "i" and "b".
    the codes sees the opening "b" and the ending "b"
    its a problem with that greedy/ungreedy stuff, isnt it?

  4. #4
    Join Date
    May 2004
    Location
    Manhattan NY
    Posts
    6,028
    I checked what you typed, that seems exactly as it's supposed to function.

  5. #5
    Join Date
    Jun 2004
    Location
    48°46′36″ N 9°10′48″ E
    Posts
    3,747
    shouldnt the bold "b"(second one) not appear and the first one output some kind of error because it's missing a closing tag`?

  6. #6
    Join Date
    May 2004
    Location
    Manhattan NY
    Posts
    6,028
    What I saw was opening and closing i tags around each word, just as it appears it would be.

  7. #7
    Join Date
    Dec 2002
    Location
    Manchester, UK
    Posts
    6,275
    Looking at the source code of the page, it seems that there is an error with the forum software Joe, tags aren't being closed in the correct order. Here's the (slightly simplified) source code on the page:
    Code:
    <pre>
      var a1=b1<i>;
    </pre>
    <pre>
      [i]true</i> equals 1 and <i>false</i> equals 0
    </pre>
    The forum software just finds an opening i and a closing i, and anything inbetween is made italic, even if tags are not closed in the correct order.

    The reason that the software does not do as you expected with the b tag is because you opened an i first, not a b. Look at this:
    Code:
    var a1=b1[b];
    Code:
    true equals 1 and false equals 0
    Basically, a more sophisticated regular expression is needed to match the opening and closing BB tags correctly, however problems could be avoided if you just make sure you close all of the tags.
    Every fight is a food fight when you’re a cannibal.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles