@honkit/markdown 4.0.8 → 5.0.0

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.
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=glossary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"glossary.d.ts","sourceRoot":"","sources":["../../src/__tests__/glossary.ts"],"names":[],"mappings":""}
@@ -1,23 +1,29 @@
1
- const fs = require("fs");
2
- const path = require("path");
3
- const assert = require("assert");
4
- const glossary = require("../").glossary;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const assert_1 = __importDefault(require("assert"));
7
+ const path_1 = __importDefault(require("path"));
8
+ const fs_1 = __importDefault(require("fs"));
9
+ const __1 = __importDefault(require("../"));
10
+ const glossary = __1.default.glossary;
5
11
  describe("Glossary parsing", () => {
6
12
  let LEXED;
7
13
  beforeAll(() => {
8
- const CONTENT = fs.readFileSync(path.join(__dirname, "./fixtures/GLOSSARY.md"), "utf8");
14
+ const CONTENT = fs_1.default.readFileSync(path_1.default.join(__dirname, "./fixtures/GLOSSARY.md"), "utf8");
9
15
  LEXED = glossary(CONTENT);
10
16
  });
11
17
  it("should only get heading + paragraph pairs", () => {
12
- assert.equal(LEXED.length, 4);
18
+ assert_1.default.equal(LEXED.length, 4);
13
19
  });
14
20
  it("should output simple name/description objects", () => {
15
- assert.equal(true, !LEXED.some((e) => {
21
+ assert_1.default.equal(true, !LEXED.some((e) => {
16
22
  return !(e.name && e.description);
17
23
  }));
18
24
  });
19
25
  it("should correctly convert it to text", () => {
20
26
  const text = glossary.toText(LEXED);
21
- assert.deepEqual(glossary(text), LEXED);
27
+ assert_1.default.deepEqual(glossary(text), LEXED);
22
28
  });
23
29
  });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=inline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inline.d.ts","sourceRoot":"","sources":["../../src/__tests__/inline.ts"],"names":[],"mappings":""}
@@ -1,9 +1,13 @@
1
- const fs = require("fs");
2
- const path = require("path");
3
- const assert = require("assert");
4
- const inline = require("../").inline;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const __1 = __importDefault(require("../"));
7
+ const assert_1 = __importDefault(require("assert"));
8
+ const inline = __1.default.inline;
5
9
  describe("Inline", () => {
6
10
  it("should render inline markdown", () => {
7
- assert.equal(inline("Hello **World**").content, "Hello <strong>World</strong>");
11
+ assert_1.default.equal(inline("Hello **World**").content, "Hello <strong>World</strong>");
8
12
  });
9
13
  });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=langs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"langs.d.ts","sourceRoot":"","sources":["../../src/__tests__/langs.ts"],"names":[],"mappings":""}
@@ -1,22 +1,28 @@
1
- const fs = require("fs");
2
- const path = require("path");
3
- const assert = require("assert");
4
- const langs = require("../").langs;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const __1 = __importDefault(require("../"));
7
+ const assert_1 = __importDefault(require("assert"));
8
+ const path_1 = __importDefault(require("path"));
9
+ const fs_1 = __importDefault(require("fs"));
10
+ const langs = __1.default.langs;
5
11
  describe("Languages parsing", () => {
6
12
  let LEXED;
7
13
  beforeAll(() => {
8
- const CONTENT = fs.readFileSync(path.join(__dirname, "./fixtures/LANGS.md"), "utf8");
14
+ const CONTENT = fs_1.default.readFileSync(path_1.default.join(__dirname, "./fixtures/LANGS.md"), "utf8");
9
15
  LEXED = langs(CONTENT);
10
16
  });
11
17
  it("should detect paths and titles", () => {
12
- assert.equal(LEXED.length, 2);
13
- assert.equal(LEXED[0].ref, "en/");
14
- assert.equal(LEXED[0].title, "English");
15
- assert.equal(LEXED[1].ref, "fr/");
16
- assert.equal(LEXED[1].title, "French");
18
+ assert_1.default.equal(LEXED.length, 2);
19
+ assert_1.default.equal(LEXED[0].ref, "en/");
20
+ assert_1.default.equal(LEXED[0].title, "English");
21
+ assert_1.default.equal(LEXED[1].ref, "fr/");
22
+ assert_1.default.equal(LEXED[1].title, "French");
17
23
  });
18
24
  it("should correctly convert it to text", () => {
19
25
  const text = langs.toText(LEXED);
20
- assert.deepEqual(langs(text), LEXED);
26
+ assert_1.default.deepEqual(langs(text), LEXED);
21
27
  });
22
28
  });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=page.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../src/__tests__/page.ts"],"names":[],"mappings":""}
@@ -1,25 +1,31 @@
1
- const fs = require("fs");
2
- const path = require("path");
3
- const assert = require("assert");
4
- const page = require("../").page;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const path_1 = __importDefault(require("path"));
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const assert_1 = __importDefault(require("assert"));
9
+ const __1 = __importDefault(require("../"));
10
+ const page = __1.default.page;
5
11
  describe("Page parsing", () => {
6
12
  let LEXED;
7
13
  beforeAll(() => {
8
- const CONTENT = fs.readFileSync(path.join(__dirname, "./fixtures/PAGE.md"), "utf8");
14
+ const CONTENT = fs_1.default.readFileSync(path_1.default.join(__dirname, "./fixtures/PAGE.md"), "utf8");
9
15
  LEXED = page(CONTENT);
10
16
  });
11
17
  it("should gen content", () => {
12
- assert(LEXED.content);
18
+ (0, assert_1.default)(LEXED.content);
13
19
  });
14
20
  it("should not add id to headings", () => {
15
- assert.equal(page("# Hello").content, "<h1>Hello</h1>");
16
- assert.equal(page("# Hello {#test}").content, '<h1 id="test">Hello</h1>');
21
+ assert_1.default.equal(page("# Hello").content, "<h1>Hello</h1>");
22
+ assert_1.default.equal(page("# Hello {#test}").content, '<h1 id="test">Hello</h1>');
17
23
  });
18
24
  it("should escape codeblocks in preparation (1)", () => {
19
- assert.equal(page.prepare("Hello `world`"), "Hello {% raw %}`world`{% endraw %}\n\n");
20
- assert.equal(page.prepare("Hello `world test`"), "Hello {% raw %}`world test`{% endraw %}\n\n");
21
- assert.equal(page.prepare("Hello ```world test```"), "Hello {% raw %}`world test`{% endraw %}\n\n");
22
- assert.equal(page.prepare("Hello\n```js\nworld test\n```\n"), "Hello\n\n{% raw %}```js\nworld test\n```\n\n{% endraw %}");
25
+ assert_1.default.equal(page.prepare("Hello `world`"), "Hello {% raw %}`world`{% endraw %}\n\n");
26
+ assert_1.default.equal(page.prepare("Hello `world test`"), "Hello {% raw %}`world test`{% endraw %}\n\n");
27
+ assert_1.default.equal(page.prepare("Hello ```world test```"), "Hello {% raw %}`world test`{% endraw %}\n\n");
28
+ assert_1.default.equal(page.prepare("Hello\n```js\nworld test\n```\n"), "Hello\n\n{% raw %}```js\nworld test\n```\n\n{% endraw %}");
23
29
  expect(page.prepare("Hello\n```\ntest\n\tworld\n\ttest\n```")).toMatchInlineSnapshot(`
24
30
  "Hello
25
31
 
@@ -78,13 +84,13 @@ test`)).toMatchInlineSnapshot(`
78
84
  `);
79
85
  });
80
86
  it("should escape codeblocks with nunjucks tags", () => {
81
- assert.equal(page.prepare('Hello {{ "Bonjour" }} ```test```'), 'Hello {{ "Bonjour" }} {% raw %}`test`{% endraw %}\n\n');
87
+ assert_1.default.equal(page.prepare('Hello {{ "Bonjour" }} ```test```'), 'Hello {{ "Bonjour" }} {% raw %}`test`{% endraw %}\n\n');
82
88
  });
83
89
  it("should escape codeblocks with nunjucks tags in {% raw %} tags", () => {
84
- assert.equal(page.prepare('{% raw %}Hello {{ "Bonjour" }} ```test```{% endraw %}'), '{% raw %}Hello {{ "Bonjour" }} `test`{% endraw %}\n\n');
85
- assert.equal(page.prepare('{% raw %}Hello {{ "Bonjour" }} {% raw %}{% endraw %}```test```'), '{% raw %}Hello {{ "Bonjour" }} {% raw %}{% endraw %}{% raw %}`test`{% endraw %}\n\n');
86
- assert.equal(page.prepare('```{% raw %}Hello {{ "Bonjour" }} {% raw %}```'), '{% raw %}`{% raw %}Hello {{ "Bonjour" }} {% raw %}`{% endraw %}\n\n');
87
- assert.equal(page.prepare("```\ntest\n```\n\n\n### Test"), "{% raw %}```\ntest\n```\n\n{% endraw %}### Test\n\n");
90
+ assert_1.default.equal(page.prepare('{% raw %}Hello {{ "Bonjour" }} ```test```{% endraw %}'), '{% raw %}Hello {{ "Bonjour" }} `test`{% endraw %}\n\n');
91
+ assert_1.default.equal(page.prepare('{% raw %}Hello {{ "Bonjour" }} {% raw %}{% endraw %}```test```'), '{% raw %}Hello {{ "Bonjour" }} {% raw %}{% endraw %}{% raw %}`test`{% endraw %}\n\n');
92
+ assert_1.default.equal(page.prepare('```{% raw %}Hello {{ "Bonjour" }} {% raw %}```'), '{% raw %}`{% raw %}Hello {{ "Bonjour" }} {% raw %}`{% endraw %}\n\n');
93
+ assert_1.default.equal(page.prepare("```\ntest\n```\n\n\n### Test"), "{% raw %}```\ntest\n```\n\n{% endraw %}### Test\n\n");
88
94
  });
89
95
  it("escape {% uml %} block tags + Indented code block", () => {
90
96
  const code = `{% uml %}
@@ -122,7 +128,7 @@ test`)).toMatchInlineSnapshot(`
122
128
  `);
123
129
  });
124
130
  it("should not process math", () => {
125
- assert.equal(page.prepare("Hello $world$"), "Hello $world$\n\n");
126
- assert.equal(page.prepare("Hello $$world$$"), "Hello $$world$$\n\n");
131
+ assert_1.default.equal(page.prepare("Hello $world$"), "Hello $world$\n\n");
132
+ assert_1.default.equal(page.prepare("Hello $$world$$"), "Hello $$world$$\n\n");
127
133
  });
128
134
  });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=readme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readme.d.ts","sourceRoot":"","sources":["../../src/__tests__/readme.ts"],"names":[],"mappings":""}
