# Markup Editor

The markup editor is used in the Edit Snippet dialogue box to enter text that can optionally be formatted. It is used to enter and edit snippet descriptions and extra information.

The editor has two modes of operation: Plain Text and Markup. The modes are selected by using the buttons below the edit control. Each mode causes the text entered in the edit control to be interpreted in a different way, as explained below.

Switching between the modes of operation does not change the text: it is simply interpreted differently. However, you can convert text between the two types as is explained in the Conversions section.

## Plain text

Selecting the Plain Text button causes the text entered in the edit control to be interpreted as plain text.

All characters you enter are treated literally. You cannot format the text, other than to separate it into paragraphs. Any URLs you enter are treated as plain text and are not interpreted as hyperlinks.

You enter multiple paragraphs of text by separating each paragraph with a blank line. Any text on consecutive lines is treated as a single line. For example:

Lorem ipsum dolor sit amet
consectetur adipiscing elit.

is interpreted as:

Lorem ipsum dolor sit amet consectetur adipiscing elit.

but

Lorem ipsum dolor sit amet
consectetur adipiscing elit.

yields:

Lorem ipsum dolor sit amet

consectetur adipiscing elit.

Visual feedback that you are editing plain text comes from the fact the text is displayed in the default proportional font.

## Markup

Choosing the Markup tab causes the entered text to be interpreted as CodeSnip's own markup language, which is a very simple, HTML-like, language that allows for a limited amount of text formatting and for the inclusion of hyperlinks. For full details see the REML help topic.

A fixed width font is used to indicate you are editing REML source code instead of plain text.

## Conversions

Normally, if you switch between Plain Text and Markup modes, the text in the edit control does not change. However you can convert plain text into the equivalent REML markup and vice versa. This is done from the markup editor's pop-up context menu.

There are two menu options:

- Convert To Plain Text

  This option is only available when the editor is in Markup mode. It replaces the REML markup in the edit control with the plain text equivalent.

  All in-line styling and hyperlinks are lost. Paragraphs and headings are converted to plain text paragraphs, separated by blank lines.

  The editor is switched into Plain Text mode.

  If there is an error in the markup an error message will be displayed, no conversion will take place and the mode will not be changed.

- Convert To Markup

  This option is only available when the editor is in Plain Text mode. It replaces the text entered in the edit control with the equivalent REML code.

  Illegal REML characters are converted to character attributes. Paragraphs (i.e. blocks of text separated by blanks lines) are converted to REML paragraphs using the `<p>` tag.

  The editor is switched into Markup mode.