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

Re: [edit+] Lowercase all HTML?

Expand Messages
  • DZ-Jay
    I think there s a feature for this already. (I don t have access to EditPlus right now, so I could be wrong...) I believe that in the Preferences window, in
    Message 1 of 13 , Apr 19, 2005
      I think there's a feature for this already. (I don't have access to
      EditPlus right now, so I could be wrong...) I believe that in the
      Preferences window, in the General section, there's an option for
      "Lowercase HTML".

      dZ.

      On Apr 19, 2005, at 20:28, thatwould betelling wrote:

      >
      >
      > It would be nice to have an inbuilt function to convert all HTML tags
      > in legacy pages to lowercase for XHTML compatibility, but there might
      > be a long wait for such a feature.*
      > So in the meantime, is it possible to use a regexp search and replace?
      >
      > The logic (in my case) would be
      > Text inside < and > EXCLUDING tags starting with <Mv and EXCLUDING
      > text within double quotes should be lowercased.
      >
      > *Please don't repsond suggesting HTML tidy or similar - all the apps
      > I've tried go too far with functions that can't be disabled, such as
      > nesting management. When your source is generated by server-side
      > script, IF branches destroy nesting, and tidy chokes on the likes of
      > mivascript tags.
      >
      >
      >
      >
      >
      > http://www.editplus.com
      > http://groups.yahoo.com/group/editplus
      > Yahoo! Groups Links
      >
      >
      >
      >
      >
      >
      >
    • Aleem Juma
      dZ, that s just to control the html tags generated by the buttons on the html toolbar if i m not mistaken Aleem
      Message 2 of 13 , Apr 19, 2005
        dZ,
        that's just to control the html tags generated by the buttons on the
        html toolbar if i'm not mistaken

        Aleem


        On 4/20/05, DZ-Jay <dz@...> wrote:
        >
        > I think there's a feature for this already. (I don't have access to
        > EditPlus right now, so I could be wrong...) I believe that in the
        > Preferences window, in the General section, there's an option for
        > "Lowercase HTML".
        >
        > dZ.
        >
        > On Apr 19, 2005, at 20:28, thatwould betelling wrote:
        >
        > >
        > >
        > > It would be nice to have an inbuilt function to convert all HTML tags
        > > in legacy pages to lowercase for XHTML compatibility, but there might
        > > be a long wait for such a feature.*
        > > So in the meantime, is it possible to use a regexp search and replace?
        > >
        > > The logic (in my case) would be
        > > Text inside < and > EXCLUDING tags starting with <Mv and EXCLUDING
        > > text within double quotes should be lowercased.
        > >
        > > *Please don't repsond suggesting HTML tidy or similar - all the apps
        > > I've tried go too far with functions that can't be disabled, such as
        > > nesting management. When your source is generated by server-side
        > > script, IF branches destroy nesting, and tidy chokes on the likes of
        > > mivascript tags.
        > >
        > >
        > >
        > >
        > >
        > > http://www.editplus.com
        > > http://groups.yahoo.com/group/editplus
        > > Yahoo! Groups Links
        > >
        > >
        > >
        > >
        > >
        > >
        > >
        >
        > http://www.editplus.com
        > http://groups.yahoo.com/group/editplus
        > Yahoo! Groups Links
        >
        >
        >
        >
        >
      • lists@dramatic.co.nz
        ... Which I already have set and which makes all new code entered lowercase. But it doesn t touch existing code in the page. I have hundreds of pages written
        Message 3 of 13 , Apr 19, 2005
          >
          > I think there's a feature for this already. (I don't have access to
          > EditPlus right now, so I could be wrong...) I believe that in the
          > Preferences window, in the General section, there's an option for
          > "Lowercase HTML".
          >
          Which I already have set and which makes all new code entered lowercase.
          But it doesn't touch existing code in the page. I have hundreds of pages
          written in the 1990's which need upgrading.
        • Aleem Juma
          here s a very crude method if you have hundreds of pages, and can t find a better solution, you won t mind doing just 26 find/replace operations? this method
          Message 4 of 13 , Apr 19, 2005
            here's a very crude method
            if you have hundreds of pages, and can't find a better solution, you
            won't mind doing just 26 find/replace operations?

            this method replaces all caps between <>'s with their lowercase
            equivalents. note that this requires that the html is well formed. if
            you've got a stray < somewhere this will screw you up. also may go
            belly up with nested tags e.g. <!-- xx --> comments with tags within
            the commented section. you have been warned :-)

            find: <([^>A]*)A([^>]*)>
            replace: <\1a\2>
            (ensure regular expressions and match case are checked)
            keep hitting 'replace all until statusbar says "0 occurrences have
            been replaced"
            then
            find: <([^>B]*)B([^>]*)>
            replace: <\1b\2>
            and repeat for C->c, D->d, etc...


            Aleem


            On 4/20/05, lists@... <lists@...> wrote:
            >
            > >
            > > I think there's a feature for this already. (I don't have access to
            > > EditPlus right now, so I could be wrong...) I believe that in the
            > > Preferences window, in the General section, there's an option for
            > > "Lowercase HTML".
            > >
            > Which I already have set and which makes all new code entered lowercase.
            > But it doesn't touch existing code in the page. I have hundreds of pages
            > written in the 1990's which need upgrading.
            >
            >
            > http://www.editplus.com
            > http://groups.yahoo.com/group/editplus
            > Yahoo! Groups Links
            >
            >
            >
            >
            >
          • lists@dramatic.co.nz
            ... It s a start - thanks - but does that expression exclude the contents of attributes? (my exclude anything within double quotes stipulation) - although I
            Message 5 of 13 , Apr 19, 2005
              >
              > here's a very crude method

              >
              > find: <([^>A]*)A([^>]*)>
              > replace: <\1a\2>

              It's a start - thanks - but does that expression exclude the contents of
              attributes? (my "exclude anything within double quotes" stipulation) -
              although I have always made a habit of using lowercase URLs as it avoids
              all kinds of grief, other attributes might be case-sensitive).
            • Aleem Juma
              ah. no. won t exclude. sorry - missed that stipulation.
              Message 6 of 13 , Apr 20, 2005
                ah. no. won't exclude. sorry - missed that stipulation.

                On 4/20/05, lists@... <lists@...> wrote:
                >
                > >
                > > here's a very crude method
                >
                > >
                > > find: <([^>A]*)A([^>]*)>
                > > replace: <\1a\2>
                >
                > It's a start - thanks - but does that expression exclude the contents of
                > attributes? (my "exclude anything within double quotes" stipulation) -
                > although I have always made a habit of using lowercase URLs as it avoids
                > all kinds of grief, other attributes might be case-sensitive).
                >
                >
                > http://www.editplus.com
                > http://groups.yahoo.com/group/editplus
                > Yahoo! Groups Links
                >
                >
                >
                >
                >
              • John Morse
                My search of the web on this topic, everyone recommends running tidy as a usertool (you may just have to experiment with various settings until you get it
                Message 7 of 13 , Apr 20, 2005
                  My search of the web on this topic, everyone recommends running "tidy" as a
                  usertool (you may just have to experiment with various settings until
                  you get it just right)

                  Tuesday, April 19, 2005, 10:39:23 PM, you wrote:
                  >> find: <([^>A]*)A([^>]*)>
                  >> replace: <\1a\2>

                  lists> It's a start - thanks - but does that expression exclude the contents of
                  lists> attributes? (my "exclude anything within double quotes" stipulation) -
                  lists> although I have always made a habit of using lowercase URLs as it avoids
                  lists> all kinds of grief, other attributes might be case-sensitive).
                • Christoph Päper
                  ... It would probably do more harm than good. ... Elements: ( ]) - 1a 2 , ... ( ]) - 1z 2 . Attributes:
                  Message 8 of 13 , Apr 20, 2005
                    *thatwould betelling*:

                    >It would be nice to have an inbuilt function to convert all HTML tags
                    >in legacy pages to lowercase for XHTML compatibility,
                    >
                    It would probably do more harm than good.

                    >So in the meantime, is it possible to use a regexp search and replace?
                    >
                    >Text inside < and > EXCLUDING tags starting with <Mv and EXCLUDING
                    >text within double quotes should be lowercased.
                    >
                    >
                    Elements:
                    "(</?[A-z]*)A([A-z]*[> ])" -> "\1a\2",
                    ...
                    "(</?[A-z]*)Z([A-z]*[> ])" -> "\1z\2".
                    Attributes:
                    "(<[^>]+ [A-z]*)A([A-z]* *=)" -> "\1a\2",
                    ...
                    "(<[^>]+ [A-z]*)Z([A-z]* *=)" -> "\1z\2".
                    Thereafter
                    "<mv" -> "<Mv" ...
                    might work. With a more advanced regular expressions engine than the one
                    EditPlus uses, it would be easier.

                    >*Please don't repsond suggesting HTML tidy or similar
                    >
                    That (or a self-written script) would be the best solution, though.
                    Perhaps with 'new-pre-tags' or the like for Mv*. Indentation is off by
                    default; "markup=no", "wrap=0", "output-xhtml=no"(!),
                    "lower-literals=yes" may help.
                    Instead you could also temporarily wrap your script data inside '<?' and
                    '?>' (with "assume-xml-procins=yes", or '<%', '%>' or '<#', '#>' or
                    '<!CDATA[[', ']]>').

                    The more important question is why to change historic files at all.
                  • Richard Grevers
                    On Wed, 20 Apr 2005 15:38:41 +0200, Christoph Päper gave ... Because when I m doing a content upgrade of a site I like to upgrade its code
                    Message 9 of 13 , Apr 22, 2005
                      On Wed, 20 Apr 2005 15:38:41 +0200, Christoph Päper <crissov@...> gave
                      utterance to the following:

                      >
                      > *thatwould betelling*:
                      >
                      >> It would be nice to have an inbuilt function to convert all HTML tags
                      >> in legacy pages to lowercase for XHTML compatibility,
                      >>
                      > It would probably do more harm than good.
                      >
                      >> So in the meantime, is it possible to use a regexp search and replace?
                      >>
                      >> Text inside < and > EXCLUDING tags starting with <Mv and EXCLUDING
                      >> text within double quotes should be lowercased.
                      >>
                      >>
                      > Elements:
                      > "(</?[A-z]*)A([A-z]*[> ])" -> "\1a\2",
                      > ...
                      > "(</?[A-z]*)Z([A-z]*[> ])" -> "\1z\2".
                      > Attributes:
                      > "(<[^>]+ [A-z]*)A([A-z]* *=)" -> "\1a\2",
                      > ...
                      > "(<[^>]+ [A-z]*)Z([A-z]* *=)" -> "\1z\2".
                      > Thereafter
                      > "<mv" -> "<Mv" ...
                      > might work. With a more advanced regular expressions engine than the one
                      > EditPlus uses, it would be easier.
                      >
                      >> *Please don't repsond suggesting HTML tidy or similar
                      >>
                      > That (or a self-written script) would be the best solution, though.
                      > Perhaps with 'new-pre-tags' or the like for Mv*. Indentation is off by
                      > default; "markup=no", "wrap=0", "output-xhtml=no"(!),
                      > "lower-literals=yes" may help.
                      > Instead you could also temporarily wrap your script data inside '<?' and
                      > '?>' (with "assume-xml-procins=yes", or '<%', '%>' or '<#', '#>' or
                      > '<!CDATA[[', ']]>').
                      >
                      > The more important question is why to change historic files at all.
                      >
                      Because when I'm doing a content upgrade of a site I like to upgrade its
                      code standard as well, to make future redesigns and maintenance easier. I
                      would prefer to do this at no additional cost to the client.

                      --
                      Richard Grevers
                      Between two evils always pick the one you haven't tried
                    • matsukai
                      If you don t want to use HTML Tidy try something like Advanced Find and Replace ( http://www.abacre.com/afr/index.htm ) [QUOTE] Search multiple documents with
                      Message 10 of 13 , May 10, 2005
                        If you don't want to use HTML Tidy try something like Advanced Find
                        and Replace ( http://www.abacre.com/afr/index.htm )

                        [QUOTE]
                        Search multiple documents with smart queries and batch replace lines
                        of text!

                        Features:
                        Search files with smart queries as with AltaVista or Google.
                        Replace simple or multiline text in multiple files.
                        Complete search and replace in Microsoft Office Word and Excel files.
                        With batch replace operation you can easily replace or update
                        hundreds
                        of different links in several files.
                        Preview found text as with Google.
                        Possibility to replace in file names: it can be used as full-featured
                        file renamer.
                        Use Perl-style regular expressions for replacements of any complexity.
                        Saves results in XML and other formats.
                        Works with command line params.
                        Extremely fast, easy to use and excellent documentation is included.
                        It is a great time-saver for programmers and Webmasters
                        [/QUOTE]

                        --- In editplus@yahoogroups.com, "thatwould betelling" <lists@d...>
                        wrote:
                        >
                        > It would be nice to have an inbuilt function to convert all HTML
                        tags
                        > in legacy pages to lowercase for XHTML compatibility, but there
                        might
                        > be a long wait for such a feature.*
                        > So in the meantime, is it possible to use a regexp search and
                        replace?
                        >
                        > The logic (in my case) would be
                        > Text inside < and > EXCLUDING tags starting with <Mv and EXCLUDING
                        > text within double quotes should be lowercased.
                        >
                        > *Please don't repsond suggesting HTML tidy or similar - all the
                        apps
                        > I've tried go too far with functions that can't be disabled, such
                        as
                        > nesting management. When your source is generated by server-side
                        > script, IF branches destroy nesting, and tidy chokes on the likes
                        of
                        > mivascript tags.
                      • matsukai
                        Thought about RegEx and there s another solution: use Replace (Ctrl-H): Find what: (
                        Message 11 of 13 , May 10, 2005
                          Thought about RegEx and there's another solution:

                          use Replace (Ctrl-H):
                          Find what: (<[/]?[A-GI-Za-z]*)H
                          Replace with: \1h
                          Case sensitive
                          Regular expression
                          All open files

                          to replace all Hs in tag-names only.
                          Press "Replace All" (Alt-A) until "0 occurrences have been replaced."
                          is shown in the statusbar.
                          You have to do this with all 26 letters.

                          --- In editplus@yahoogroups.com, "thatwould betelling" <lists@d...>
                          wrote:
                          >
                          > It would be nice to have an inbuilt function to convert all HTML
                          tags
                          > in legacy pages to lowercase for XHTML compatibility, but there
                          might
                          > be a long wait for such a feature.*
                          > So in the meantime, is it possible to use a regexp search and
                          replace?
                          >
                          > The logic (in my case) would be
                          > Text inside < and > EXCLUDING tags starting with <Mv and EXCLUDING
                          > text within double quotes should be lowercased.
                          >
                          > *Please don't repsond suggesting HTML tidy or similar - all the apps
                          > I've tried go too far with functions that can't be disabled, such as
                          > nesting management. When your source is generated by server-side
                          > script, IF branches destroy nesting, and tidy chokes on the likes of
                          > mivascript tags.
                        • matsukai
                          correction, partially:
                          Message 12 of 13 , May 11, 2005
                            correction, partially:

                            <(/?)(?!Mv)([A-LN-Za-z]*)M([A-Za-z0-9]*)
                            and
                            \1\2m

                            for the rest of your wishes I think you should try RegexBuddy ( http:/
                            /www.regexbuddy.com/ ) for instance and try to find your ultimate
                            solution ;)
                            Or test a professional program.
                            Having HTML-code of the last millenium to convert to XHTML you
                            probably have to do more than only change upper- to lowercase. Values
                            have to be between double quotes, other attributes must have values.

                            If you don't want to test a professional prog try this:
                            Open your files in EditPlus and validate the first one using http://
                            validator.w3.org/check?uri=referer for XHTML and http://jigsaw.w3.org/
                            css-validator/check/referer for CSS. You can do this offline, too.
                            Than correct the first file carefully using "All open files" and
                            "Replace all".
                            Than the second and so on. After a few files most of them should
                            validate on the first check.

                            But this will be much more work than using a professional prog...


                            > --- In editplus@yahoogroups.com, "thatwould betelling" <lists@d...>
                            > wrote:
                            > >
                            > > It would be nice to have an inbuilt function to convert all HTML
                            > tags
                            > > in legacy pages to lowercase for XHTML compatibility, but there
                            > might
                            > > be a long wait for such a feature.*
                            > > So in the meantime, is it possible to use a regexp search and
                            > replace?
                            > >
                            > > The logic (in my case) would be
                            > > Text inside < and > EXCLUDING tags starting with <Mv and EXCLUDING
                            > > text within double quotes should be lowercased.
                            > >
                            > > *Please don't repsond suggesting HTML tidy or similar - all the
                            apps
                            > > I've tried go too far with functions that can't be disabled, such
                            as
                            > > nesting management. When your source is generated by server-side
                            > > script, IF branches destroy nesting, and tidy chokes on the likes
                            of
                            > > mivascript tags.
                          Your message has been successfully submitted and would be delivered to recipients shortly.