RawTextNode class final

The content of a <script> or <style> element. HTML entities mean nothing there, so it is not escaped; instead every </script is written <\/script (</style as <\/style), and in a script every <!-- is written <\!--, so the content cannot end the element early or switch the parser into a state where it misses the end tag. Inside a JavaScript string or a CSS string both spellings mean the same characters.

Inheritance

Constructors

RawTextNode(String text, {required String tag})
text as the content of a tag (script or style) element.
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tag → String
The element the content is written into.
final
text → String
The content.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
render() → String
The node's HTML.
inherited
toResponse(Request request) → Response
The response for request.
inherited
toString() → String
A string representation of this object.
inherited
writeTo(StringSink out) → void
Writes the node's HTML to out.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

guardRawText(String text, {required String tag}) → String
text made safe to write inside a tag element (see RawTextNode).