September 13, 200718 yr Newbies Hi, is there an easy way to convert these character types to plain text markup? , etc
September 14, 200718 yr I'm not all that up on my html tags, but I think means line break right? If so, it can be easily converted using the substitute function. Just Do something like: Substitute (TextField;¶;" However, for formatting of bold underline and italics, which have both a start and end tag, it gets more complex. You have to use a fairly complex function; Let([ k=TextField; a=Substitute(GetAsCSS ( k ); ["";""];[""";"""];["“";"“"];["”";"”"]; ["<";""&Let([T="<"]; [">";">"; S=PatternCount(T;"SPAN"); X=PatternCount(T;""); B=MIN(1;PatternCount(T;"WEIGHT: BOLD")); I=MIN(1;PatternCount(T;"STYLE:ITALIC")); U=MIN(1;PatternCount(T;"DECORATION:UNDERLINE"))]; Case(X;T;S AND (B OR I OR U);"";S;"";T))&""]); b=Evaluate("""&a&"""); c="""&Substitute(b; ["";""];[""";"""];["“";"“"];["”";"”"]; ["";""&Let([b="";T="[b][i][u]"]; ["";""&Let([b="[/b][/i]";T="[b][i]"]; ["";""&Let([b="[/b][/u]";T="[b][u]"]; ["";""&Let([b="[/i][/u]";T="[i][u]"]; ["";""&Let([b="[/b]";T=""]; ["";""&Let([b="[/i]";T=""]; ["";""&Let([b="[/u]";T=""]; ["";""&Let([b="";T=""]; [" ";""];T&:&""])&""" ]; Evaluate ( c ) ) I wrote the above function originally to convert formatted text to it's rtf tagged plain text equivalent. I modified it quickly tonight to html tags for , and . Didn't test it all that thoroughly. Hope it helps.
September 14, 200718 yr Hi Bob, good to see you around again. I'm not sure what's the purpose here - perhaps the poster would be satisfied with the results of just: GetAsCSS ( Textfield )
September 15, 200718 yr Hi Comment, thanks. I haven't really been too far away. Doing some lurking, but not posting. I just seem to have been out of the Filemaker loop for a while, and didn't see any threads that caught my interest. About the GetAsCSS() function. Yes maybe that is all that's required. I didn't think of that until after I posted.
Create an account or sign in to comment