wikiparser-node 1.3.0 → 1.3.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.
@@ -80,7 +80,6 @@ const parseBraces = (wikitext, config = Parser.getConfig(), accum = []) => {
80
80
  }
81
81
  catch (e) {
82
82
  if (e instanceof SyntaxError && e.message.startsWith('非法的模板名称:')) {
83
- lastIndex = index + open.length;
84
83
  skip = true;
85
84
  }
86
85
  else {
@@ -42,10 +42,10 @@ const parseCommentAndExt = (wikitext, config = Parser.getConfig(), accum = [], i
42
42
  return str;
43
43
  }
44
44
  }
45
- const ext = config.ext.join('|'), includeRegex = includeOnly ? 'includeonly' : '(?:no|only)include', noincludeRegex = includeOnly ? 'noinclude' : 'includeonly', regex = new RegExp('<!--.*?(?:-->|$)|' // comment
46
- + `<${includeRegex}(?:\\s[^>]*?)?>|</${includeRegex}\\s*>|` // <includeonly>
45
+ const ext = config.ext.join('|'), noincludeRegex = includeOnly ? 'includeonly' : '(?:no|only)include', includeRegex = includeOnly ? 'noinclude' : 'includeonly', regex = new RegExp('<!--.*?(?:-->|$)|' // comment
46
+ + `<${noincludeRegex}(?:\\s[^>]*?)?>|</${noincludeRegex}\\s*>|` // <noinclude>
47
47
  + `<(${ext})(\\s[^>]*?)?(?:/>|>(.*?)</(\\1\\s*)>)|` // 扩展标签
48
- + `<(${noincludeRegex})(\\s[^>]*?)?(?:/>|>(.*?)(?:</(\\5\\s*)>|$))`, // <noinclude>
48
+ + `<(${includeRegex})(\\s[^>]*?)?(?:/>|>(.*?)(?:</(${includeRegex}\\s*)>|$))`, // <includeonly>
49
49
  'gisu');
50
50
  return wikitext.replace(regex, (substr, name, attr, inner, closing, include, includeAttr, includeInner, includeClosing) => {
51
51
  const str = `\0${accum.length}${name ? 'e' : 'c'}\x7F`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wikiparser-node",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "A Node.js parser for MediaWiki markup with AST",
5
5
  "keywords": [
6
6
  "mediawiki",