Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
Text.TextToHTML
Creates HTML text for a given FileMaker formatted styled text.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Text | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameters
Parameter | Description | Example | Flags |
---|---|---|---|
Text | Formatted text to convert. | "Hello World" | |
Options | Available in MBS FileMaker Plugin 6.5 or newer. The options number for html creation. Add 1 for having no body around. Add 2 to have no font names. Add 4 to have no font sizes. Add 8 to use strong instead of b tag for bold. Add 16 to keep links in HTML to pass through <a..></a> tags. (new in 7.4). Add 32 to use paragraphs. (new in 13.1) |
1+2+4+8 | Optional |
Result
Returns OK or error.
Description
Creates HTML text for a given FileMaker formatted styled text.Supports styles like bold, italic, underline, font size and text color. Other style features may be added in the future on demand.
See also Text.EncodeToHTML and GetAsCSS in FileMaker.
Version 11.2 adds support for strikethrough using s tag in html.
Version 12.0 adds superscript and subscript style for HTML.
Version 13.1 adds flag 32 to use <p> instead of <br/><br/> for two returns in the text in a style run.
Examples
Convert some text to HTML
MBS( "Text.TextToHTML"; "Hello World" )
Example result:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de">
<head>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />
</head>
<body>
<p>Hello World</p></body>
</html>
Convert some text to RTF
MBS( "Text.TextToRTF"; "Hello World" )
Example result:
{\rtf1\ansi\ansicpg1252
Hello World
}
Convert without body/header:
MBS( "Text.TextToHTML"; "Hello World”; 1 )
Example result: <p>Hello World</p>
Convert using paragraphs:
MBS( "Text.TextToHTML"; "Hello World¶¶Just a test"; 32 )
Example result:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de">
<head>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />
</head>
<body>
<p>Hello World</p>
<p>
Just a test</p></body>
</html>
See also
Release notes
- Version 13.5
- Added highlight support for Text.TextToHTML function.
- Version 13.1
- Added flag 32 for Text.TextToHTML function to use paragraphs.
- Version 12.2
- Fixed a problem with high unicode character encodings for Text.TextToHTML function.
- Version 12.0
- Added subscript and superscript to Text.TextToHTML function.
- Version 11.2
- Added strikethrough as attribute recognized by Text.TextToHTML function.
- Version 7.4
- Added option in Text.TextToHTML to keep links in html.
Example Databases
Blog Entries
- MBS @ FMTraining.TV - The FileMaker MonkeyBread Plug-in Q&A
- MBS Plugin Advent calendar: 21 - SendMail
- MBS Plugin 13.5 for Claris FileMaker
- MBS FileMaker Plugin, version 13.5pr1
- MBS FileMaker Plugin, version 13.1pr5
- MBS FileMaker Plugin, version 12.2pr5
- MBS FileMaker Plugin 12.0 - More than 6700 Functions In One Plugin
- MBS FileMaker Plugin, version 11.6pr2
- Email Script for FileMaker
- Sending Email with FileMaker via MBS Plugin
FileMaker Magazin
This function checks for a license.
Created 7th September 2014, last changed 27th February 2023