Module: jsdoc/tag/inline

Methods

(static) extractInlineTag(string, tagnullable) → {module:jsdoc/tag/inline.InlineTagResult}

Extract inline tags from a string, replacing them with an empty string.
Parameters:
Name Type Attributes Description
string string The string from which to extract text.
tag string <nullable>
The inline tag to extract.
Source:
Returns:
The updated string, as well as information about the inline tags that were found.
Type
module:jsdoc/tag/inline.InlineTagResult

(static) isInlineTag(string, tagNamenullable) → {boolean}

Check whether a string is an inline tag. You can check for a specific inline tag or for any valid inline tag.
Parameters:
Name Type Attributes Description
string string The string to check.
tagName string <nullable>
The inline tag to match. May contain regexp characters. If this parameter is omitted, this method returns `true` for any valid inline tag.
Source:
Returns:
Set to `true` if the string is a valid inline tag or `false` in all other cases.
Type
boolean

(static) replaceInlineTag(string, tag, replacer) → {module:jsdoc/tag/inline.InlineTagResult}

Replace all instances of an inline tag with other text.
Parameters:
Name Type Description
string string The string in which to replace the inline tag.
tag string The name of the inline tag to replace.
replacer module:jsdoc/tag/inline.InlineTagReplacer The function that is used to replace text in the string.
Source:
Returns:
The updated string, as well as information about the inline tags that were found.
Type
module:jsdoc/tag/inline.InlineTagResult

(static) replaceInlineTags(string, replacers) → {module:jsdoc/tag/inline.InlineTagResult}

Replace all instances of multiple inline tags with other text.
Parameters:
Name Type Description
string string The string in which to replace the inline tags.
replacers Object The functions that are used to replace text in the string. The keys must contain tag names (for example, `link`), and the values must contain functions with the type module:jsdoc/tag/inline.InlineTagReplacer.
Source:
Returns:
The updated string, as well as information about the inline tags that were found.
Type
module:jsdoc/tag/inline.InlineTagResult

Type Definitions

InlineTagInfo

Information about an inline tag that was found within a string.
Type:
  • Object
Properties:
Name Type Attributes Description
completeTag string <nullable>
The entire inline tag, including its enclosing braces.
tag string <nullable>
The tag whose text was found.
text string <nullable>
The tag text that was found.
Source:

InlineTagReplacer(string, tagInfo) → {string}

Text-replacing function for strings that contain an inline tag.
Parameters:
Name Type Description
string string The complete string containing the inline tag.
tagInfo module:jsdoc/tag/inline.InlineTagInfo Information about the inline tag.
Source:
Returns:
An updated version of the complete string.
Type
string

InlineTagResult

Information about the results of replacing inline tags within a string.
Type:
  • Object
Properties:
Name Type Description
tags Array.<module:jsdoc/tag/inline.InlineTagInfo> The inline tags that were found.
newString string The updated text string after extracting or replacing the inline tags.
Source: