HTML syntax editor
Summarize
Summary of HTML syntax editor
The HTML syntax editor in ServiceNow supports editing both HTML and Jelly scripts, enabling you to define the content rendered on pages. It accommodates static XHTML or dynamic Jelly content and integrates with script includes and UI Macros.
Show less
Key Features
- Syntax support: Provides syntax coloring, indentation, line numbering, and automatic closing of braces and quotes for HTML and Jelly scripts.
- Auto-suggestions: Offers tag suggestions for HTML and Jelly to speed up coding.
- Script macros: Contains shortcuts for commonly used code snippets.
- Toggle editor: Ability to disable or enable the syntax editor interface.
- Search and replace: Supports advanced search, find next/previous occurrences, and replace functions including regular expressions.
- Commenting: Quickly comment or uncomment selected code.
- Full screen editing: Expands the editor to full screen for easier editing (except in Internet Explorer).
- Keyboard shortcuts: Includes numerous shortcuts for efficient editing, accessible via a help screen.
Practical Editing Tips
- Use Tab to insert fixed spaces or indent lines.
- Select multiple lines and press Tab to indent all at once; use Shift+Tab to decrease indentation.
- Click in the leading whitespace of a line and press Tab or Shift+Tab to adjust indentation precisely.
Benefits for ServiceNow Customers
This editor enhances your ability to create and maintain dynamic and static web content within ServiceNow with improved readability, error reduction, and faster code writing. The built-in search, replace, and commenting features streamline script management, while full-screen mode and keyboard shortcuts optimize your editing workflow.
The HTML syntax editor provides support for editing HTML and Jelly scripts and defines what's rendered when the page is displayed. The HTML syntax editor can contain either static XHTML or dynamically generated content defined as Jelly, and can call script includes and UI Macros.
- HTML and Jelly script support
- HTML and Jelly syntax coloring, indentation, line numbers, and automatic creation of closing braces and quotes
- Auto-suggestions for HTML and Jelly tags
- Script macros for common code shortcuts
| Icon | Keyboard shortcut | Name | Description |
|---|---|---|---|
| N/A | Toggle syntax editor | Disables the syntax editor. Click the Toggle syntax editor icon ( |
|
| Cmd+/ | Toggle comment | Comments the selected code. | |
| Cmd+E | Replace | Replaces the next occurrence of a text string in the script field.
|
|
| Cmd | Replace All | Replaces all occurrences of a text string in the script field.
|
|
| Cmd+F | Start Searching | Highlights all occurrences of a search term in the script field and locates the
first occurrence. Click the Start searching icon ( |
|
| Cmd+G | Find Next | Locates the next occurrence of the current search term in the script field.
Click the Start searching icon ( |
|
| Cmd+Shift+G | Find Previous | Locates the previous occurrence of the current search term in the script field.
Click the Start searching icon ( |
|
| Ctrl+M | Toggle Full Screen | Expands the script field to use the full form view for easier editing. Click
the Toggle full screen icon ( |
|
| Cmd+H | Help | Displays the keyboard shortcuts help screen. | |
| N/A | Save | Saves changes without leaving the current view. Click the Save icon ( |
Editing tips
- To insert a fixed space anywhere in your code, press Tab.
- To indent a single line of code, click in the leading white space of the line and then press Tab.
- To indent one or more lines of code, select the code and then press Tab. To decrease the indentation, press Shift+Tab.
- To remove one tab from the start of a line of code, click in the line and press Shift+Tab.