Questions about Rich Text


#1

If I want to (for example) bold some text, using the “< b >” tag, is it vital to supply the corresponding closing tag “< /b >” if there is no more text following? It appears to be OK without the closing tag, but I don’t know what kind of effect it might have under the hood. (Note that I have added spaces inside my example tags, if I don’t they get interpreted as tags in my post and consequently it makes no sense. Unfortunately, this technique doesn’t help the situation of my next question).

I wanted to include the character “<” in some text that is enabled for rich text, but it gets interpreted as part of a tag and doesn’t show. Is there a way to “escape” it so it is treated as literal text? I am trying to use it in a button Title.


#2

With regard to your desire to use the Bold tag, I would imagine you might not want to use that at all, regardless. See https://www.w3schools.com/tags/tag_b.asp

Take out the spaces here:
& # 60;
& # 62;


#3

I’m not producing a web page, I’m trying to display some text in a Pan X object, following the Pan X instructions. I kinda doubt Jim is going to change these rules just to “keep up” with the HTML standards. The same question about the necessity for closing tags applies regardless.

Likewise, I can’t get the &# stuff to do anything but print themselves literally. I thought of chr(60) in many different forms, but same result. If you can expand this into the text I would use in a button title to make the “<” character appear (along with other text) then we have it.


#4

Quoting from the Rich Text page in the Help file:

If you prefix the value with x or 0x, the number will be interpreted as a hexadecimal 
value. This example also displays the < character.

"Here is another way to insert the <char:x3C> character."

#5

Well, I thought I had read all the relevant parts of that page, but there it is! My we have a lot of different approaches to dealing with characters, this one wants hex. This works great, thank you. What can you tell me about the importance of using closing tags when there is no more text that follows?


#6

My hazy memory vaguely recalls Jim noting in one of the classes that a closing tag is not absolutely necessary if there are no other tags following. I personally always include the closing tag as a mater of habit.


#7

First of all, you can include < characters in a post here, as you can see I just did. To do so, surround it with backtick characters (the key to the left of the 1 key). So if you write this in the forum editor:

`<b>`

it will display as

<b>

Secondly, there’s no big problem if your text has a <b> tag but no </b> tag.

As for inserting the < character into rich text, you can do it as Gary mentioned, but there is also a function to help you with that, the richtextdata( function.

For example, suppose you want to format an address label so that the name is bold and the zip code is italic. You could do it with a formula like this:

"<b>"+First+" "+Last+"</b>"+cr()+Company+cr()+Address+cr()+City+", "+State+" <i>"+Zip+"</i>"

It would be unusual, but what if a Company name had a < character in it? That would mess up your rich text. You can use the richtextdata( function to fix this up.

"<b>"+First+" "+Last+"</b>"+cr()+richtextdata(Company)+cr()+Address+cr()+City+", "+State+" <i>"+Zip+"</i>"

When inserting a field or variable into rich text, you should always use the richtextdata( function if there is a chance that the contents of the field or variable might contain a < character. The exception would be if the contents already contained rich text tags, or some other special circumstance (you know who you are).

As to Robert’s point, Panorama’s RTML is a style markup language, not a semantic language. You could use the style tags to create a semantic language if you want, but in general, if you want bold, use the <b> tag.