Application icon

Common Prompt Markup Functionality

The following statements support a simple text markup capability which provides the functionality to display bold and italic text, fixed width or proportional fonts and various colours:

Ask
Debug
Prompt
Prompt for Text

Markup is also available in the Prompt Help Button URL named variable when read by the optional help button on all prompt statements. Markup in Comment, Force Grouped, Tooltip and Version statements will be processed when displaying an action's descriptive text.

Note that the markup parsing only occurs in modes of the above statements that direct text to the Action Pending window. If you put markup commands in a Prompt statement displayed as an Alert you will see the markup commands.

The determination to parse a text string for markup commands only occurs at runtime. You activate the parsing by starting the text string with <m>. Markup commands start with <character> sequences and end with </character> sequences. In all cases character is a single character and is case sensitive. Non terminated commands remain in effect until the end of the text. Invalid markup commands are displayed as part of the text.

The context menu of each of the above statement's text fields have a Prompt Statement Markup submenu. Use of this menu may be easier than remembering the various markup sequences. Further, the menu items may be assigned a keyboard shortcut. When a markup sequence is inserted, a <m> sequence will also be inserted if required. Note that while markup sequences do not have to be terminated, the inserted markup sequences are always terminated to allow for the selection of text which is to be processed. As prompt messages can be constructed via the use of named and track variables which can also contain markup sequences, the following statements will provide the menu as well: Set and Set Named Variable. Additionally the muli line display which can be displayed from an Append and Prepend statement will also display the menu. Note that the initial prompt statement's text must start with a <m> sequence. Extra <m> sequences found in a named or track variable are ignored.

Closing markup commands do not have to be in order. When a closing markup sequence is found it looks for the last open sequence of the specified type and if found all open sequences from that point on will be terminated. If the sequence is not matched, the markup text will be included in the display.

The sequence </> will close all open markup sequences and is always valid.

Note that when displaying markup text the default or supplied colour settings in each of the above statements is ignored. All text is initially displayed as the default text control colour. (Black or white depending on Dark Mode).

Typically the initial display font is proportional but will be fixed width if Settings - Actions - Use monospace font for the Action Pending window is set.

Non terminated commands remain active and are restored when a subsequence command is terminated.

The following commands are available:


Markup
 Command 
Description
sstrong (bold) text
Snon strong (bold) text
iitalic text
Inon italic text
uunderlined text
Unon underlined text
xstrikethrough text
Xnon strikethrough text
fdisplay text in a fixed width font
Fdisplay text in a proportional font
vdisplay text with a subscript font
Vdisplay text with a superscript font
bblue text
Bbrown text
ggreen text
oorange text
ppurple text
rred text
tdisplay text in the default control text colour.
Typically black when not in dark mode and white in dark mode
ydisplay yellow text
LDisplay a link. All text before a semicolon (;) is treated as the link. Text after the semicolon, until the </L> sequence is the text which is displayed for the link. The link is always displayed as underlined blue text. Note that a ; must be present and must precede the </L> sequence or the results are unpredictable. The following forms of the link are parsed.
  1. If the link starts with http:// or https:// it is considered to be a URL
  2. If the link starts with a / and ends with .html, it is considered to be a local file.
  3. If the link starts with ? it is a reference to an action's resource help. The following form is also accepted ?addon#name. addon if present is appended to the primary page name. #name, if present, is treated as a page fragment identifier.
  4. If the link starts with ?? it is a reference to the resource help of a different action. The resource tag of the action follows the ?? sequence. The resource tag of an action on the web resources page is the last path component of its URL as displayed in a browser with .html removed.
  5. The link is considered to be the name of an internal Yate help page.

When inserting a markup command from the context menu, holding down the Option key will supress the insertion of the closing sequence.

In the rare case where you have to escape a valid markup sequence replace the < character with &<. Example &<b> will display as <b>. If you want to display &< specify &&<.

You can assign keyboard shortcuts to the sequences.

Example 1:

<m><s><b>bold and blue</b> only bold</s> normal

displays:

bold and blue only bold normal

Explanation:

Example 2:

<m><r>red <g>green</g> back to red

displays:

red green back to red

Explanation:

Example 3:

<m><s><b>bold and blue</s> normal

displays:

bold and blue normal

Explanation: