Configure the Text Inserters
(tick_24Pro, tick_24Std, tick_24Lite)

Text inserters insert text into documents but can also do others things as well, like execute commands and run tools and applications (see the shellexecute attribute).

Each text inserter can be configured by editing its configuration file.

We recommend that only the User Inserter be edited so that the other inserters, such as the TagCSSJavaScript, and PHP Inserters remain standard. Changes made to the Tag, CSS, JavaScript, or PHP Inserter configuration files may be lost the next time HTML Validator is installed, reinstalled, or updated. Therefore, if you change one of these configuration files then we recommend that you backup these files in case your changes are ever lost. Changes made to the User Inserter configuration file will not be overwritten the next time HTML Validator is installed or reinstalled.

Editing an Inserter Config File

To edit an inserter's configuration file, load the configuration file into HTML Validator's editor (any text editor should work as well). An easy way to do this is to make sure the inserter is visable (View->Toolbars->Inserters) and then choose the Edit Configuration menu option from the inserter whose configuration you want to edit. For example, choose User->Edit Configuration to edit the configuration for the User Inserter. You can now edit the configuration to your liking. Please note the following:

Use the entries already available as examples when adding your own entries. For many examples, view the CSS or HTML Inserter configuration file.

Keep each comment and each tag on a separate line. Do not break a single tag onto more than one line.

Enclose all attribute values in double or single quotes. Use double quotes if the value contains one or more single quotes. Use single quotes if the value contains one or more double quotes.

All tag tags should be contained in a "csetaginserterconfiguration" tag.

"tag" elements define menu items in the inserter. These tags should be empty (void) and end with '/>', not just '>'. They have the following attributes:

menu - What menu the menu item should be placed under; you can create your own menu names

submenu - What submenu the menu item should be placed under; you can create your own submenu names; use "->" to specify multiple submenus like in submenu='SubMenu1->SubMenu2'

flags - One or more of the following (add them together if more than one)

1 - Simulate pressing the 'Enter' key after inserting the text

2 - Never change the case when inserting text

4 - The menu item is a line separator

8 - Selecting the menu item causes the inserter to be closed/hidden

16 - The menu item is a CSS property

32 - Never change the case if an XHTML document

64 - Add a '/' before the '>' character if an XHTML document

128 - Make sure there is a space or newline character before where the text is inserted (good for inserting attributes) (New v10.0036)

256 - Try to change/set the encoding of the document to UTF-8 (New v10.0046)

command

1 - Selecting the menu item causes the inserter's configuration file to be loaded for editing

2 - Selecting the menu item causes the inserter's configuration file to be reloaded so that changes take effect (implies image="3" if the "image" attribute is not used)

caption - The caption that is used for the menu item

hint - The hint that is used when the menu item is highlighted; this text usually appears in the status bar

image - The image that is displayed for the menu item

1 - same as File->Exit

2 - same as File->New from Template

3 - same as File->Reload (New v10.9920)

21 - same as View->Editor

41 - same as Tags-><!-- -->

inserttext - The text that is inserted into the document when the menu item is selected. Note the following:

Use a '|' character to indicate where the cursor should be placed after inserting the text or where the selected text should be placed if the menu item is selected while part of the document is selected

shiftprependtext - The text to prepend to inserttext if the SHIFT key is held down when the menu item is selected; when this attribute is used, "(SHIFT prepends "text")" will be appended to the hint text (New v10.0032)

prependeachline - When text is selected, prepend this text to each non-empty line (each line is trimmed for whitespace) (New v11.9926)

appendeachline - When text is selected, append this text to each non-empty line (each line is trimmed for whitespace) (New v11.9926)

shellexecute - (tick_16Pro, tick_16Std, cross_16Lite) Execute the command, program, or tool with ShellExecute(); see examples below; WARNING: Be careful not to execute any harmful commands. (New v15.00)

shellflags - (tick_16Pro, tick_16Std, cross_16Lite) Optionally specify additional options for shellexecute (New v15.00)

1 - fail if the file from %1 or %2 does not exist (use to prevent executing the shell command with a file that doesn't exist)

shellparams - (tick_16Pro, tick_16Std, cross_16Lite) When using the shellexecute attribute, use this attribute to specify the parameters (New v15.00)

%% - specify a single percent character

%1 - the full path of the current document being edited (could be a URL if the document was opened from the web); don't forget to enclose in double quotation marks if needed

%2 - a full path calculated from the selected text of the current document being edited; don't forget to enclose in double quotation marks if needed

When you are finished editing the configuration file, save it and then choose the Reload Configuration option from the appropriate inserter to update the inserter so that it will use the new configuration file. For example, choose User->Reload Configuration to reload the User Inserter configuration.

For Text that is Inserted into Documents

Note the following for text that is inserted into documents (with the "inserttext", "prependeachline", and "appendeachline" attributes):

\r or &#13; can be used to simulate pressing the 'Enter' key

\b or &#8; can be used to simulate pressing the 'Backspace' key; \b is recommended for better XML compatibility, but only works with v10.9914 and greater

\t or &#9; can be used to simulate pressing the 'Tab' key

&#34; can be used as a double quotation mark

&#39; can be used as a single quotation mark

Use a '|' character to indicate where the cursor should be placed after inserting the text or where the selected text should be placed if the menu item is selected while part of the document is selected

"\\" can be used to insert a single backslash (New v10.9914)

Examples:

Example "tag" elements (taken from the CSS, JavaScript, and Tag Inserter configuration files):

<tag menu='B' flags='96' inserttext='<br>' hint='Forcibly break (end) the current line of text.'/>

<tag menu='F' flags='32' inserttext='<form action="|">&#13;&#13;</form>' hint='Use to contain an interactive form. HTML 4.01 requires "action" attribute.'/>

<tag menu='S' flags='32' inserttext='<strong>|</strong>' hint='Indicate stronger emphasis. Use "em" to indicate weaker emphasis.'/>

<tag menu='F' flags='16' inserttext='font-family: ' hint='CSS1: Declares a specific font, generic font family, or both.'/>

<tag menu='W' shiftprependtext='window' submenu='Window' inserttext='.alert(|)' hint='Displays a plain text (not HTML) message in a dialog box.' flags='2'/>

<tag menu='Sel' flags='32' caption='Create ul list from selection' appendeachline="</li>" prependeachline="<li>" inserttext='<ul>\r\t|\r\b</ul>' hint='Creates a "ul" list from the selected text (each selected line is a list item).'/>

Examples Using the shellexecute Attribute to Run Commands or Tools:

WARNING: Be careful not to execute any harmful commands.

Open the calculator: <tag menu='Shell' caption='Calculator' shellexecute='calc.exe' hint='Open the calculator.'/>

Open the current document in Chrome (using %1): <tag menu='Shell' caption='Open in Chrome' shellexecute='chrome.exe' shellparams='"%1"' hint='Open the current document in Chrome.'/>

Open the current document in Notepad (using %1): <tag menu='Shell' caption='Open in Notepad' shellexecute='notepad.exe' shellparams='"%1"' hint='Open the current document in Notepad.'/>

Open the selected text in Notepad (using %2): <tag menu='Shell' caption='Open Selected in Notepad' shellexecute='notepad.exe' shellparams='"%2"' hint='Open the selected text in Notepad.'/>