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

fuzzyEmail を無効にする #513

Merged
merged 1 commit into from
Oct 28, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ describe('LinkCard埋め込み要素のテスト', () => {
expect(html).toContain('URLが不正です');
});
});

describe('メールアドレス', () => {
test('メールアドレスのまま出力する', () => {
const html = markdownToHtml(`[email protected]`);
expect(html).toContain('[email protected]');
expect(html).not.toContain('URLが不正です');
});
});
});

describe('embedOriginを設定している場合', () => {
Expand Down
1 change: 1 addition & 0 deletions packages/zenn-markdown-html/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const markdownToHtml = (text: string, options?: MarkdownOptions): string => {
const md = markdownIt({ breaks: true, linkify: true });

md.linkify.set({ fuzzyLink: false });
md.linkify.set({ fuzzyEmail: false }); // refs: https://github.com/markdown-it/linkify-it

md.use(mdBr)
.use(mdKatex)
Expand Down
Loading