@@ -1,23 +1,28 @@
1
- const fs = require("fs");
2
- const path = require("path");
3
- const assert = require("assert");
4
- const readme = require("../").readme;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const path_1 = __importDefault(require("path"));
7
+ const assert_1 = __importDefault(require("assert"));
8
+ const __1 = __importDefault(require("../"));
9
+ const fs_1 = __importDefault(require("fs"));
5
10
  describe("Readme parsing", () => {
6
11
  let LEXED;
7
12
  beforeAll(() => {
8
- const CONTENT = fs.readFileSync(path.join(__dirname, "./fixtures/README.md"), "utf8");
9
- LEXED = readme(CONTENT);
13
+ const CONTENT = fs_1.default.readFileSync(path_1.default.join(__dirname, "./fixtures/README.md"), "utf8");
14
+ LEXED = __1.default.readme(CONTENT);
10
15
  });
11
16
  it("should contain a title", () => {
12
- assert(LEXED.title);
17
+ (0, assert_1.default)(LEXED.title);
13
18
  });
14
19
  it("should contain a description", () => {
15
- assert(LEXED.description);
20
+ (0, assert_1.default)(LEXED.description);
16
21
  });
17
22
  it("should extract the right title", () => {
18
- assert.equal(LEXED.title, "This is the title");
23
+ assert_1.default.equal(LEXED.title, "This is the title");
19
24
  });
20
25
  it("should extract the right description", () => {
21
- assert.equal(LEXED.description, "This is the book description.");
26
+ assert_1.default.equal(LEXED.description, "This is the book description.");
22
27
  });
23
28
  });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=summary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../src/__tests__/summary.ts"],"names":[],"mappings":""}
