Constructors
constructor
- new Transformer(option?: stream.TransformOptions): Transformer
-
Parameters
-
Optional option: stream.TransformOptions
Properties
Protected beforeCloseTags
beforeCloseTags: object
Type declaration
-
[key: string]: function[]
Protected buffer
buffer: string = ""
Protected parser
parser: Parser
Protected tagModifier
tagModifier: object
Methods
Protected _flush
- _flush(callback: function): void
Protected _onCloseTag
- _onCloseTag(name: string): void
Protected _onOpenTag
- _onOpenTag(name: string, attrib: object): void
-
Parameters
-
name: string
-
attrib: object
Returns void
Protected _onProcessCloseTag
- _onProcessCloseTag(name: string): void
Protected _onText
- _onText(text: string): void
Protected _transform
- _transform(chunk: string | Buffer, encoding: string, callback: function): void
-
Parameters
-
chunk: string | Buffer
-
encoding: string
-
callback: function
-
- (error?: Error, data?: string): void
-
Parameters
-
Optional error: Error
-
Optional data: string
Returns void
Returns void
onBeforeClosingTag
- onBeforeClosingTag(tagname: string, transformer: function): this
-
Parameters
-
tagname: string
-
transformer: function
Returns this
onTag
- onTag(tagname: string, attribute: string, pattern: RegExp, transformer: StringTransformer): this
-
Parameters
-
tagname: string
-
attribute: string
-
pattern: RegExp
-
Returns this
Static Protected _transformString
- _transformString(text: string, transforms: Transforms): string
-
Parameters
Returns string
Transform HTML stream