Loading ...
Sorry, an error occurred while loading the content.

Re: [NH] &

Expand Messages
  • Kathy Jungjohann
    ... Rudi, You re right: I had typed it straight into the address bar. I see when I put the entity in the url of a link, it does convert ok. My mistake. (But
    Message 1 of 19 , May 6, 2004
    • 0 Attachment
      >You're supposed to put the & into Your HTML, not into Your address
      >bar (is that what You were doing?)
      Rudi,
      You're right: I had typed it straight into the address bar.
      I see when I put the entity in the url of a link, it does convert ok.
      My mistake. (But I'll stick to plain old & in links just the same.)
      Kathy
    • John Zeman
      ... address ... ok. ... I ve never read the *official* reason why certain characters such as & should be converted, but I know in many programming languages &
      Message 2 of 19 , May 6, 2004
      • 0 Attachment
        --- In ntb-html@yahoogroups.com, Kathy Jungjohann <kjj@a...> wrote:
        >
        > >You're supposed to put the & into Your HTML, not into Your
        address
        > >bar (is that what You were doing?)
        > Rudi,
        > You're right: I had typed it straight into the address bar.
        > I see when I put the entity in the url of a link, it does convert
        ok.
        > My mistake. (But I'll stick to plain old & in links just the same.)
        > Kathy


        I've never read the *official* reason why certain characters such as
        & should be converted, but I know in many programming languages & is
        a command. And when & is used as anything other than a command the
        script fails unless the & has been escaped.

        Basically, that's what the & is, a safe way to use & in your html
        even though all the browsers I'm aware of will display it either way.

        Besides & I also convert non breaking spaces, single, and double
        quotes. It may not be necessary but it makes it easy for me to
        differentiate the html code from the plain text in the document.

        John
      • John Zeman
        ... I know in many programming languages & is ... A slight correction to my previous post. & Is not a command in many other languages, it s used to group
        Message 3 of 19 , May 6, 2004
        • 0 Attachment
          --- In ntb-html@yahoogroups.com, "John Zeman" <john041650@y...> wrote:
          I know in many programming languages & is
          > a command. And when & is used as anything other than a command the
          > script fails unless the & has been escaped.


          A slight correction to my previous post.

          & Is not a command in many other languages, it's used to group
          commands in many other languages. To run one command and then
          another.

          John
        • Jody
          Hi John ... "e;non breaking spaces"e; or only in urls and such? (I just guessed at the "e;.) Take care, Jody Adair The whole world doth
          Message 4 of 19 , May 6, 2004
          • 0 Attachment
            Hi John

            >Besides & I also convert non breaking spaces, single, and double
            >quotes. It may not be necessary but it makes it easy for me to
            >differentiate the html code from the plain text in the document.

            >Does that mean that you would convert "non breaking spaces" into

            "e;non breaking spaces"e;

            or only in urls and such? (I just guessed at the "e;.)


            Take care,
            Jody Adair

            The whole world doth err save you and me,
            and even thou doest err some!
            http://clean-funnies.com
            http://notetab.net, http://fookes.us
          • Don - htmlfixit.com
            ... Then your pages will be non-compliant with standards if you care. It is better to do as they suggest and use the character entity so you generate
            Message 5 of 19 , May 6, 2004
            • 0 Attachment
              Kathy Jungjohann wrote:

              >>You're supposed to put the & into Your HTML, not into Your address
              >>bar (is that what You were doing?)
              >
              > Rudi,
              > You're right: I had typed it straight into the address bar.
              > I see when I put the entity in the url of a link, it does convert ok.
              > My mistake. (But I'll stick to plain old & in links just the same.)
              > Kathy
              >

              Then your pages will be non-compliant with standards if you care. It is
              better to do as they suggest and use the character entity so you
              generate validated pages.
            • sisterscape
              ... I never gave this a second thought until validation became important for me. Now I would never think of publishing an unvalidated page!
              Message 6 of 19 , May 6, 2004
              • 0 Attachment
                --- "Don - htmlfixit.com" <don@...> wrote:
                > Kathy Jungjohann wrote:

                > > (But I'll stick to plain old & in links just the same.)
                > > Kathy
                > >
                >
                > Then your pages will be non-compliant with standards if you care. It
                > is better to do as they suggest and use the character entity so you
                > generate validated pages.
                >
                I never gave this a second thought until validation became important
                for me. Now I would never think of publishing an unvalidated page!




                __________________________________
                Do you Yahoo!?
                Win a $20,000 Career Makeover at Yahoo! HotJobs
                http://hotjobs.sweepstakes.yahoo.com/careermakeover
              • John Zeman
                ... Not quite Jody. in html extra (more than one) spaces are ignored by the browser, that s why you can indent your code if you want. To force extra spaces to
                Message 7 of 19 , May 6, 2004
                • 0 Attachment
                  --- In ntb-html@yahoogroups.com, Jody <kjv-av1611@e...> wrote:
                  > Hi John
                  >
                  > >Besides & I also convert non breaking spaces, single, and double
                  > >quotes. It may not be necessary but it makes it easy for me to
                  > >differentiate the html code from the plain text in the document.
                  >
                  > >Does that mean that you would convert "non breaking spaces" into
                  >
                  > "e;non breaking spaces"e;
                  >
                  > or only in urls and such? (I just guessed at the "e;.)
                  >
                  >


                  Not quite Jody. in html extra (more than one) spaces are ignored by
                  the browser, that's why you can indent your code if you want. To
                  force extra spaces to be displayed in the text, you need to use
                    in place of, or along with, regular spaces. In your example,
                  unless you had non breaking spaces in place of regular spaces, it
                  would be converted as follows:

                  Does that mean that you would convert "non breaking spaces"
                  into

                  Only the quotes are converted.

                  You can't have spaces in URLS so there's no reason to use non
                  breaking spaces in links. Non breaking spaces only apply to plain
                  text. To see a good example of it, just use the NoteTab command
                  of "modify document to html with paragraph tags" on a text document
                  that has two or more spaces between sentences.

                  John
                • Jody
                  Hi John, ... Yes, I was just curious if you did the whole document literally. ... %20 :) ... Yep. I have two Clips I use a lot: H=   1 Space  
                  Message 8 of 19 , May 6, 2004
                  • 0 Attachment
                    Hi John,

                    >> >Does that mean that you would convert "non breaking spaces" into
                    >>
                    >> "e;non breaking spaces"e;
                    >>
                    >> or only in urls and such? (I just guessed at the "e;.)
                    >
                    >Not quite Jody. in html extra (more than one) spaces are ignored by
                    >the browser, that's why you can indent your code if you want.

                    Yes, I was just curious if you did the whole document literally.

                    >You can't have spaces in URLS so there's no reason to use non
                    >breaking spaces in links.

                    %20 :)

                    >Non breaking spaces only apply to plain text. To see a good
                    >example of it, just use the NoteTab command of "modify document
                    >to html with paragraph tags" on a text document that has two or
                    >more spaces between sentences.

                    Yep. I have two Clips I use a lot:

                    H="  1 Space"
                     

                    H="  5 Spaces"
                         

                    Sometimes I use the menu; just depends on where I'm at, but I can
                    get to most of my frequent Clips as fast as I can to the menu and
                    don't take the chance of my mouse pointer sliding off and having
                    to start again because it collapses.

                    I just added this clip :)

                    H=Fill Spaces with  
                    ^$StrFill(" ";^$GetSelSize$)$

                    bcnu,
                    jody

                    I can only please one person a day.
                    Today is obviously not your day.
                    Tomorrow doesn't look good either. 8D
                    http://www.clean-funnies.com
                    http://www.fookes.com/regnow.html?2448 ;)
                    http://www.sojourner.us/software
                  • John Zeman
                    ... by ... That s true Jody, if someone attempts to use spaces in a URL they should be changed to %20 instead. One thing you may want to keep in mind when
                    Message 9 of 19 , May 6, 2004
                    • 0 Attachment
                      --- In ntb-html@yahoogroups.com, Jody <kjv-av1611@e...> wrote:
                      > Hi John,
                      >
                      > >> >Does that mean that you would convert "non breaking spaces" into
                      > >>
                      > >> "e;non breaking spaces"e;
                      > >>
                      > >> or only in urls and such? (I just guessed at the "e;.)
                      > >
                      > >Not quite Jody. in html extra (more than one) spaces are ignored
                      by
                      > >the browser, that's why you can indent your code if you want.
                      >
                      > Yes, I was just curious if you did the whole document literally.
                      >
                      > >You can't have spaces in URLS so there's no reason to use non
                      > >breaking spaces in links.
                      >
                      > %20 :)
                      >
                      > >Non breaking spaces only apply to plain text. To see a good
                      > >example of it, just use the NoteTab command of "modify document
                      > >to html with paragraph tags" on a text document that has two or
                      > >more spaces between sentences.
                      >
                      > Yep. I have two Clips I use a lot:
                      >
                      > H="  1 Space"
                      >  
                      >
                      > H="  5 Spaces"
                      >      
                      >
                      > Sometimes I use the menu; just depends on where I'm at, but I can
                      > get to most of my frequent Clips as fast as I can to the menu and
                      > don't take the chance of my mouse pointer sliding off and having
                      > to start again because it collapses.
                      >
                      > I just added this clip :)
                      >
                      > H=Fill Spaces with  
                      > ^$StrFill(" ";^$GetSelSize$)$
                      >
                      > bcnu,
                      > jody
                      >


                      That's true Jody, if someone attempts to use spaces in a URL they
                      should be changed to %20 instead.

                      One thing you may want to keep in mind when using non breaking
                      spaces, is they mean just what their name implies. They're meant to
                      keep text together on one line. So as a general rule if you're going
                      to display a long string of spaces, you may want to consider
                      alternating between regular spaces and non breaking ones. e.g.

                               

                      instead of:

                               

                      Doing it the first way will allow line breaks to take place at proper
                      points when the page is viewed in a smaller window.

                      John
                    • Jody
                      Hi John, I suppose           w/o breaking them could be one of the reasons for getting the horizontal scrollbar.
                      Message 10 of 19 , May 6, 2004
                      • 0 Attachment
                        Hi John,

                        I suppose          
                        w/o breaking them could be one of the reasons for getting the
                        horizontal scrollbar. (I hate finding those problems in my code.)
                        I know images can do it, bad code,... but I haven't found other
                        reasons (at least that I can remember) other than some table and
                        margin-left/right in css and width sometimes. I have a few pages
                        somewhere <g> that has the horizontal bar just for about 1/2" and
                        cannot figure out what is causing it. None of the above seems to.
                        Feel free to change the Subject to Unwanted Horizontal Scrollbar
                        if you want to offer suggestions (off the top of your head)
                        because I'd have to go searching for the pages to send a link in.

                        >One thing you may want to keep in mind when using non breaking
                        >spaces, is they mean just what their name implies. They're meant to
                        >keep text together on one line. So as a general rule if you're going
                        >to display a long string of spaces, you may want to consider
                        >alternating between regular spaces and non breaking ones. e.g.
                        >
                        >         
                        >
                        >instead of:
                        >
                        >         
                        >
                        >Doing it the first way will allow line breaks to take place at proper
                        >points when the page is viewed in a smaller window.


                        I've got Fookesability!
                        Sometimes, no sensibility. :(
                        Jody

                        fookes.us, notetab.net
                        clean-funnies.com, bwbc.us
                        sureword.net, sojourner.us
                      • Marcelo de Castro Bastos
                        ... &, are reserved characters in HTML. This means that they should be used ONLY for marking elements ( ) or entities (&). This way, the browser
                        Message 11 of 19 , May 6, 2004
                        • 0 Attachment
                          On 6/5/2004 13:31, John Zeman invited the wrath of the gods by saying:

                          > I've never read the *official* reason why certain characters such as
                          >
                          >& should be converted, but I know in many programming languages & is
                          >a command. And when & is used as anything other than a command the
                          >script fails unless the & has been escaped.
                          >
                          >Basically, that's what the & is, a safe way to use & in your html
                          >even though all the browsers I'm aware of will display it either way.
                          >
                          >Besides & I also convert non breaking spaces, single, and double
                          >quotes. It may not be necessary but it makes it easy for me to
                          >differentiate the html code from the plain text in the document.
                          >
                          >
                          >
                          &, < and > are "reserved" characters in HTML. This means that they
                          should be used ONLY for marking elements (<>) or entities (&). This way,
                          the browser parser won't have to "guess" if you are using them for other
                          things.

                          That means: the ONLY syntactically-allowed way to use "&" in HTML is as
                          the prefix for an entity. So, if you WANT and "&" there, you have to use
                          the equivalent entity instead.

                          Since there are a LOT of badly-coded pages out there, in practice
                          browsers have additional code to try and "guess" what to do when they
                          find things that aren't standard HTML. That's why you find sites with
                          unescaped "&" in the middle of the code, or unterminated entities, and
                          it still displays as intended. But you shouldn't trust on the browser
                          guesses; you should try to create syntactically-valid HTML instead.

                          Double-quotes (") used to be considered reserved too, but this is no
                          longer true. You may prefer leaving them as entities for the reason you
                          mentioned (easier to separate them from the code), but it's not
                          necessary to validate. Single-quotes were never reserved, so the same
                          applies. OTOH, if there are a LOT of quotes in the text (for instance, a
                          dialogue), converting them into entities will make your pages a bit larger.


                          --
                          Marcelo de Castro Bastos

                          -=-=-
                          ... No one is listening until you make a mistake.
                          * TagZilla 0.049
                        • John Zeman
                          ... way, ... other ... That makes perfect sense Marcelo, and I should have realized it. Every other language I work with has reserved characters, that s what I
                          Message 12 of 19 , May 6, 2004
                          • 0 Attachment
                            --- In ntb-html@yahoogroups.com, Marcelo de Castro Bastos
                            <mcblista@t...> wrote:

                            > &, < and > are "reserved" characters in HTML. This means that they
                            > should be used ONLY for marking elements (<>) or entities (&). This
                            way,
                            > the browser parser won't have to "guess" if you are using them for
                            other
                            > things.
                            >


                            That makes perfect sense Marcelo, and I should have realized it.
                            Every other language I work with has reserved characters, that's what
                            I was kinda sorta alluding to earlier.

                            I was just having a brain hiccup as to what they're called in html.

                            Thanks for the refresher.

                            John
                          Your message has been successfully submitted and would be delivered to recipients shortly.