@astrojs/markdown-remark 2.1.4 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,43 +0,0 @@
1
- import { renderMarkdown } from '../dist/index.js';
2
- import chai from 'chai';
3
- import { mockRenderMarkdownParams } from './test-utils.js';
4
-
5
- describe('autolinking', () => {
6
- describe('plain md', () => {
7
- it('autolinks URLs starting with a protocol in plain text', async () => {
8
- const { code } = await renderMarkdown(
9
- `See https://example.com for more.`,
10
- mockRenderMarkdownParams
11
- );
12
-
13
- chai
14
- .expect(code.replace(/\n/g, ''))
15
- .to.equal(`<p>See <a href="https://example.com">https://example.com</a> for more.</p>`);
16
- });
17
-
18
- it('autolinks URLs starting with "www." in plain text', async () => {
19
- const { code } = await renderMarkdown(
20
- `See www.example.com for more.`,
21
- mockRenderMarkdownParams
22
- );
23
-
24
- chai
25
- .expect(code.trim())
26
- .to.equal(`<p>See <a href="http://www.example.com">www.example.com</a> for more.</p>`);
27
- });
28
-
29
- it('does not autolink URLs in code blocks', async () => {
30
- const { code } = await renderMarkdown(
31
- 'See `https://example.com` or `www.example.com` for more.',
32
- mockRenderMarkdownParams
33
- );
34
-
35
- chai
36
- .expect(code.trim())
37
- .to.equal(
38
- `<p>See <code>https://example.com</code> or ` +
39
- `<code>www.example.com</code> for more.</p>`
40
- );
41
- });
42
- });
43
- });
@@ -1,14 +0,0 @@
1
- import { renderMarkdown } from '../dist/index.js';
2
- import { expect } from 'chai';
3
- import { mockRenderMarkdownParams } from './test-utils.js';
4
-
5
- describe('entities', () => {
6
- it('should not unescape entities in regular Markdown', async () => {
7
- const { code } = await renderMarkdown(
8
- `&lt;i&gt;This should NOT be italic&lt;/i&gt;`,
9
- mockRenderMarkdownParams
10
- );
11
-
12
- expect(code).to.equal(`<p>&#x3C;i>This should NOT be italic&#x3C;/i></p>`);
13
- });
14
- });
@@ -1,28 +0,0 @@
1
- import { renderMarkdown } from '../dist/index.js';
2
- import { mockRenderMarkdownParams } from './test-utils.js';
3
- import chai from 'chai';
4
-
5
- import { fileURLToPath } from 'node:url';
6
-
7
- describe('plugins', () => {
8
- // https://github.com/withastro/astro/issues/3264
9
- it('should be able to get file path when passing fileURL', async () => {
10
- let context;
11
- await renderMarkdown(`test`, {
12
- ...mockRenderMarkdownParams,
13
- fileURL: new URL('virtual.md', import.meta.url),
14
- remarkPlugins: [
15
- function () {
16
- const transformer = (tree, file) => {
17
- context = file;
18
- };
19
-
20
- return transformer;
21
- },
22
- ],
23
- });
24
-
25
- chai.expect(typeof context).to.equal('object');
26
- chai.expect(context.path).to.equal(fileURLToPath(new URL('virtual.md', import.meta.url)));
27
- });
28
- });
@@ -1,3 +0,0 @@
1
- export const mockRenderMarkdownParams = {
2
- contentDir: new URL('file:///src/content/'),
3
- };
package/tsconfig.json DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "extends": "../../../tsconfig.base.json",
3
- "include": ["src"],
4
- "compilerOptions": {
5
- "allowJs": true,
6
- "target": "ES2021",
7
- "module": "ES2022",
8
- "outDir": "./dist"
9
- }
10
- }