4 Replies Latest reply on Nov 25, 2016 9:56 PM by PeterWindle

    getascss and hyperlinks

    PeterWindle

      Hello fellow filemakers...

       

      I have a body of text that I am using in an email (html format) that is being sent out via a mailit plugin.

       

      The body of text must be getascss(text) in order for the formatting to work, however, if I include a html hyperlink in the text, the getascss turns it into text. Without the getascss it is fine, but I lose all my formatting.

       

      the hyperlink is currently in the usual format of <a href="URL of the web page to go to">Text that will be the link</a>

       

       

      Is there a trick to formatting the hyperlink in order for it to work as a link within getascss(text)?

        • 1. Re: getascss and hyperlinks
          user19752

          If you don't have any text that should look like html code as you wrote, "decode" <a> tag using Substitute() function after GetAsCSS().

           

          Do you have more than one hyperlink, and it is not always same?

          • 2. Re: getascss and hyperlinks
            PeterWindle

            Yes and yes...

            the hyperlinks are user defined, it can change and there can be mulitple

            • 3. Re: getascss and hyperlinks
              user19752

              So need custom function.

               

              GetAsHTML(text)

              // parameter text is GetAsCSS(someText) then decode <a> tags.

               

              Let ( [

                start = Position ( text ; "&lt;a " ; 1 ; 1 ) ;

                end = Position ( text ; "&lt;/a&gt;" ; start + 6 ; 1 ) ; // 6 is Length("&lt;a ")

                anchor = Middle ( text ; start ; end - start + 10 ) //10 is Length("&lt;/a&gt;")

              ] ;

                Case ( not (start and end) ; text ;

                  Left ( text ; start - 1 ) & Substitute ( anchor ; [ "&lt;" ; "<" ] ; [ "&gt;" ; ">" ] ; [ "&quot;" ; "\"" ] ; [ "&apos;" ; "'" ] ; [ "&amp;" ; "&" ] ) & GetAsHTML ( Right ( text ; Length ( text ) - end - 9 ) )

                )

              )

               

              not so stable, need </a> tag as is (spaces are not allowed and should be lower case), etc.

              1 of 1 people found this helpful
              • 4. Re: getascss and hyperlinks
                PeterWindle

                you know something, I forgot about getasHTML... which is crazy, considering the task at hand...! hehe

                 

                that's awesome stuff, I'll give it a go next week. THANK YOU.