Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a autolink field #3439

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@
"test:specs": "node --test --test-reporter=spec test/run-spec-tests.js",
"test:types": "tsc --project tsconfig-type-test.json && attw -P --exclude-entrypoints ./bin/marked ./marked.min.js",
"test:umd": "node test/umd-test.js",
"test:unit:only": "node --test --test-only --test-reporter=spec test/unit/*.test.js",
"test:unit": "node --test --test-reporter=spec test/unit/*.test.js",
"test:unit:only": "node --test --test-only --test-reporter=spec test/unit",
"test:unit": "node --test --test-reporter=spec test/unit",
"test:update": "node test/update-specs.js"
},
"engines": {
Expand Down
1 change: 1 addition & 0 deletions src/Tokenizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,7 @@ export class _Tokenizer {
raw: cap[0],
text,
href,
autolink: true,
tokens: [
{
type: 'text',
Expand Down
1 change: 1 addition & 0 deletions src/Tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ export namespace Tokens {
raw: string;
href: string;
title?: string | null;
autolink?: boolean;
text: string;
tokens: Token[];
}
Expand Down
2 changes: 2 additions & 0 deletions test/unit/Lexer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1561,6 +1561,7 @@ paragraph
raw: '<https://example.com>',
text: 'https://example.com',
href: 'https://example.com',
autolink: true,
tokens: [
{ type: 'text', raw: 'https://example.com', text: 'https://example.com' },
],
Expand All @@ -1579,6 +1580,7 @@ paragraph
raw: '<[email protected]>',
text: '[email protected]',
href: 'mailto:[email protected]',
autolink: true,
tokens: [
{ type: 'text', raw: '[email protected]', text: '[email protected]' },
],
Expand Down
Loading