@@ -1,55 +1,60 @@
1
- const fs = require("fs");
2
- const path = require("path");
3
- const assert = require("assert");
4
- const summary = require("../").summary;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const path_1 = __importDefault(require("path"));
7
+ const assert_1 = __importDefault(require("assert"));
8
+ const fs_1 = __importDefault(require("fs"));
9
+ const __1 = __importDefault(require("../"));
5
10
  function lex(fixtureFile) {
6
- return summary(fs.readFileSync(path.join(__dirname, "fixtures", fixtureFile), "utf8"));
11
+ return __1.default.summary(fs_1.default.readFileSync(path_1.default.join(__dirname, "fixtures", fixtureFile), "utf8"));
7
12
  }
8
13
  describe("Summary parsing", () => {
9
- let LEXED;
14
+ let LEXED, PART;
10
15
  beforeAll(() => {
11
16
  LEXED = lex("SUMMARY.md");
12
17
  PART = LEXED.parts[0];
13
18
  });
14
19
  it("should detect chapters", () => {
15
- assert.equal(PART.articles.length, 5);
20
+ assert_1.default.equal(PART.articles.length, 5);
16
21
  });
17
22
  it("should support articles", () => {
18
- assert.equal(PART.articles[0].articles.length, 2);
19
- assert.equal(PART.articles[1].articles.length, 0);
20
- assert.equal(PART.articles[2].articles.length, 0);
23
+ assert_1.default.equal(PART.articles[0].articles.length, 2);
24
+ assert_1.default.equal(PART.articles[1].articles.length, 0);
25
+ assert_1.default.equal(PART.articles[2].articles.length, 0);
21
26
  });
22
27
  it("should detect paths and titles", () => {
23
- assert(PART.articles[0].ref);
24
- assert(PART.articles[1].ref);
25
- assert(PART.articles[2].ref);
26
- assert(PART.articles[3].ref);
27
- assert.equal(PART.articles[4].ref, null);
28
- assert(PART.articles[0].title);
29
- assert(PART.articles[1].title);
30
- assert(PART.articles[2].title);
31
- assert(PART.articles[3].title);
32
- assert(PART.articles[4].title);
28
+ (0, assert_1.default)(PART.articles[0].ref);
29
+ (0, assert_1.default)(PART.articles[1].ref);
30
+ (0, assert_1.default)(PART.articles[2].ref);
31
+ (0, assert_1.default)(PART.articles[3].ref);
32
+ assert_1.default.equal(PART.articles[4].ref, null);
33
+ (0, assert_1.default)(PART.articles[0].title);
34
+ (0, assert_1.default)(PART.articles[1].title);
35
+ (0, assert_1.default)(PART.articles[2].title);
36
+ (0, assert_1.default)(PART.articles[3].title);
37
+ (0, assert_1.default)(PART.articles[4].title);
33
38
  });
34
39
  it("should normalize paths from .md", () => {
35
- assert.equal(PART.articles[0].ref, "chapter-1/README.md");
36
- assert.equal(PART.articles[1].ref, "chapter-2/README.md");
37
- assert.equal(PART.articles[2].ref, "chapter-3/README.md");
40
+ assert_1.default.equal(PART.articles[0].ref, "chapter-1/README.md");
41
+ assert_1.default.equal(PART.articles[1].ref, "chapter-2/README.md");
42
+ assert_1.default.equal(PART.articles[2].ref, "chapter-3/README.md");
38
43
  });
39
44
  it("should part parts", () => {
40
45
  const l = lex("SUMMARY_PARTS.md");
41
- assert.equal(l.parts.length, 3);
46
+ assert_1.default.equal(l.parts.length, 3);
42
47
  });
43
48
  it("should allow lists separated by whitespace", () => {
44
49
  const l = lex("SUMMARY_WHITESPACE.md");
45
- assert.equal(l.parts[0].articles.length, 5);
50
+ assert_1.default.equal(l.parts[0].articles.length, 5);
46
51
  });
47
52
  it("should allow ignore empty entries", () => {
48
53
  const l = lex("SUMMARY_EMPTY.md");
49
- assert.equal(l.parts[0].articles.length, 1);
54
+ assert_1.default.equal(l.parts[0].articles.length, 1);
50
55
  });
51
56
  it("should correctly convert it to text", () => {
52
- const text = summary.toText(LEXED);
53
- assert.deepEqual(summary(text), LEXED);
57
+ const text = __1.default.summary.toText(LEXED);
58
+ assert_1.default.deepEqual(__1.default.summary(text), LEXED);
54
59
  });
55
60
  });
