Skip to content

Commit

Permalink
feat: remove autolink
Browse files Browse the repository at this point in the history
  • Loading branch information
jerrywcy committed Aug 26, 2023
1 parent ed62590 commit da310be
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 45 deletions.
4 changes: 2 additions & 2 deletions src/serializers/html/html.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -494,13 +494,13 @@ Answer: [Doist Frontend](channel://190200)`),

test('links HTML output is correct', () => {
expect(htmlSerializer.serialize(MARKDOWN_INPUT_LINKS)).toBe(
'<p>My favorite search engine is <a href="https://duckduckgo.com">Duck Duck Go</a>.<br>My favorite search engine is <a href="https://duckduckgo.com" title="The best search engine for privacy">Duck Duck Go</a>.<br>My favorite search engine is <a href="https://duckduckgo.com">https://duckduckgo.com</a>.</p>',
'<p>My favorite search engine is <a href="https://duckduckgo.com">Duck Duck Go</a>.<br>My favorite search engine is <a href="https://duckduckgo.com" title="The best search engine for privacy">Duck Duck Go</a>.<br>My favorite search engine is https://duckduckgo.com.</p>',
)
})

test('styled links HTML output is correct', () => {
expect(htmlSerializer.serialize(MARKDOWN_INPUT_STYLED_LINKS)).toBe(
'<p>I love supporting the <strong><a href="https://eff.org">EFF</a></strong>.<br>I love supporting the <strong><a href="https://eff.org">https://eff.org</a></strong>.<br>This is the <em><a href="https://www.markdownguide.org">Markdown Guide</a></em>.<br>This is the <em><a href="https://www.markdownguide.org">https://www.markdownguide.org</a></em>.<br>See the section on <a href="#code"><code>code</code></a>.</p>',
'<p>I love supporting the <strong><a href="https://eff.org">EFF</a></strong>.<br>I love supporting the <strong>https://eff.org</strong>.<br>This is the <em><a href="https://www.markdownguide.org">Markdown Guide</a></em>.<br>This is the <em>https://www.markdownguide.org</em>.<br>See the section on <a href="#code"><code>code</code></a>.</p>',
)
})
})
Expand Down
7 changes: 0 additions & 7 deletions src/serializers/html/html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { rehypeCodeBlock } from './plugins/rehype-code-block'
import { rehypeImage } from './plugins/rehype-image'
import { rehypeSuggestions } from './plugins/rehype-suggestions'
import { rehypeTaskList } from './plugins/rehype-task-list'
import { remarkAutolinkLiteral } from './plugins/remark-autolink-literal'
import { remarkDisableConstructs } from './plugins/remark-disable-constructs'
import { remarkStrikethrough } from './plugins/remark-strikethrough'

Expand Down Expand Up @@ -107,12 +106,6 @@ function createHTMLSerializer(schema: Schema): HTMLSerializerReturnType {
unifiedProcessor.use(remarkStrikethrough)
}

// Configure the unified processor to use a custom plugin to add support for the autolink
// literals extension from the GitHub Flavored Markdown (GFM) specification
if (schema.marks.link) {
unifiedProcessor.use(remarkAutolinkLiteral)
}

// Configure the unified processor with an official plugin to convert Markdown into HTML to
// support rehype (a tool that transforms HTML with plugins), followed by another official
// plugin to minify whitespace between tags (prevents line feeds from appearing as blank)
Expand Down
36 changes: 0 additions & 36 deletions src/serializers/html/plugins/remark-autolink-literal.ts

This file was deleted.

0 comments on commit da310be

Please sign in to comment.