Skip to content

Commit

Permalink
add: fuzzyEmail を無効にする
Browse files Browse the repository at this point in the history
  • Loading branch information
cm-wada-yusuke committed Oct 22, 2024
1 parent 3805383 commit 2059300
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
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

0 comments on commit 2059300

Please sign in to comment.