Newbies BenDover Posted September 13, 2007 Newbies Posted September 13, 2007 Hi, is there an easy way to convert these character types to plain text markup? , etc
BobWeaver Posted September 14, 2007 Posted September 14, 2007 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.
comment Posted September 14, 2007 Posted September 14, 2007 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 )
BobWeaver Posted September 15, 2007 Posted September 15, 2007 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.
Recommended Posts
This topic is 6375 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now