utils

package
v0.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package utils provides utility functions including HTML sanitization.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterUnicode

func FilterUnicode(input string) string

This ensures OTRS compatibility when Unicode support is disabled.

func IsHTML

func IsHTML(content string) bool

IsHTML checks if the content appears to be HTML.

func IsMarkdown

func IsMarkdown(content string) bool

IsMarkdown checks if the content appears to be markdown (common patterns from Tiptap conversion).

func MarkdownToHTML

func MarkdownToHTML(markdown string) string

MarkdownToHTML converts markdown content to HTML.

func StripHTML

func StripHTML(html string) string

StripHTML removes all HTML tags and returns plain text.

Types

type HTMLSanitizer

type HTMLSanitizer struct {
	// contains filtered or unexported fields
}

HTMLSanitizer provides HTML sanitization for user input.

func NewHTMLSanitizer

func NewHTMLSanitizer() *HTMLSanitizer

NewHTMLSanitizer creates a new HTML sanitizer with GoatFlow-specific policy.

func (*HTMLSanitizer) Sanitize

func (s *HTMLSanitizer) Sanitize(html string) string

Sanitize cleans HTML content to prevent XSS attacks.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL