9e641b72959030204d4105fa68244beacf2f5194
[dotfiles/.git] / enclose-title.js
1 'use strict';
2
3 module.exports = enclose;
4
5 /* There is currently no way to support nested delimiters
6  * across Markdown.pl, CommonMark, and GitHub (RedCarpet).
7  * The following code supports Markdown.pl and GitHub.
8  * CommonMark is not supported when mixing double- and
9  * single quotes inside a title. */
10 function enclose(title) {
11   var delimiter = title.indexOf('"') === -1 ? '"' : '\'';
12   return delimiter + title + delimiter;
13 }