.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / remark-stringify / lib / visitors / definition.js
1 'use strict';
2
3 var uri = require('../util/enclose-uri');
4 var title = require('../util/enclose-title');
5
6 module.exports = definition;
7
8 /* Stringify an URL definition.
9  *
10  * Is smart about enclosing `url` (see `encloseURI()`) and
11  * `title` (see `encloseTitle()`).
12  *
13  *    [foo]: <foo at bar dot com> 'An "example" e-mail'
14  */
15 function definition(node) {
16   var content = uri(node.url);
17
18   if (node.title) {
19     content += ' ' + title(node.title);
20   }
21
22   return '[' + node.identifier + ']: ' + content;
23 }