MCPcopy Create free account
hub / github.com/witheve/Eve / parseAutolink

Function parseAutolink

src/commonmark.js:1245–1268  ·  view source on GitHub ↗
(block)

Source from the content-addressed store, hash-verified

1243
1244// Attempt to parse an autolink (URL or email in pointy brackets).
1245var parseAutolink = function(block) {
1246 var m;
1247 var dest;
1248 var node;
1249 if ((m = this.match(reEmailAutolink))) {
1250 dest = m.slice(1, m.length - 1);
1251 node = new Node('link');
1252 node._destination = normalizeURI('mailto:' + dest);
1253 node._title = '';
1254 node.appendChild(text(dest));
1255 block.appendChild(node);
1256 return true;
1257 } else if ((m = this.match(reAutolink))) {
1258 dest = m.slice(1, m.length - 1);
1259 node = new Node('link');
1260 node._destination = normalizeURI(dest);
1261 node._title = '';
1262 node.appendChild(text(dest));
1263 block.appendChild(node);
1264 return true;
1265 } else {
1266 return false;
1267 }
1268};
1269
1270// Attempt to parse a raw HTML tag.
1271var parseHtmlTag = function(block) {

Callers

nothing calls this directly

Calls 3

normalizeURIFunction · 0.85
textFunction · 0.85
matchMethod · 0.80

Tested by

no test coverage detected