Skip to content

Commit aa20fe2

Browse files
authoredOct 28, 2024··
Merge pull request #513 from zenn-dev/feat-disable-fuzzyEmail
fuzzyEmail を無効にする
2 parents 3805383 + 2059300 commit aa20fe2

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed
 

‎packages/zenn-markdown-html/__tests__/custom-syntax/embed/card.test.ts

+8
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ describe('LinkCard埋め込み要素のテスト', () => {
2828
expect(html).toContain('URLが不正です');
2929
});
3030
});
31+
32+
describe('メールアドレス', () => {
33+
test('メールアドレスのまま出力する', () => {
34+
const html = markdownToHtml(`ec2-user@33.80.180.159`);
35+
expect(html).toContain('ec2-user@33.80.180.159');
36+
expect(html).not.toContain('URLが不正です');
37+
});
38+
});
3139
});
3240

3341
describe('embedOriginを設定している場合', () => {

‎packages/zenn-markdown-html/src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ const markdownToHtml = (text: string, options?: MarkdownOptions): string => {
3838
const md = markdownIt({ breaks: true, linkify: true });
3939

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

4243
md.use(mdBr)
4344
.use(mdKatex)

0 commit comments

Comments
 (0)
Please sign in to comment.