Jump 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.

Featured Replies

Name & Parameters: HTMLEntities( text ; pointer ; store )

Description: Converts punctuation and symbols in 'text' to HTML entities, starting at position 'pointer'

Set the 'store' parameter to "" - If you give it a value it will prefix your output with that value.

 

Caution: This function will render inputted HTML non-functional. Since it will destroy the tags by replacing < and > with HTML entities.

 


Recursive: Yes

Sample Input:



Hi, I'm some text with some symbols or punctuation to convert to HTML entities! ?&/

Results:


Hi&#44; I&#39;m some text with some symbols or punctuation to convert to HTML entities&#33; &#63;&#38;&#47;

Formula:



/*
HTMLEntities
Converts punctuation/symbol characters in text into HTML entities, starting at position pointer
Free to use - attribution to my fmforums nickname would be nice
uemtux Oct 10, 2013
*/
Let(
[
step = Middle(text ; pointer ; 1);
step = Case(
//step = " " ; "&#32;" ; // Uncomment to replace spaces with entity codes
step = "!" ; "&#33;" ;
step = """ ; "&#34;" ; 
step = "#" ; "&#35;" ;
step = "$" ; "&#36;" ;  
step = "%" ; "&#37;" ; 
step = "&" ; "&#38;" ; 
step = "'" ; "&#39;" ;
step = "(" ; "&#40;" ;  
step = ")" ; "&#41;" ;  
step = "*" ; "&#42;" ; 
step = "+" ; "&#43;" ;   
step = "," ; "&#44;" ;
step = "-" ; "&#45;" ;
step = "." ; "&#46;" ;
step = "/" ; "&#47;" ;
step = ":" ; "&#58;" ;
step = ";" ; "&#59;" ;
step = "<" ; "&#60;" ;
step = "=" ; "&#61;" ;
step = ">" ; "&#62;" ;
step = "?" ; "&#63;" ;
step = "@" ; "&#64;" ;
step = "[" ; "&#91;" ;
step = "" ; "&#92;" ;
step = "]" ; "&#93;" ;
step = "^" ; "&#94;" ;
step = "_" ; "&#95;" ;
step = "`" ;  "&#96;" ;
step = "{" ;  "&#123;" ;
step = "|" ;  "&#124;" ;
step = "}" ;  "&#125;" ;
step = "~" ;  "&#126;" ; step);
store = store & step;
pointer = pointer + 1
];
Case(pointer > Length(text) ; store ; HTMLEntities(text ; pointer ; store))
)

Required Functions:

None.

 

 

Credits:

Got my info here: http://www.w3schools.com/tags/ref_ascii.asp

 



Disclaimer: FM Forums does not endorse or warrantee these functions are fit for any particular purpose. Do not post or distribute files without written approval from the copyright owner. All files are deemed public domain unless otherwise indictated. Please backup every file that you intend to modify.

Create an account or sign in to comment

Important Information

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

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.