Render journal field entries as HTML
Journal fields can render text enclosed within code tags as HTML.
Before you begin
- Role required: any role that grants write access to a journal field
System property: the glide.ui.security.allow_codetag is set to the default value of true
Note:
To learn more about this property, see Allow JavaScript tags in embedded HTML (instance security hardening) in Instance Security Hardening Settings.
About this task
By default, a High Security Setting escapes any HTML code you type in a journal field by replacing it with its equivalent HTML entity value. Escaping causes the system to display HTML code as text rather than forwarding it to the browser as rendering instructions.
Procedure
Enter
[code][/code]tags around any code you want to render as HTML.Note: A single journal entry can contain multiple code tags as long as each code tag has a beginning and ending tag.
For example, enter these lines:
| Code entered | Result |
|---|---|
| `[code]ServiceNow[/code]` | The system renders a hyperlink to the ServiceNow web site. |
| `[code]This text will be bold. [/code]` | The system renders the sentence in bold. |
| `This text will not be bold.` | The system escapes the bold tags and renders them as text. |
| `[code][/code]` | The system escapes the content of the script tag.Note: By default, the HTML Sanitizer prevents the entry of <script> elements. |
For more examples of HTML formatting options, see the blog post [Formatting within Journal fields using HTML & \[code\]](https://community.servicenow.com/community?id=community_blog&sys_id=4d9ceae1dbd0dbc01dcaf3231f9619e1) by a ServiceNow Technical Support Engineer in the ServiceNow Community.
Click Post.
Note: You cannot edit previous journal entries.
Result
The system renders the text within code tags as HTML.
Related topics
[bundle-psec.r_GeneralSecuritySettings]