HTML syntax editor
Summarize
Summary of HTML syntax editor
The HTML syntax editor in ServiceNow supports editing HTML and Jelly scripts, which define the content rendered on pages. It allows you to work with both static XHTML and dynamically generated Jelly content, and can call script includes and UI Macros. This editor enhances productivity by providing syntax coloring, indentation, line numbers, and automatic closure of braces and quotes.
Show less
Key Features
- Syntax Support: Supports both HTML and Jelly scripting with syntax highlighting and indentation for easier coding.
- Auto-suggestions: Provides suggestions for HTML and Jelly tags to speed up coding.
- Script Macros: Includes macros for common code shortcuts to simplify repetitive tasks.
- Toggle Syntax Editor: Enables or disables the syntax editor view as needed.
- Search and Replace: Offers powerful search capabilities, including support for regular expressions, with options to replace single or all occurrences.
- Commenting: Easily comment or uncomment selected code with keyboard shortcuts.
- Full Screen Mode: Expands the editor to full screen for more comfortable editing (not available in Internet Explorer).
- Keyboard Shortcuts: Numerous shortcuts are available for efficient editing, searching, commenting, replacing, toggling views, and accessing help.
Editing Tips
- Use the Tab key to insert fixed spaces or indent code lines or blocks.
- Press Shift+Tab to decrease indentation or remove tabs from the start of lines.
- Click in the leading whitespace of a line to indent that line easily.
Practical Benefits for ServiceNow Customers
This editor enhances your ability to efficiently create and maintain HTML and Jelly scripts within the ServiceNow platform, improving code readability and reducing errors. The built-in shortcuts and advanced editing features streamline workflow, enabling faster development and easier maintenance of UI components and dynamic content.
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.