Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Convert bold type to <b></b>

Featured Replies

  • Newbies

Hi, is there an easy way to convert these character types to plain text markup?

,

etc

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.

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 )

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

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.