package/lib/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ declare const markdownParser: import("@honkit/html").Parsers;
2
+ export default markdownParser;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,cAAc,gCAAmC,CAAC;AAGxD,eAAe,cAAc,CAAC"}
package/lib/index.js CHANGED
@@ -3,10 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const html_1 = __importDefault(require("@honkit/html"));
6
+ const html_1 = require("@honkit/html");
7
7
  const toHTML_1 = __importDefault(require("./toHTML"));
8
8
  const toMarkdown_1 = __importDefault(require("./toMarkdown"));
9
- const page_1 = __importDefault(require("./page"));
10
- module.exports = html_1.default.createParser(toHTML_1.default, toMarkdown_1.default);
9
+ const page_1 = require("./page");
10
+ const markdownParser = (0, html_1.createParser)(toHTML_1.default, toMarkdown_1.default);
11
11
  // Add the custom page escaping
12
- module.exports.page.prepare = page_1.default.prepare;
12
+ markdownParser.page.prepare = page_1.preparePage;
13
+ exports.default = markdownParser;
package/lib/page.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Add templating "raw" to code blocks to
3
+ * avoid nunjucks processing their content.
4
+ *
5
+ * @param {string} src
6
+ * @return {string}
7
+ */
8
+ export declare function preparePage(src: string): any;
9
+ //# sourceMappingURL=page.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../src/page.ts"],"names":[],"mappings":"AAkBA;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,OAiCtC"}
package/lib/page.js CHANGED
@@ -1,10 +1,34 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const MarkupIt = require("@honkit/markup-it");
26
+ exports.preparePage = void 0;
27
+ const MarkupIt = __importStar(require("@honkit/markup-it"));
4
28
  const gitbookSyntax = require("@honkit/markup-it/syntaxes/markdown");
