wt2html/tt/QuoteTransformer~QuoteTransformer(manager, options)

Show:

new QuoteTransformer(manager, options)

...

Class constructor.

Parameters:
Name Type Description
manager TokenTransformManager
options Object
Source:

Extends

Methods

convertBold(i)

Convert a bold token to italic to balance an uneven number of both bold and italic tags.

Convert a bold token to italic to balance an uneven number of both bold and italic tags. In the process, one quote needs to be converted back to text.

Parameters:
Name Type Description
i int

index into chunks

Source:

convertQuotesToTags()

Convert quote tokens to tags, using the same state machine as the legacy parser uses.

Convert quote tokens to tags, using the same state machine as the legacy parser uses.

Source:

onAny(token)

Handle any other tags.

Handle any other tags.

Parameters:
Name Type Description
token Token
Source:

onEnd(token)

On encountering an EOFTk, process quotes on the current line.

On encountering an EOFTk, process quotes on the current line.

Parameters:
Name Type Description
token Token
Source:

onNewline(token)

On encountering an NlTk, processes quotes on the current line.

On encountering an NlTk, processes quotes on the current line.

Parameters:
Name Type Description
token Token
Source:

onQuote(token)

Handle QUOTE tags.

Handle QUOTE tags. These are collected in italic/bold lists depending on the length of quote string. Actual analysis and conversion to the appropriate tag tokens is deferred until the next quote-scope-ending token triggers processQuotes.

Parameters:
Name Type Description
token Token
Source:

onTag(token)

Handles mw-quote tokens and td/th tokens.

Handles mw-quote tokens and td/th tokens.

Parameters:
Name Type Description
token Token
Source:

processQuotes(token)

Handle quote-scope-ending tokens that trigger the actual quote analysis on the buffered quote tokens so far.

Handle quote-scope-ending tokens that trigger the actual quote analysis on the buffered quote tokens so far.

Parameters:
Name Type Description
token Token
Source:

quoteToTag(chunk, tags, ignoreBogusTwo)

Convert italics/bolds into tags.

Convert italics/bolds into tags.

Parameters:
Name Type Description
chunk int
tags Array
ignoreBogusTwo boolean
Source:

reset()

Reset the buffering of chunks.

Reset the buffering of chunks.

Source:

startNewChunk()

Make a copy of the token context.

Make a copy of the token context.

Source: