
Internal Support Notes: Keep Staff Context Separate from Customer Replies
Design support note visibility across composers, attachments, integrations, search, and AI assistance so internal context stays with its intended audience.
Custom Portals
Build portal rich-text notes with a limited formatting model, maintained sanitization, safe rendering on every surface, and clear handling of pasted or AI-generated content.

LET’S BUILD SOMETHING USEFUL
Talk to Ataraxy Developers about your website, app, or custom software.
A client pastes a project note from a document editor into a portal. The visible result contains headings, bullets, and a link, but the pasted content may also carry complex markup, styling, and attributes the portal never intended to support. If the application stores and renders that content without a clear policy, a convenient editor can become a source of broken layouts and security defects.
Rich text needs a defined content model and a consistent rendering boundary. The same note may later appear in a detail page, search result, notification email, PDF, or administrator view. Reviewing only the editor preview leaves the other display surfaces exposed to content they may handle differently.
List the supported elements in business terms: paragraphs, a small heading hierarchy, ordered and unordered lists, emphasis, and links. Decide whether tables, images, embedded media, arbitrary colors, and pasted styles are necessary. Every additional feature adds rendering and review work, so begin with what helps people communicate the task clearly.
For a project note, headings and lists may be enough to describe requirements. An unrestricted page layout editor is probably unnecessary. Define maximum content size and reasonable nesting limits as part of the model. A note with deeply nested lists or enormous pasted tables can be difficult to render and edit even without malicious content.
The toolbar limits what the normal editor creates, but requests can arrive without using that toolbar. Imports, API clients, browser modifications, and older application versions can submit different content. Apply the accepted content policy at the server boundary and verify the stored representation before rendering it in a context that interprets markup.
The OWASP XSS prevention guidance distinguishes output encoding from HTML sanitization. Plain text can be encoded for its output context; intentionally supported HTML requires a suitable sanitization approach. Avoid attempting to make arbitrary HTML safe with a few string replacements or a hand-written regular expression.
If the editor stores a structured document rather than HTML, validate its schema and render only supported node types and attributes. A JSON format is not automatically safe simply because it is not an HTML string. The renderer can still create unsafe URLs or markup if it trusts every stored field.
Use a maintained sanitizer appropriate to the runtime, configure the allowed features deliberately, and keep its dependencies updated. DOMPurify’s project documentation describes its supported environments and usage considerations for teams using that library. Follow the current guidance for the actual browser or server environment rather than copying an isolated snippet into production.
Be careful about transformations after sanitization. A later plugin that adds markup, rewrites attributes, or interprets special placeholders can reintroduce unsafe behavior. Review the whole sequence from paste to storage to rendering, and place the safety checks where the final transformation requires them. Sanitizing one intermediate string is not evidence that every later output is safe.
Keep sanitization separate from authorization. A well-sanitized note can still contain private information that the current viewer is not allowed to read. Apply record and tenant permissions before returning the content, including through search, exports, previews, and background notifications.
When unsupported formatting is removed, preserve the useful text and a readable structure where possible. A brief explanation such as “Some formatting was removed” can help people understand the change. Do not display the rejected raw markup in an interpreted preview while explaining why it was rejected.
Test paste from common document editors, email clients, spreadsheets, and plain-text sources. Verify that lists remain lists, line breaks remain readable, and links keep their intended labels. Offer a plain-text paste route if it suits the workflow. Users should not need to edit HTML manually to recover a short project note.
Define which URL schemes are allowed in note links and validate them through the supported sanitizer or renderer configuration. Do not treat a familiar-looking label as proof that its destination is trustworthy. Show enough destination information when a person is about to follow an external link, according to the portal’s interaction design.
Remote images and embeds introduce additional questions: who can fetch them, whether they reveal viewing activity, and whether they can change after the note is approved. If the portal does not need them, exclude them from the content model. If images are required, route them through the established attachment workflow with access checks, supported formats, and useful alternative text.
Build an inventory of where notes appear. A detail page may render supported rich text, while a search result should usually show an appropriate plain-text excerpt. Email and PDF generation have different rendering environments and need explicit conversion rules. Avoid copying a browser-oriented fragment into every destination without checking its behavior there.
For each surface, verify that links, line breaks, and lists remain meaningful and that unsupported content cannot escape its container. Administrative interfaces deserve the same attention as customer pages. Staff viewing a note should not receive a weaker rendering policy simply because they have a privileged account.
Record note revisions so a user can distinguish their original wording from later edits. If content rules change, decide how previously stored notes are displayed and whether they require a controlled migration. Do not silently rewrite an entire library of customer notes without a reviewed plan and a way to explain material changes.
Where raw source material is retained for a justified reason, keep it restricted and separate from normal rendering paths. Never fall back to displaying raw content because sanitization failed. A safe error state with a support reference is preferable to treating an exception as permission to bypass the content policy.
Use a maintained security test corpus and synthetic content for sanitizer tests, plus ordinary business notes for usability checks. Confirm that allowed formatting survives, unsupported elements are removed or rejected predictably, and every display surface applies its intended policy. Repeat relevant tests after editor, sanitizer, or rendering-library upgrades.
Include keyboard operation of the toolbar, focus returning to the editor, undo after paste cleanup, long links on mobile, and text enlargement. AI-generated notes must pass through the same validation and rendering path as human content. Let users review generated claims and edits; an AI source does not make markup safe or business statements accurate.
Safe rich-text notes depend on a limited, useful content model and consistent handling from input to every output. Validate submissions, maintain sanitization, review later transformations, and preserve permission checks and revisions. Test ordinary editing alongside security behavior so the portal supports clear communication without trusting whatever arrives in pasted content.
LET’S BUILD SOMETHING USEFUL
Talk to Ataraxy Developers about your website, app, or custom software.