5
29
  const RAW_START = "{% raw %}";
6
30
  const RAW_END = "{% endraw %}";
7
- const markdown = new MarkupIt(gitbookSyntax);
31
+ const markdown = new MarkupIt.default(gitbookSyntax);
8
32
  /**
9
33
  * Escape a code block's content using raw blocks
10
34
  *
@@ -25,7 +49,7 @@ function preparePage(src) {
25
49
  let levelRaw = 0;
26
50
  const content = markdown.toContent(src, {
27
51
  math: true,
28
- template: true,
52
+ template: true
29
53
  });
30
54
  const textMarkdown = markdown.toText(content, {
31
55
  annotate: function (state, raw, token) {
@@ -46,10 +70,8 @@ function preparePage(src) {
46
70
  return escape(raw);
47
71
  }
48
72
  return raw;
49
- },
73
+ }
50
74
  });
51
75
  return textMarkdown;
52
76
  }
53
- exports.default = {
54
- prepare: preparePage,
55
- };
77
+ exports.preparePage = preparePage;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Convert Markdown block to HTML
3
+ *
4
+ * @param {string} src (markdown)
5
+ * @return {string} (html)
6
+ */
7
+ declare function convertMdToHTMLBlock(src: string): any;
8
+ /**
9
+ * Convert Markdown inline to HTML
10
+ *
11
+ * @param {string} src (markdown)
12
+ * @return {string} (html)
13
+ */
14
+ declare function convertMdToHTMLInline(src: any): any;
15
+ declare const _default: {
16
+ block: typeof convertMdToHTMLBlock;
17
+ inline: typeof convertMdToHTMLInline;
18
+ };
19
+ export default _default;
20
+ //# sourceMappingURL=toHTML.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toHTML.d.ts","sourceRoot":"","sources":["../src/toHTML.ts"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,iBAAS,oBAAoB,CAAC,GAAG,EAAE,MAAM,OAKxC;AAED;;;;;GAKG;AACH,iBAAS,qBAAqB,CAAC,GAAG,KAAA,OAKjC;;;;;AAED,wBAGE"}
package/lib/toHTML.js CHANGED
@@ -3,11 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const markup_it_1 = __importDefault(require("@honkit/markup-it"));
6
+ const markup_it_1 = require("@honkit/markup-it");
7
7
  const markdown_1 = __importDefault(require("@honkit/markup-it/syntaxes/markdown"));
