Error getting tags :
error 404Error getting tags :
error 404 HTMLText | revDocs | RunRev
Welcome Guest (Log in)
Product Edition
Version
HTMLText
Basics
Expander triangle
Type
Property
Syntax
set the HTMLText of [chunk of] field to htmlString
Introduced
1.0
Changed
2.0
Environment
Desktop, Web and Server
Platform Support
MacOS,Mac OS X,Windows,Linux
Security
None required
Summary
Specifies the contents of a field, with its text formatting represented as HTML tags and special characters represented as HTML entities.
Examples

set the HTMLText of field "White Paper" to "<b><i>Click here!</i></b>"
set the HTMLText of field "Dest" to the HTMLText of field "Source"
write the HTMLText of field "Story" to file myWebFile

Additional Comments
Expander triangle

Use the HTMLText property to display text from a web page in a field, or copy or export a field's contents with the text formatting intact.

Value:

The HTMLText of a field or chunk is a string.

Comments:

The HTMLText property is a representation of the styled text of the field. Revolution uses a subset of HTML tags that includes font, size, style, and text color information.

Setting the HTMLText of a field (or a chunk of a field) sets both the text contents and the style attributes corresponding to the tags listed below. (Other tags are ignored.)

Getting the HTMLText property reports a string consisting of the text of the field (or chunk of a field), with any font, size, style, or color properties embedded in the text in the form of the tags listed below.

Note: The HTMLText of a field or chunk includes formatting information for the text, but does not include information about the text properties of the field itself. If you use the HTMLTextproperty to transfer text between fields, you must make sure that the destination field'stextFont and other text properties match the settings of the source field, if you want the text in both fields to look identical.

The tags translate as follows:

<p> </p>

Encloses a line of text. (Blank lines are also enclosed in <p> </p>.)

<sub> </sub>

Encloses text whose textShift is a positive integer. (The <sub> tag is not nested for additional levels of subscription: it appears once for a run of subscripted text, regardless of the value of the textShift.)

<sup> </sup>

Encloses text whose textShift is a negative integer. (The <sup> tag is not nested for additional levels of superscription: it appears once for a run of superscripted text, regardless of the value of the textShift.)

<i> </i>

Encloses text whose textStyle is "italic".

<b> </b>

Encloses text whose textStyle is "bold".

<strike> </strike>

Encloses text whose textStyle is "strikeout".

<u> </u>

Encloses text whose textStyle is "underline".

<box> </box>

Encloses text whose textStyle is "box".

<threedbox> </threedbox>

Encloses text whose textStyle is "threeDBox".

<expanded> </expanded>

Encloses text whose textStyle is "expanded".

<condensed> </condensed>

Encloses text whose textStyle is "condensed".

<font> </font>

Encloses text whose textFont, textSize, foregroundColor, or backgroundColor is different from the field's default. These five properties are represented as attributes of the <font> tag.

* face="fontName" appears in the <font> tag if the textFont is not the default.

* size="pointSize" appears if the textSize is not the default.

In standard HTML, the size attribute normally takes a value between 1 and 7, representing a relative text size, with 3 being the normal text size for the web page. To accommodate this convention, when setting the HTMLText of a field, if the pointSize is between 1 and 7, the textSize of the text is set to a standard value:

pointSize textSize

1 8 point

2 10 point

3 12 point

4 14 point

5 17 point

6 20 point

7 25 point

* lang="languageName" appears if the textFont includes a language specification.

* color="colorSpec" appears if the foregroundColor is not the default.

* bgcolor="colorSpec" appears if the backgroundColor is not the default.

