wikiparser-node 1.30.0 → 1.31.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/README.md +8 -4
- package/bundle/bundle-es8.min.js +29 -29
- package/bundle/bundle-lsp.min.js +34 -34
- package/bundle/bundle.min.js +22 -22
- package/dist/addon/magicWords.js +642 -40
- package/dist/addon/token.js +99 -112
- package/dist/addon/transclude.js +2 -2
- package/dist/base.d.mts +4 -3
- package/dist/base.d.ts +4 -3
- package/dist/base.js +2 -0
- package/dist/base.mjs +2 -0
- package/dist/bin/config.js +1 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +34 -2
- package/dist/internal.d.ts +2 -1
- package/dist/lib/element.d.ts +1 -1
- package/dist/lib/element.js +4 -0
- package/dist/lib/lintConfig.js +5 -1
- package/dist/lib/node.js +1 -1
- package/dist/lib/redirectMap.js +1 -1
- package/dist/lib/text.js +15 -12
- package/dist/parser/commentAndExt.js +1 -1
- package/dist/parser/hrAndDoubleUnderscore.js +11 -9
- package/dist/src/arg.js +7 -0
- package/dist/src/atom.js +2 -0
- package/dist/src/attribute.js +2 -2
- package/dist/src/attributes.js +2 -1
- package/dist/src/extLink.js +1 -1
- package/dist/src/imageParameter.js +2 -1
- package/dist/src/index.js +4 -6
- package/dist/src/link/base.js +10 -2
- package/dist/src/link/category.d.ts +1 -1
- package/dist/src/link/category.js +3 -1
- package/dist/src/link/file.js +2 -2
- package/dist/src/link/galleryImage.js +1 -1
- package/dist/src/link/index.js +2 -2
- package/dist/src/nowiki/index.js +1 -1
- package/dist/src/nowiki/list.js +3 -1
- package/dist/src/nowiki/quote.js +2 -2
- package/dist/src/paramLine.js +2 -0
- package/dist/src/table/base.js +1 -2
- package/dist/src/table/index.d.ts +1 -1
- package/dist/src/table/index.js +1 -1
- package/dist/src/table/td.js +5 -6
- package/dist/src/tag/html.js +2 -3
- package/dist/src/tag/index.js +7 -5
- package/dist/src/tagPair/ext.js +6 -5
- package/dist/src/tagPair/translate.d.ts +1 -0
- package/dist/src/tagPair/translate.js +8 -1
- package/dist/src/transclude.d.ts +6 -0
- package/dist/src/transclude.js +22 -8
- package/dist/util/constants.js +4 -2
- package/dist/util/html.js +10 -2
- package/dist/util/string.js +22 -10
- package/extensions/dist/base.js +2 -2
- package/extensions/editor.css +1 -1
- package/i18n/en.json +1 -0
- package/i18n/zh-hans.json +1 -0
- package/i18n/zh-hant.json +1 -0
- package/package.json +9 -5
package/README.md
CHANGED
|
@@ -13,15 +13,19 @@
|
|
|
13
13
|
|
|
14
14
|
WikiParser-Node is an offline [Wikitext](https://www.mediawiki.org/wiki/Wikitext) parser developed by Bhsd for the [Node.js](https://nodejs.org/) environment. It can parse almost all wiki syntax and generate an [Abstract Syntax Tree (AST)](https://en.wikipedia.org/wiki/Abstract_syntax_tree) ([Try it online](https://bhsd-harry.github.io/wikiparser-node/#editor)). It also allows for easy querying and modification of the AST, and returns the modified wikitext.
|
|
15
15
|
|
|
16
|
+
Although WikiParser-Node is not originally designed to convert Wikitext to HTML, it provides a limited capability to do so. [Here](https://bhsd-harry.github.io/wikiparser-website/) is a list of example HTML pages rendered using this package.
|
|
17
|
+
|
|
16
18
|
# Other Versions
|
|
17
19
|
|
|
18
20
|
## Mini (also known as [WikiLint](https://www.npmjs.com/package/wikilint))
|
|
19
21
|
|
|
20
|
-
This version provides a [CLI](https://en.wikipedia.org/wiki/Command-line_interface), but only retains the parsing functionality and linting functionality. The parsed AST cannot be modified. It
|
|
22
|
+
This version provides a [CLI](https://en.wikipedia.org/wiki/Command-line_interface), but only retains the parsing functionality and linting functionality. The parsed AST cannot be modified. It powers the [Wikitext LSP](https://www.npmjs.com/package/wikitext-lsp), which provides multiple language services for editors such as [VS Code](https://marketplace.visualstudio.com/items?itemName=Bhsd.vscode-extension-wikiparser), [Sublime Text](https://lsp.sublimetext.io/language_servers/#mediawiki), and [Helix](https://github.com/helix-editor/helix/wiki/Language-Server-Configurations#wikitext).
|
|
23
|
+
|
|
24
|
+
A list of available linting rules can be found [here](https://github.com/bhsd-harry/wikiparser-node/wiki/Rules).
|
|
21
25
|
|
|
22
26
|
## Browser-compatible
|
|
23
27
|
|
|
24
|
-
A browser-compatible version, which can be used for code highlighting or as a linting plugin in conjunction with editors such as [CodeMirror](https://www.npmjs.com/package/@bhsd/codemirror-mediawiki) and [Monaco](https://www.npmjs.com/package/monaco-wiki)
|
|
28
|
+
A browser-compatible version, which can be used for code highlighting or as a linting plugin in conjunction with editors such as [CodeMirror](https://www.npmjs.com/package/@bhsd/codemirror-mediawiki) and [Monaco](https://www.npmjs.com/package/monaco-wiki) ([Usage example](https://bhsd-harry.github.io/wikiparser-node)). It has been integrated into the MediaWiki official [CodeMirror extension](https://www.mediawiki.org/wiki/Extension:CodeMirror) since Release 1.45.
|
|
25
29
|
|
|
26
30
|
# Installation
|
|
27
31
|
|
|
@@ -94,7 +98,7 @@ A full database dump (`*.xml.bz2`) [scan](https://www.npmjs.com/package/lint-wik
|
|
|
94
98
|
## HTML conversion
|
|
95
99
|
|
|
96
100
|
<details>
|
|
97
|
-
|
|
101
|
+
<summary>Expand</summary>
|
|
98
102
|
|
|
99
103
|
### Extension
|
|
100
104
|
|
|
@@ -102,7 +106,7 @@ A full database dump (`*.xml.bz2`) [scan](https://www.npmjs.com/package/lint-wik
|
|
|
102
106
|
|
|
103
107
|
### Transclusion
|
|
104
108
|
|
|
105
|
-
1.
|
|
109
|
+
1. Some parser functions are not supported.
|
|
106
110
|
|
|
107
111
|
### Heading
|
|
108
112
|
|