3 module.exports = label;
5 /* Stringify a reference label.
6 * Because link references are easily, mistakingly,
7 * created (for example, `[foo]`), reference nodes have
8 * an extra property depicting how it looked in the
9 * original document, so stringification can cause minimal
11 function label(node) {
12 var type = node.referenceType;
13 var value = type === 'full' ? node.identifier : '';
15 return type === 'shortcut' ? value : '[' + value + ']';