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

match html tag

Expand Messages
  • juliesassurance
    Hi I sent this same Q to the subscribe email for this grp. Didnt know if it would be seen there so sending again here. Does NoteTab have a feature that matches
    Message 1 of 10 , Jan 10, 2005
    • 0 Attachment
      Hi

      I sent this same Q to the subscribe email for this grp.
      Didnt know if it would be seen there so sending again here.

      Does NoteTab have a feature that matches or finds a beginning tag with
      its end tag.

      Most useful would be <Table and /Table>

      If so, where do I access this feature?

      Julie & Russ

      PS I did a search in Help and could not find: match html tag
    • Jeff Scism
      ... Does Control +M do it? Jeff -- Jeffery G. Scism, IBSSG ~~~~ Got a Blacksheep ancestor? http://blacksheep.rootsweb.com/ International Blacksheep Society of
      Message 2 of 10 , Jan 10, 2005
      • 0 Attachment
        juliesassurance wrote:

        >
        >Hi
        >
        >I sent this same Q to the subscribe email for this grp.
        >Didnt know if it would be seen there so sending again here.
        >
        >Does NoteTab have a feature that matches or finds a beginning tag with
        >its end tag.
        >
        >Most useful would be <Table and /Table>
        >
        >If so, where do I access this feature?
        >
        >Julie & Russ
        >
        >PS I did a search in Help and could not find: match html tag
        >
        >
        >
        >
        >
        >
        >
        >
        >CSE HTML Validator Lite - it's free: http://home.earthlink.net/~5wink/dl/cselite652.exe
        >
        >Fookes Software Home: http://www.fookes.us/redir
        >
        >Yahoo! Groups Links
        >
        >
        >
        >
        >
        >
        >
        >
        >
        >
        >
        Does Control +M do it?

        Jeff

        --


        Jeffery G. Scism, IBSSG

        ~~~~

        Got a Blacksheep ancestor?
        http://blacksheep.rootsweb.com/
        International Blacksheep Society of Genealogists
      • Don - htmlfixit.com
        ... No it doesn t to my knowledge. It matches brackets with control + M, but that isn t helpful here. It should be fairly easy to do this with a clip and I
        Message 3 of 10 , Jan 10, 2005
        • 0 Attachment
          juliesassurance wrote:
          >
          >
          > Hi
          >
          > I sent this same Q to the subscribe email for this grp.
          > Didnt know if it would be seen there so sending again here.
          >
          > Does NoteTab have a feature that matches or finds a beginning tag with
          > its end tag.
          >
          > Most useful would be <Table and /Table>
          >
          > If so, where do I access this feature?
          >
          > Julie & Russ
          >
          > PS I did a search in Help and could not find: match html tag

          No it doesn't to my knowledge. It matches brackets with control + M,
          but that isn't helpful here. It should be fairly easy to do this with a
          clip and I would suggest that one be prepared over on the clips list. I
          was in fact debating doing this very thing a few weeks ago. To my
          knowledge, there isn't an existing clip that does this.

          The logic is simple enough, you find the first tag, say <table> and then
          wish to find the corresponding </table> tag. What you do is set a
          counter to 1 when you find the tag in question, then you add one every
          time you find another <table> tag and subtract one for every </table>
          tag you find. When you get to zero, you have found your matching
          bracket. I may try to throw it together.

          I have copied this to clips and would suggest that the conversation
          occur over there, although we may wish to post the result back here
          when/if there is one.

          Don
        • Greg Chapman
          ... I tend to use TIDY s formatted (indented) output to see the location of matching closing tags. It s not perfect, but does what I need. Greg
          Message 4 of 10 , Jan 10, 2005
          • 0 Attachment
            > > Does NoteTab have a feature that matches or finds a beginning tag with
            > > its end tag.
            > > Most useful would be <Table and /Table>
            >
            > No it doesn't to my knowledge.

            I tend to use TIDY's formatted (indented) output to see the location of
            matching closing tags.

            It's not perfect, but does what I need.

            Greg
          • Don - htmlfixit.com
            Here is my try. It appears to be finding the proper tags in my testing. Unfortunately it isn t displaying right when I am done. In my example, it winds up
            Message 5 of 10 , Jan 10, 2005
            • 0 Attachment
              Here is my try. It appears to be finding the proper tags in my testing.
              Unfortunately it isn't displaying right when I am done. In my
              example, it winds up with the text off to the left and not visible. If
              I copy and paste the selected, then I see I got the right stuff.

              Once I get it working I will turn it around to find the matching start tag.

              ;*** Effort by Don Passenger
              ;*** don@...
              ;*** discuss things live in chat at http://htmlfixit.com
              ;*** based on work by Larry and Jody and maybe Wayne
              ;*******************************************************
              ;*** will check for a matching html tag

              ^!Continue [C]Is cursor in the tag you want to find a match for and then
              start clip

              ;### initialize everything
              ;assume we have our cursor in a tag
              ;look backwards to find the starting <
              ^!Find "<" TIBS
              ;exit if find fails
              ^!IfError EXIT
              ;figure out where cursor is
              ^!Set %row%="^$GetRow$"
              ^!Set %column%="^$GetCol$"

              ^!SetScreenUpdate Off
              ^!SetWordWrap Off
              ^!ClearVariables


              ;### %TAG% will be empty if cursor is not inside a tag.
              ^!Set %TAG%="^$GetHtmlTag(TRUE)$"
              ^!IfTrue ^$IsEmpty(^%TAG%)$ NotTag
              ^!If "/>" = "^$StrCopyRight("^$GetSelection$";2)$" SelfClosing


              ;### So we found a tag. What tag is it?
              ^!Set %TAGNAME%="^$GetHtmlTagName("^%TAG%";UPPERCASE)$"
              ^!Continue ^%TAGNAME%
              ^!Jump Select_End
              ^!Set %TAGCOUNT%=1
              ^!Info [C]^%TAGCOUNT%
              ^!If "/" = "^$StrCopyLeft("^%TAGNAME%";1)$" FindNextTagBackwards ELSE
              FindNextTagForwards

              :FindNextTagForwards
              ^!Find "<" TIS
              ^!IfError UnMatched
              ^!Set %TAGTEMP%="^$GetHtmlTag(TRUE)$"
              ^!IfTrue ^$IsEmpty(^%TAGTEMP%)$ NextTag
              ^!Set %TAGTEMPNAME%="^$GetHtmlTagName("^%TAGTEMP%";UPPERCASE)$"
              ^!If "/" = "^$StrCopyLeft("^%TAGTEMPNAME%";1)$" EndTag ELSE BeginTag

              :EndTag
              ^!Info [C]End Tag
              ^!If "^$StrDeleteLeft("^%TAGTEMPNAME%";1)$" <> "^%TAGNAME%" Skip_2
              ^!Dec %TAGCOUNT%
              ^!If "^%TAGCOUNT%" = "0" Match
              ^!Goto NextTag

              :BeginTag
              ^!Info [C]Beginning Tag
              ^!If "^%TAGTEMPNAME%" <> "^%TAGNAME%" Skip_2
              ^!Inc %TAGCOUNT%
              ^!If "^%TAGCOUNT%" = "0" Match
              ^!Goto NextTag

              :NextTag
              ^!Info [C]^%TAGCOUNT% -- ^%TAGTEMPNAME%

              ^!Jump Select_End
              ^!Goto FindNextTagForwards


              :FindNextTagBackwards
              ^!Info [C]Backwards not working yet ... will search towards the front of
              the document
              ^!Goto Finish



              :Match
              ^!SetScreenUpdate On
              ^!SetWordWrap On
              ^!Info [C]Bingo, we have a match!.
              ^!Jump SELECT_END
              ^!SelectTo ^%row%:^%column%
              ^!Goto Finish

              :UnMatched
              ^!SetCursor ^%row%:^%column%
              ^!Info [C]This appears to be an unmatched Tag. We made it to the end of
              your document without finding a match.
              ^!Goto Finish


              :NotTag
              ^!SetCursor ^%row%:^%column%
              ^!Info [C]This appears to not be an html tag. Remember have your cursor
              inside the tag when starting this clip.
              ^!Goto Finish


              :SelfClosing
              ^!SetCursor ^%row%:^%column%
              ^!Info [C]Your tag is self closing - quit messing with me! Self closing
              tags end in /> like <br />


              ;### clean up and go home
              :Finish
              ^!SetScreenUpdate On
              ^!SetWordWrap On
              ^!ClearVariables
              ;line 110 if you have all lines unrapped (including blank lines)
            • Don - htmlfixit.com
              next version ... works forward or backward I think my screen problem is fixed by not turning wordwrap off ;*** Effort by Don Passenger ;*** don@htmlfixit.com
              Message 6 of 10 , Jan 11, 2005
              • 0 Attachment
                next version ... works forward or backward I think
                my screen problem is fixed by not turning wordwrap off

                ;*** Effort by Don Passenger
                ;*** don@...
                ;*** discuss things live in chat at http://htmlfixit.com
                ;*** based on work by Larry and Jody and maybe Wayne
                ;*******************************************************
                ;*** will check for a matching html tag

                ^!Continue [C]If cursor is in the tag you want to find a match for click
                continue

                ;### initialize everything
                ;assume we have our cursor in a tag
                ;look backwards to find the starting <
                ^!Find "<" TIBS
                ;exit if find fails
                ^!IfError EXIT
                ^!SetScreenUpdate Off
                ^!ClearVariables

                ;### %TAG% will be empty if cursor is not inside a tag.
                ^!Set %TAG%="^$GetHtmlTag(TRUE)$"
                ^!IfTrue ^$IsEmpty(^%TAG%)$ NotTag
                ;if self closing get out too
                ^!If "/>" = "^$StrCopyRight("^$GetSelection$";2)$" SelfClosing


                ;### So we found a tag. What tag is it?
                ^!Set %TAGNAME%="^$GetHtmlTagName("^%TAG%";UPPERCASE)$"
                ;got to forwards or backwards routine depending if
                ;start or finish tag is selected at start of clip
                ^!If "/" = "^$StrCopyLeft("^%TAGNAME%";1)$" FindNextTagBackwards ELSE
                FindNextTagForwards

                :FindNextTagForwards
                ^!Jump Select_Start
                ;figure out where cursor is
                ^!Set %row%="^$GetRow$"
                ^!Set %column%="^$GetCol$"
                ^!Find ">" TIS
                ^!Set %TAGCOUNT%=1
                :TagForwardLoop
                ^!Find "<" TIS
                ^!IfError UnMatched
                ^!Set %TAGTEMP%="^$GetHtmlTag(TRUE)$"
                ^!IfTrue ^$IsEmpty(^%TAGTEMP%)$ NextTag
                ^!Set %TAGTEMPNAME%="^$GetHtmlTagName("^%TAGTEMP%";UPPERCASE)$"
                ^!If "/" = "^$StrCopyLeft("^%TAGTEMPNAME%";1)$" EndTag ELSE BeginTag

                :EndTag
                ^!If "^$StrDeleteLeft("^%TAGTEMPNAME%";1)$" <> "^%TAGNAME%" Skip_2
                ^!Dec %TAGCOUNT%
                ^!If "^%TAGCOUNT%" = "0" Match
                ^!Goto NextTag

                :BeginTag
                ^!If "^%TAGTEMPNAME%" <> "^%TAGNAME%" Skip_2
                ^!Inc %TAGCOUNT%
                ^!If "^%TAGCOUNT%" = "0" Match
                ^!Goto NextTag

                :NextTag
                ^!Jump Select_End
                ^!Goto TagForwardLoop


                :FindNextTagBackwards
                ^!Jump Select_End
                ;figure out where cursor is
                ^!Set %row%="^$GetRow$"
                ^!Set %column%="^$GetCol$"
                ^!Find "<" TIBS
                ^!Set %TAGCOUNT%=1
                :TagBackwardLoop
                ^!Find "<" TIBS
                ^!IfError UnMatched
                ^!Set %TAGTEMP%="^$GetHtmlTag(TRUE)$"
                ^!IfTrue ^$IsEmpty(^%TAGTEMP%)$ NextTag2
                ^!Set %TAGTEMPNAME%="^$GetHtmlTagName("^%TAGTEMP%";UPPERCASE)$"
                ^!If "/" = "^$StrCopyLeft("^%TAGTEMPNAME%";1)$" EndTag2 ELSE BeginTag2

                :EndTag2
                ^!If "^%TAGTEMPNAME%" <> "^%TAGNAME%" Skip_2
                ^!Inc %TAGCOUNT%
                ^!If "^%TAGCOUNT%" = "0" Match
                ^!Goto NextTag2

                :BeginTag2
                ^!If "^%TAGTEMPNAME%" <> "^$StrDeleteLeft("^%TAGNAME%";1)$" Skip_2
                ^!Dec %TAGCOUNT%
                ^!If "^%TAGCOUNT%" = "0" Match
                ^!Goto NextTag2

                :NextTag2
                ^!Jump Select_START
                ^!Goto TagBackwardLoop



                :Match
                ^!SetScreenUpdate On
                ^!Info [C]Bingo, we have a match!.
                ^!If "/" = "^$StrCopyLeft("^%TAGNAME%";1)$" MatchBackwardJump ELSE
                MatchForwardJump
                :MatchForwardJump
                ^!Jump SELECT_END
                ^!Goto MatchFinish
                :MatchBackwardJump
                ^!Jump SELECT_START
                :MatchFinish
                ^!SelectTo ^%row%:^%column%
                ^!Goto Finish

                :UnMatched
                ^!SetCursor ^%row%:^%column%
                ^!Info [C]This appears to be an unmatched Tag. We made it to the end of
                your document without finding a match.
                ^!Goto Finish


                :NotTag
                ^!SetCursor ^%row%:^%column%
                ^!Info [C]This appears to not be an html tag. Remember have your cursor
                inside the tag when starting this clip.
                ^!Goto Finish


                :SelfClosing
                ^!SetCursor ^%row%:^%column%
                ^!Info [C]Your tag is self closing - quit messing with me! Self closing
                tags end in /> like <br />


                ;### clean up and go home
                :Finish
                ^!SetScreenUpdate On
                ^!ClearVariables
                ;line 137 if you have all lines unrapped (including blank lines)
              • Adrian/ Rosemary Worsfold
                FindNextTagBackwards line is given as an error in mine. It s another good idea deleted after trying it. Adrian Worsfold http://www.pluralist.co.uk
                Message 7 of 10 , Jan 14, 2005
                • 0 Attachment
                  FindNextTagBackwards

                  line is given as an error in mine.

                  It's another good idea deleted after trying it.

                  Adrian Worsfold

                  http://www.pluralist.co.uk
                • Don - htmlfixit.com
                  ... Hey Adrian, Were you using my clip? I tested it forwards and backwards and it worked fine. I strongly suspect a wrapped line. I would appreciate help
                  Message 8 of 10 , Jan 15, 2005
                  • 0 Attachment
                    Adrian/ Rosemary Worsfold wrote:
                    > FindNextTagBackwards
                    >
                    > line is given as an error in mine.
                    >
                    > It's another good idea deleted after trying it.
                    Hey Adrian,

                    Were you using my clip? I tested it forwards and backwards and it
                    worked fine. I strongly suspect a wrapped line. I would appreciate
                    help figuring out if something is broken with it so I can get a working
                    copy out. The other one suggested seemed to work well also.

                    Don
                  • hsavage
                    ... Adrian, Are you sure that long word didn t get wrapped down to the next line in email. Several lines were wrapped when I copied the clip to a clipbook and
                    Message 9 of 10 , Jan 15, 2005
                    • 0 Attachment
                      Adrian/ Rosemary Worsfold wrote:
                      > FindNextTagBackwards
                      >
                      > line is given as an error in mine.
                      >
                      > It's another good idea deleted after trying it.
                      >
                      > Adrian Worsfold

                      Adrian,

                      Are you sure that long word didn't get wrapped down to the next line in
                      email. Several lines were wrapped when I copied the clip to a clipbook
                      and the word 'FindNextTagBackwards' was wrapped to a line by itself.

                      ºvº
                      05.01.15
                      hrs > hsavage@...
                    • Adrian/ Rosemary Worsfold
                      ... Yes. I look for broken lines but can t always detect them. It s gone now. Adrian Worsfold http://www.pluralist.co.uk
                      Message 10 of 10 , Jan 17, 2005
                      • 0 Attachment
                        >Were you using my clip? I tested it forwards and backwards<

                        Yes. I look for broken lines but can't always detect them. It's gone now.

                        Adrian Worsfold

                        http://www.pluralist.co.uk
                      Your message has been successfully submitted and would be delivered to recipients shortly.