SectionSource

SectionSource

Class that keeps the methods and data related to a section's source code. Also used for section source match candidates before a single match is chosen among them.

Constructor

new SectionSource(options)

Source:

Create a section's source object.

Parameters:
Name Type Description
options object
Properties
Name Type Description
section Section
sectionHeadingMatch Array.<string>
contextCode string
adjustedContextCode string
isInSectionContext boolean

Methods

extractLastCommentIndentation(commentForm) → (nullable) {string}

Source:

For internal use. Extract the section's last comment's indentation characters if needed or a vote / bulleted reply placeholder.

Parameters:
Name Type Description
commentForm CommentForm
Returns:
Type
string

modifyContext(options) → {object}

Source:

Modify a whole section or page code string related to the section in accordance with an action.

Parameters:
Name Type Description
options object
Properties
Name Type Description
action 'replyInSection' | 'addSubsection'
commentCode string

Comment code, including trailing newlines and the signature.

Returns:
Type
object