When getting the htmlText of a field, a color is represented as an HTML-style color consisting of a hash mark (#) followed by three 2-digit hexadecimal numbers, one for each of red, green, and blue.

<a> </a>

Encloses text whose textStyle is "link" or whose linkText property is not empty. If the textStyle of the text contains "link", the linkText is included as the value of the "href" attribute. Otherwise, it is included as the value of the "name" attribute.

<img src="imageSpecifier">

Replaces a character whose imageSource property is not empty. The value of the imageSource property is included as the value of the "src" attribute.

When you set the HTMLText of a field, all tags other than those above are ignored, except heading tags (<h1>--<h6>), which change the size of the text in the heading element:

tag textSize

<h1> 34 point

<h2> 24 point

<h3> 18 point

<h4> 14 point

<h5> 12 point

<h6> 10 point

You can use Revolution color references for the "color" and "bgcolor" attributes. Revolution translates these into standard HTML-style color specifications.

If a chunk of text includes more than one of the above styles, Revolution encloses the text in the tags corresponding to each style, from the inside out. For example, if the word "Flail" in a field is underlined and bold, its corresponding HTMLText is "<u><b>Flail</b></u>".

Special characters (whose ASCII value is greater than 127) are encoded as HTML entities. Revolution recognizes the following named entities:

Á &Aacute;

Á &aacute;

Acirc;

acirc;

acute;

AElig;

aelig;

Agrave;

agrave;

Aring;

aring;

Atilde;

atilde;

Auml;

auml;

brvbar;

Ccedil;

ccedil;

cedil;

cent;

copy;

curren;

° deg;

divide;

é Eacute;

é eacute;

Ecirc;

ecirc;

Egrave;

egrave;

ETH;

eth;

Euml;

euml;

frac12;

frac14;

frac34;

gt;

Iacute;

iacute;

Icirc;

icirc;

iexcl;

Igrave;

igrave;

iquest;

Iuml;

iuml;

laquo;

lt;

macr;

micro;

middot;

nbsp;

not;

Ntilde;

ntilde;

Oacute;

oacute;

Ocirc;

ocirc;

Ograve;

ograve;

ordf;

ordm;

Oslash;

oslash;

Otilde;

otilde;

Ouml;

ouml;

para;

plusmn;

pound;

raquo;

reg;

sect;

shy;

sup1;

sup2;

sup3;

szlig;

THORN;

thorn;

times;

Uacute;

uacute;

Ucirc;

ucirc;

Ugrave;

ugrave;

uml;

Uuml;

uuml;

Yacute;

yacute;

yen;

yuml;

Unicode characters whose numeric value is greater than 255 are encoded as "bignum" entities, with a leading ampersand and trailing semicolon. For example, the Japanese character whose numeric value is 12387 is encoded as "#12387;".

Important! The HTMLTextproperty uses a tag structure that is HTML-like, but is not completely standard HTML, in order to accommodate the full range of text styling available in Revolution. Specifically:

* The link, box, threedbox, expanded, and condensed tags, as well as the bgColor attribute of the font tag, have been added to accommodate styles that don't exist in standard HTML.

* The size attribute of the font tag can encode the font's point size, in addition to the standard 7 HTML sizes.

* The HTMLText reports entities whose ASCII value is between 129 and 159. These correspond to characters in the Windows character set (code page 1252) that are not legal HTML entities.

Changes to Revolution:

The lang attribute, and the ability to encode Unicode characters, was added in version 2.0.

The use of the a tag to enclose text whose textStyle property is "link" was introduced in version 1.1.1. In previous versions, link and /link enclosed text whose textStyle was "link" and whose linkText property was empty.

In versions before 1.1, tags were capitalized. (Tags are not case-sensitive, so when you set the HTMLText property, you can use either uppercase or lowercase.)

The a tag was introduced in version 1.1. In previous versions, the GROUP tag was used instead.

In version 1.1, the behavior of the p tag changed. In previous versions, the P tag was interpreted as a line-break character. In version 1.1, p and /p enclose each line.

The translation between the linkText property and the a tag, and between the imageSource property and the img tag, was introduced in version 1.1. In previous versions, these two properties were not available in the HTMLText.

User Comments
Expander triangle
User thumbnail
Peter Brigham
StarStarStarStarStar
Mar 7, 2010
The table of recognized HTML entities is missing the ampersand in front of most entries, and the character as it appears when displayed is not present. For a corrected table, you can use the table below: Note that the appearance of the character will not be accurate (at least on a Mac) depending on the font used in the field, but the encoding is accurate.
ch nbr HTML  3 &brvbar;  4 &shy;  5 &sup2;  6 &sup3;  7 &sup1; 11 &frac14; 12 &frac12;  14 &frac34;  15 &ETH;  16 &times;  17 &Yacute;  18 &THORN;  19 &eth;  20 &yacute;  21 &thorn; < 60 &lt; > 62 &gt; 128 &Auml; 129 &Aring; 130 &Ccedil; 131 &Eacute; 132 &Ntilde; 133 &Ouml; 134 &Uuml; 135 &aacute; 136 &agrave; 137 &acirc; 138 &auml; 139 &atilde; 140 &aring; 141 &ccedil; 142 &eacute; 143 &egrave; 144 &ecirc; 145 &euml; 146 &iacute; 147 &igrave; 148 &icirc; 149 &iuml; 150 &ntilde; 151 &oacute; 152 &ograve; 153 &ocirc; 154 &ouml; 155 &otilde; 156 &uacute; 157 &ugrave; 158 &ucirc; 159 &uuml; 161 &deg; 162 &cent; 163 &pound; 164 &sect; 166 &para; 167 &szlig; 168 &reg; 169 &copy; 171 &acute; 172 &uml; 174 &AElig; 175 &Oslash; 177 &plusmn; 180 &yen; 181 &micro; 187 &ordf; 188 &ordm; 190 &aelig; 191 &oslash; 192 &iquest; 193 &iexcl; 194 &not; 199 &laquo; 200 &raquo; 202 &nbsp; 203 &Agrave; 204 &Atilde; 205 &Otilde; 214 &divide; 216 &yuml; 219 &curren; 225 &middot; 229 &Acirc; 230 &Ecirc; 231 &Aacute; 232 &Euml; 233 &Egrave; 234 &Iacute; 235 &Icirc; 236 &Iuml; 237 &Igrave; 238 &Oacute; 239 &Ocirc; 241 &Ograve; 242 &Uacute; 243 &Ucirc; 244 &Ugrave; 248 &macr; 252 &cedil;
User thumbnail
Peter Brigham
StarStarStarStarStar
Mar 7, 2010
The list of recognized HTML entities above is missing the ampersand in front of most entries. For a corrected table, see below.
ch nbr HTML  3 &brvbar;  4 &shy;  5 &sup2;  6 &sup3;  7 &sup1; 11 &frac14; 12 &frac12;  14 &frac34;  15 &ETH;  16 &times;  17 &Yacute;  18 &THORN;  19 &eth;  20 &yacute;  21 &thorn; < 60 &lt; > 62 &gt; 128 &Auml; 129 &Aring; 130 &Ccedil; 131 &Eacute; 132 &Ntilde; 133 &Ouml; 134 &Uuml; 135 &aacute; 136 &agrave; 137 &acirc; 138 &auml; 139 &atilde; 140 &aring; 141 &ccedil; 142 &eacute; 143 &egrave; 144 &ecirc; 145 &euml; 146 &iacute; 147 &igrave; 148 &icirc; 149 &iuml; 150 &ntilde; 151 &oacute; 152 &ograve; 153 &ocirc; 154 &ouml; 155 &otilde; 156 &uacute; 157 &ugrave; 158 &ucirc; 159 &uuml; 161 &deg; 162 &cent; 163 &pound; 164 &sect; 166 &para; 167 &szlig; 168 &reg; 169 &copy; 171 &acute; 172 &uml; 174 &AElig; 175 &Oslash; 177 &plusmn; 180 &yen; 181 &micro; 187 &ordf; 188 &ordm; 190 &aelig; 191 &oslash; 192 &iquest; 193 &iexcl; 194 &not; 199 &laquo; 200 &raquo; 202 &nbsp; 203 &Agrave; 204 &Atilde; 205 &Otilde; 214 &divide; 216 &yuml; 219 &curren; 225 &middot; 229 &Acirc; 230 &Ecirc; 231 &Aacute; 232 &Euml; 233 &Egrave; 234 &Iacute; 235 &Icirc; 236 &Iuml; 237 &Igrave; 238 &Oacute; 239 &Ocirc; 241 &Ograve; 242 &Uacute; 243 &Ucirc; 244 &Ugrave; 248 &macr; 252 &cedil;