Skip to content

Commit

Permalink
Update snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerard Brull committed Nov 6, 2020
1 parent 8c23797 commit 6a993ea
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 18 deletions.
5 changes: 0 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Array [
Object {
"content": "# Header
Text with _some_ **formatting** and a [link](/foo).
Text with *some* **formatting** and a [link](/foo).
<div>And some HTML.</div>
Expand Down
10 changes: 3 additions & 7 deletions src/loaders/utils/__tests__/noAutoLinkRemarkPlugin.spec.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import remark from 'remark';
import noAutoLink from '../noAutoLinkRemarkPlugin';

const transform = (markdown: string) =>
remark()
.use(noAutoLink)
.processSync(markdown)
.toString();
const transform = (markdown: string) => remark().use(noAutoLink).processSync(markdown).toString();

it('should convert URLs to auto links', () => {
it('should not convert URLs to auto links', () => {
const markdown = 'http://example.com';
const result = transform(markdown);
expect(result.trim()).toBe('[http://example.com](http://example.com "http&#x3A;//example.com")');
expect(result.trim()).toBe('http://example.com');
});

it('should keep full links as is', () => {
Expand Down
7 changes: 2 additions & 5 deletions src/loaders/utils/chunkify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,11 @@ export default function chunkify(
};
}

const rendered = remark()
.use(processCode)
.processSync(markdown)
.toString();
const rendered = remark().use(processCode).processSync(markdown).toString();

const chunks: (Rsg.CodeExample | Rsg.MarkdownExample)[] = [];
const textChunks = rendered.split(CODE_PLACEHOLDER);
textChunks.forEach(chunk => {
textChunks.forEach((chunk) => {
chunk = chunk.trim();
if (chunk) {
chunks.push({
Expand Down

0 comments on commit 6a993ea

Please sign in to comment.