8
8
  const html_1 = __importDefault(require("@honkit/markup-it/syntaxes/html"));
9
- const markdown = new markup_it_1.default(markdown_1.default);
10
- const html = new markup_it_1.default(html_1.default);
9
+ const markdown = new markup_it_1.Markup(markdown_1.default);
10
+ const html = new markup_it_1.Markup(html_1.default);
11
11
  /**
12
12
  * Convert Markdown block to HTML
13
13
  *
@@ -32,5 +32,5 @@ function convertMdToHTMLInline(src) {
32
32
  }
33
33
  exports.default = {
34
34
  block: convertMdToHTMLBlock,
35
- inline: convertMdToHTMLInline,
35
+ inline: convertMdToHTMLInline
36
36
  };
@@ -0,0 +1,16 @@
1
+ declare const _default: {
2
+ onText: (text: any) => any;
3
+ onTitleStart: (level: any) => string;
4
+ onTitleEnd: (level: any) => any;
5
+ onParagraphStart: () => any;
6
+ onParagraphEnd: () => any;
7
+ onLinkStart: () => string;
8
+ onLinkEnd: (href: any) => string;
9
+ onListStart: (level: any) => string;
10
+ onListEnd: () => string;
11
+ onListItemStart: (level: any) => string;
12
+ onListItemEnd: () => string;
13
+ onHR: () => string;
14
+ };
15
+ export default _default;
16
+ //# sourceMappingURL=toMarkdown.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toMarkdown.d.ts","sourceRoot":"","sources":["../src/toMarkdown.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAWA,wBA2CE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@honkit/markdown",
3
- "version": "4.0.8",
3
+ "version": "5.0.0",
4
4
  "description": "Parse markdown content for honkit",
5
5
  "homepage": "https://github.com/honkit/honkit",
6
6
  "bugs": {
@@ -38,16 +38,16 @@
38
38
  "prepublish": "npm run --if-present build"
39
39
  },
40
40
  "dependencies": {
41
- "@honkit/html": "^4.0.8",
42
- "@honkit/markup-it": "^4.0.8",
41
+ "@honkit/html": "^5.0.0",
42
+ "@honkit/markup-it": "^5.0.0",
43
43
  "markdown-escape": "^1.0.1"
44
44
  },
45
45
  "devDependencies": {
46
46
  "jest": "^29.0.3",
47
- "ts-jest": "^29.0.1"
47
+ "ts-jest": "^29.1.1"
48
48
  },
49
49
  "publishConfig": {
50
50
  "access": "public"
51
51
  },
52
- "gitHead": "6a2337bdac8357887496ce7e84a8184e40907235"
52
+ "gitHead": "9feb7e251f1d305c2cd521f78f0a275b847a6e1b"
53
53
  }