Browse Source

Fix meta information for autolink tokens

pull/175/head
Alex Kocharin 9 years ago
parent
commit
b2883a7fd2
  1. 6
      CHANGELOG.md
  2. 4
      lib/rules_inline/autolink.js

6
CHANGELOG.md

@ -1,3 +1,9 @@
5.0.2 / WIP
------------------
- Fix meta information (`token.markup` and `token.info`) for autolink tokens.
5.0.1 / 2015-10-30
------------------

4
lib/rules_inline/autolink.js

@ -32,11 +32,15 @@ module.exports = function autolink(state, silent) {
if (!silent) {
token = state.push('link_open', 'a', 1);
token.attrs = [ [ 'href', fullUrl ] ];
token.markup = 'autolink';
token.info = 'auto';
token = state.push('text', '', 0);
token.content = state.md.normalizeLinkText(url);
token = state.push('link_close', 'a', -1);
token.markup = 'autolink';
token.info = 'auto';
}
state.pos += linkMatch[0].length;

Loading…
Cancel
Save