planning
All checks were successful
Publish To Prod / deploy_and_publish (push) Successful in 35s

This commit is contained in:
2024-10-14 09:15:30 +02:00
parent bcba00a730
commit 6e64e138e2
21059 changed files with 2317811 additions and 1 deletions

View File

@@ -0,0 +1,36 @@
'use strict'
var uri = require('../util/enclose-uri')
var title = require('../util/enclose-title')
module.exports = definition
var space = ' '
var colon = ':'
var leftSquareBracket = '['
var rightSquareBracket = ']'
// Stringify an URL definition.
//
// Is smart about enclosing `url` (see `encloseURI()`) and `title` (see
// `encloseTitle()`).
//
// ```markdown
// [foo]: <foo at bar dot com> 'An "example" e-mail'
// ```
function definition(node) {
var content = uri(node.url)
if (node.title) {
content += space + title(node.title)
}
return (
leftSquareBracket +
(node.label || node.identifier) +
rightSquareBracket +
colon +
space +
content
)
}