struct

Ktistec::SafeHTML

Inherits Struct < Value < Object

A String wrapper marking HTML markup safe to emit raw into HTML data slots (text content, between tags). Not admissible into attribute slots — SafeAttrValue covers that.

Constructors

assert_safe(string : String) : SafeHTML

Asserts the input is already safe HTML markup.

Source
escape(string : String | Nil) : SafeHTML

HTML-escapes the input.

Source
sanitize(content : String | Nil) : SafeHTML

Sanitizes the input.

Source

Instance methods

==(other : SafeHTML) : Bool
Source
==(other : String) : Bool
Source
=~(other : Regex)
Source
empty?(*args, **options)
Source
empty?(*args, **options, &)
Source
includes?(*args, **options)
Source
includes?(*args, **options, &)
Source
presence

Returns self if the wrapped value has presence, otherwise nil.

Source
size(*args, **options)
Source
size(*args, **options, &)
Source
to_json(*args, **options)
Source
to_json(*args, **options, &)
Source
to_s(*args, **options)
Source
to_s(*args, **options, &)
Source