Module: jsdoc/util/markdown

Provides access to Markdown-related functions.
Author:
Source:

Members

(inner) parserNames :String

Enumeration of Markdown parsers that are available.
Type:
  • String
Properties:
Name Type Description
evilstreak String The "[markdown-js](https://github.com/evilstreak/markdown-js)" (aka "evilstreak") parser.
gfm String The "GitHub-flavored Markdown" parser.
marked String The "[Marked](https://github.com/chjj/marked)" parser.
Source:

Methods

(static) getParser() → {function}

Retrieve a Markdown parsing function based on the value of the `conf.json` file's `env.conf.markdown` property. The parsing function accepts a single parameter containing Markdown source. The function uses the parser specified in `conf.json` to transform the Markdown source to HTML, then returns the HTML as a string.
Source:
Returns:
A function that accepts Markdown source, feeds it to the selected parser, and returns the resulting HTML.
Type
function

(inner) escapeCode(source) → {string}

Escape characters in text within a code block.
Parameters:
Name Type Description
source string The source text to escape.
Source:
Returns:
The escaped source text.
Type
string

(inner) escapeUnderscores(source) → {String}

Escape underscores that occur within {@ ... } in order to protect them from the markdown parser(s).
Parameters:
Name Type Description
source String the source text to sanitize.
Source:
Returns:
`source` where underscores within {@ ... } have been protected with a preceding backslash (i.e. \_) -- the markdown parsers will strip the backslash and protect the underscore.
Type
String

(inner) escapeUrls(source) → {string}

Escape HTTP/HTTPS URLs so that they are not automatically converted to HTML links.
Parameters:
Name Type Description
source string The source text to escape.
Source:
Returns:
The source text with escape characters added to HTTP/HTTPS URLs.
Type
string

(inner) unescapeUrls(source) → {string}

Unescape HTTP/HTTPS URLs after Markdown parsing is complete.
Parameters:
Name Type Description
source string The source text to unescape.
Source:
Returns:
The source text with escape characters removed from HTTP/HTTPS URLs.
Type
string