|
|
@ -3,8 +3,6 @@ |
|
|
|
'use strict'; |
|
|
|
|
|
|
|
|
|
|
|
var skipSpaces = require('../helpers').skipSpaces; |
|
|
|
|
|
|
|
//
|
|
|
|
// Parse link label
|
|
|
|
//
|
|
|
@ -202,7 +200,11 @@ function links(state) { |
|
|
|
// [link]( <href> "title" )
|
|
|
|
// ^^ skipping these spaces
|
|
|
|
pos++; |
|
|
|
if ((pos = skipSpaces(state, pos)) >= max) { return false; } |
|
|
|
for (; pos < max; pos++) { |
|
|
|
code = state.src.charCodeAt(pos); |
|
|
|
if (code !== 0x20 && code !== 0x0A) { break; } |
|
|
|
} |
|
|
|
if (pos >= max) { return false; } |
|
|
|
|
|
|
|
// [link]( <href> "title" )
|
|
|
|
// ^^^^^^ parsing link destination
|
|
|
@ -217,7 +219,10 @@ function links(state) { |
|
|
|
// [link]( <href> "title" )
|
|
|
|
// ^^ skipping these spaces
|
|
|
|
start = pos; |
|
|
|
pos = skipSpaces(state, pos); |
|
|
|
for (; pos < max; pos++) { |
|
|
|
code = state.src.charCodeAt(pos); |
|
|
|
if (code !== 0x20 && code !== 0x0A) { break; } |
|
|
|
} |
|
|
|
|
|
|
|
// [link]( <href> "title" )
|
|
|
|
// ^^^^^^^ parsing link title
|
|
|
@ -226,7 +231,10 @@ function links(state) { |
|
|
|
|
|
|
|
// [link]( <href> "title" )
|
|
|
|
// ^^ skipping these spaces
|
|
|
|
pos = skipSpaces(state, pos); |
|
|
|
for (; pos < max; pos++) { |
|
|
|
code = state.src.charCodeAt(pos); |
|
|
|
if (code !== 0x20 && code !== 0x0A) { break; } |
|
|
|
} |
|
|
|
} else { |
|
|
|
title = ''; |
|
|
|
} |
|
|
|