@ohos-ports/markdown-exit 1.3.0-beta.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.
- package/LICENSE +22 -0
- package/README.md +127 -0
- package/dist/chunk-CzXV76rE.js +18 -0
- package/dist/index.d.ts +1133 -0
- package/dist/index.js +3950 -0
- package/package.json +52 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2014 Vitaly Puzrin, Alex Kocharin.
|
|
4
|
+
Copyright (c) 2025 SerKo <https://github.com/serkodev>
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
# markdown-exit
|
|
4
|
+
|
|
5
|
+
[![npm version][npm-version-src]][npm-version-href]
|
|
6
|
+
[![bundle][bundle-src]][bundle-href]
|
|
7
|
+
[![License][license-src]][license-href]
|
|
8
|
+
[![CodSpeed][codspeed-src]][codspeed-href]
|
|
9
|
+
|
|
10
|
+
A TypeScript rewrite of [markdown-it](https://github.com/markdown-it/markdown-it) with first-class typings, modern tooling, and enhancements.
|
|
11
|
+
|
|
12
|
+
## Features
|
|
13
|
+
|
|
14
|
+
- 🛡️ **Type Safety:** Ship robust types, improve DX, and enable type-safe development.
|
|
15
|
+
- ⚡ **New features:** [Async rendering](https://markdown-exit.pages.dev/guide/rendering.html#async-rendering) for all rules includeing syntax highlighting and [more](https://github.com/serkodev/markdown-exit/issues?q=is:issue%20label:features).
|
|
16
|
+
- 🔌 **Extensibility:** Extend the markdown syntax, custom rendering with [Plugins](https://markdown-exit.pages.dev/guide/plugins.html).
|
|
17
|
+
- 🤝 **Compatibility:** Compatible with markdown-it `v14.3.0` and plugin API.
|
|
18
|
+
|
|
19
|
+
## Documentation
|
|
20
|
+
|
|
21
|
+
Read the [documentation](https://markdown-exit.pages.dev/) for more details.
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
v1+ [`@latest`](https://www.npmjs.com/package/markdown-exit/v/latest): All new features and may include breaking changes.
|
|
26
|
+
|
|
27
|
+
> [!IMPORTANT]
|
|
28
|
+
> 🚧 **markdown-exit** v1 is currently in **public beta** (`v1.0.0-beta.*`).
|
|
29
|
+
> Breaking changes may occur until a stable `v1.0.0` is released.
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm i markdown-exit
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
<details>
|
|
36
|
+
<summary>v0.x <a href="https://www.npmjs.com/package/markdown-exit/v/legacy"><code>@legacy</code></a></summary>
|
|
37
|
+
|
|
38
|
+
Full compatibility with markdown-it usage while adding TypeScript support, bug fixes and performance improvements. ([v0](https://github.com/serkodev/markdown-exit/tree/v0) branch)
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npm i markdown-exit@legacy
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
</details>
|
|
45
|
+
|
|
46
|
+
## Usage
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
import { createMarkdownExit } from 'markdown-exit'
|
|
50
|
+
|
|
51
|
+
// factory helper
|
|
52
|
+
const md = createMarkdownExit()
|
|
53
|
+
const html = md.render('# markdown-exit')
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
import { MarkdownExit } from 'markdown-exit'
|
|
58
|
+
|
|
59
|
+
// with the `new` keyword
|
|
60
|
+
const md = new MarkdownExit()
|
|
61
|
+
const html = md.render('# markdown-exit')
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
<details>
|
|
65
|
+
<summary>Default import</summary>
|
|
66
|
+
|
|
67
|
+
> [!NOTE]
|
|
68
|
+
> Default export (with callable constructor support) is retained for markdown-it compatibility, but it may have drawbacks in module interop and tree-shaking.
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
import MarkdownExit from 'markdown-exit'
|
|
72
|
+
|
|
73
|
+
// callable function
|
|
74
|
+
const md = MarkdownExit()
|
|
75
|
+
md.render('# markdown-exit')
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
// with the `new` keyword
|
|
80
|
+
const md = new MarkdownExit()
|
|
81
|
+
md.render('# markdown-exit')
|
|
82
|
+
```
|
|
83
|
+
</details>
|
|
84
|
+
|
|
85
|
+
### Guides
|
|
86
|
+
|
|
87
|
+
- [Markdown Syntax](https://markdown-exit.pages.dev/guide/markdown-syntax.html)
|
|
88
|
+
- [Redering](https://markdown-exit.pages.dev/guide/rendering.html)
|
|
89
|
+
- [Plugins](https://markdown-exit.pages.dev/guide/plugins.html)
|
|
90
|
+
|
|
91
|
+
## Migrate from markdown-it
|
|
92
|
+
|
|
93
|
+
Drop-in replacement for markdown-it with enhancements, see [Migration Guide](https://markdown-exit.pages.dev/guide/migrate-from-markdown-it.html) for details.
|
|
94
|
+
|
|
95
|
+
```diff
|
|
96
|
+
- import MarkdownIt from 'markdown-it'
|
|
97
|
+
+ import MarkdownExit from 'markdown-exit'
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Credits
|
|
101
|
+
|
|
102
|
+
This project owes its foundation to the [markdown-it](https://github.com/markdown-it/markdown-it) community and all its [contributors](https://github.com/markdown-it/markdown-it/graphs/contributors).
|
|
103
|
+
|
|
104
|
+
### Authors of markdown-it
|
|
105
|
+
- Alex Kocharin [github/rlidwka](https://github.com/rlidwka)
|
|
106
|
+
- Vitaly Puzrin [github/puzrin](https://github.com/puzrin)
|
|
107
|
+
|
|
108
|
+
### Special Thanks
|
|
109
|
+
|
|
110
|
+
- [John MacFarlane](https://github.com/jgm) for the CommonMark spec and reference implementations.
|
|
111
|
+
- [Definition owners](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/a26d35b5c331fbdb512ac7dfb1b846d282336c67/.github/CODEOWNERS#L4713C1-L4713C106) of [@types/markdown-it](https://www.npmjs.com/package/@types/markdown-it) for the type definitions reference.
|
|
112
|
+
- [Anthony Fu](https://github.com/antfu) for inspiring async rendering by [markdown-it-async](https://github.com/antfu/markdown-it-async).
|
|
113
|
+
|
|
114
|
+
## License
|
|
115
|
+
|
|
116
|
+
[MIT License](./LICENSE) © [Alex Kocharin](https://github.com/rlidwka), [Vitaly Puzrin](https://github.com/puzrin), [SerKo](https://github.com/serkodev)
|
|
117
|
+
|
|
118
|
+
<!-- Badges -->
|
|
119
|
+
|
|
120
|
+
[npm-version-src]: https://img.shields.io/npm/v/markdown-exit?style=flat&colorA=00AF6B&colorB=000
|
|
121
|
+
[npm-version-href]: https://npmjs.com/package/markdown-exit
|
|
122
|
+
[bundle-src]: https://img.shields.io/bundlephobia/minzip/markdown-exit?style=flat&colorA=00AF6B&colorB=000&label=minzip
|
|
123
|
+
[bundle-href]: https://bundlephobia.com/result?p=markdown-exit
|
|
124
|
+
[license-src]: https://img.shields.io/github/license/serkodev/markdown-exit.svg?style=flat&colorA=00AF6B&colorB=000
|
|
125
|
+
[license-href]: https://github.com/serkodev/markdown-exit/blob/main/LICENSE
|
|
126
|
+
[codspeed-src]: https://img.shields.io/badge/CodSpeed-benchmark-blue
|
|
127
|
+
[codspeed-href]: https://codspeed.io/serkodev/markdown-exit?utm_source=badge
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region rolldown:runtime
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __exportAll = (all, symbols) => {
|
|
4
|
+
let target = {};
|
|
5
|
+
for (var name in all) {
|
|
6
|
+
__defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
if (symbols) {
|
|
12
|
+
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
13
|
+
}
|
|
14
|
+
return target;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { __exportAll as t };
|