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