2025-01-15
Fixed
- Case-insensitive variables without a parameter, e.g.,
{{#language}}
, and case-sensitive parser functions requiring a parameter, e.g.,{{DEFAULTSORT:}}
Changed
- The schema for parser configurations is changed for the
parserFunction
property
2025-01-11
Added
- Named parameters are recognized for the
{{#tag}}
parser function
2024-12-13
Added
- More auto-fix and suggestions for linting errors
Removed
- Removed category of linting errors: duplicated
<ref>
name
2024-12-06
Added
- New category of linting errors: lonely
RFC
/PMID
/ISBN
LintError.Fix
now has a new string propertydesc
Changed
- The preset configurations are updated
2024-12-01
Fixed
Token.prototype.lint
should ignore<ref>
tags with identical names but in different groups
2024-11-29
Added
- New category of linting errors: duplicated
<ref>
name
2024-11-17
Fixed
TranscludeToken.name
for some new parser functions, e.g.,{{#dir}}
2024-11-14
Fixed
AttributeToken.prototype.lint
now correctly reports invalid attribute names of<pre>
tags
2024-11-04
Fixed
- Parse and report extension tags inside
<inputbox>
/<dynamicpagelist>
- Parse transclusion inside
<references>
{{\n=a=\n}}
is now parsed asTemplate:=a=
instead of<p>{{</p><h1>a</h1><p>}}</p>
2024-11-01
Fixed
- Case-insensitive
<nowiki>
inside a<pre>
tag - HTML comments inside a
<inputbox>
tag
Changed
IncludeToken.prototype.lint
now also reports useless attributes
2024-10-24
Added
- New pseudo selectors
:valid
and:scope
- Pseudo selector
:has()
now supports relative selectors Parser.parse
now accepts an array of token types as the third argument to specify the maximum stage of parsing
Fixed
Token.prototype.expand
now supports file names containing꞉
as a substitute for:
in a Windows file system- Order of HTML/URL decoding in
Title
parsing
Changed
AttributesToken.prototype.lint
now reports warnings instead of errors for useless non-word characters
2024-08-24
Fixed
TranscludeToken.prototype.lint
should not report#
in an HTML entity as template page fragment
2024-08-17
Fixed
AttributeToken.prototype.lint
for unknown extension tags, since v1.12.5
2024-08-16
Added
Fixed
AttributesToken.prototype.lint
now correctly reports invalid attribute names containing{{!}}
2024-08-07
Added
HeadingToken.id
- New category of linting errors: duplicated id
Fixed
HeadingToken.prototype.toHtml
should skip language conversion for theid
attributeHeadingToken.prototype.toHtml
when there are more than 3 duplicated IDs- Descendant combinator
Changed
ArgToken.prototype.json
no longer includes thedefault
property
2024-08-04
Fixed
- Fix a rare case of
LinkToken.prototype.toHtml
for the Media namespace
2024-07-29
Added
Title.prototype.getRedirection
methodTranscludeToken.prototype.toHtml
for nonexistent transcluded pages and transclusion loops
Fixed
HeadingToken.prototype.toHtml
now correctly handles headings with duplicated IDs- Remove unnecessary implicit leading newline from
Token.prototype.expand
- Remove unexpected leading space for fostered table content in
TableToken.prototype.toHtml
- A valid title should not contain characters that are escaped as HTML entities twice (e.g.,
&amp;
) Token.prototype.solveConst
for#switch
with a fall-through default caseToken.prototype.solveConst
for#ifeq
when comparing two numbers or strings containing HTML entitiesToken.prototype.toHtml
for various token types that have a bold and/or italic styleRedirectTargetToken.innerText
should replace underscores with spacesTitle.fragment
should replace spaces with underscores- Some Wikitext syntaxes at SOL, including headings and lists, are now allowed following behavior switches except
__toc__
<p>
wrapping forTdToken.prototype.toHtml
- Media namespace redirects
Token.prototype.toHtml
when<blockquote>
interferes with indent-<pre>
AttributeToken.prototype.lint
should also report reserved data attributes
Changed
AstText.prototype.lint
no longer reportslonely-http
forhttp://
inext-link-text
Token.prototype.expand
now removes all comments and expandsArgToken
HeadingToken
now includes trailing blank lines- By turning
Parser.redirects
andTitle.fragment
into accessors, page titles and fragments are now automatically normalized - The second arguments of
AstText.prototype.deleteData
andAstText.prototype.substringData
are now optional - The first item of the
doubleUnderscore
property ofConfig
is nowRecord<string, string>
2024-07-10
Fixed
- Lonely
px
should be considered as caption inImageParameterToken
2024-07-08
Added
<p>
wrapping forToken.prototype.toHtml
- Conversion from Wikitext lists to HTML
ConverterToken.prototype.toHtml
when there are variant flagsConverterFlagsToken.prototype.getEffectiveFlags
when there are variant flagsFileToken.prototype.toHtml
,FileToken.prototype.getFrame
,FileToken.prototype.getHorizAlign
andFileToken.prototype.getVertAlign
ImageParameterToken.prototype.getUrl
Fixed
ExtLinkToken.prototype.toHtml
when there are nested internal linksArgToken.prototype.cloneNode
,AttributeToken.prototype.cloneNode
,AttributesToken.prototype.cloneNode
,GalleryToken.prototype.cloneNode
andMagicLinkToken.prototype.cloneNode
- Implicit newline in
Token.prototype.expand
Token.prototype.expand
for template redirectsTitle.prototype.getUrl
for self links- Definition list parsing since v1.10.0
LinkBaseToken.prototype.toHtml
when wrapped by apostrophesExtLinkToken.prototype.toHtml
andMagicLinkToken.prototype.toHtml
for invalid URLsTitle
parsing with multiple consecutive spaces and/or underscores- Self-closing
<ref>
tags inside a<references>
tag HtmlToken
should not be bold or italicImageParameterToken.size
when the parameter ends withpxpx
ImageParameterToken.link
when containingQuoteToken
- Image parameter parsing for
link=
followed by an invalid external link - Framed images and manual thumbnails are always unscaled
Changed
ListBaseToken.prototype.toHtml
now returns an empty stringListBaseToken.prototype.getRange
now modifies the AST and returns a plain token with the typelist-range
Removed
Token.prototype.redoQuotes
method, which does not work as expected
2024-06-26
Added
AstNode.prototype.is
methodToken.prototype.expand
methodParser.templateDir
propertyConfig.articlePath
propertyTitle.prototype.getUrl
methodRedirectTargetToken.innerText
andMagicLinkToken.innerText
propertiesAstNode.prototype.toHtml
method, which is an incomplete implementation of Wikitext-to-HTML conversion
Fixed
SyntaxToken.prototype.lint
now also reports errors from itschildren
- Parse the
caption
attribute of a<gallery>
extension tag - Fix
LinkToken.prototype.pipeTrick
- Absolute path on Windows in
Parser.config
andParser.i18n
Token.prototype.cloneNode
when applied to aroot
token- Pseudo selector
:any-link
forRedirectTargetToken
AttributesToken.prototype.lint
now reports duplicatedclass
attributes
Changed
LinkBaseToken.prototype.setTarget
now only adds leading:
when necessaryMagicLinkToken.prototype.lint
now only reports the first occurrence of full-width punctuations infree-ext-link
as an errorTranscludeToken.prototype.lint
now ignores the fragment of an invalid module nameToken.prototype.solveConst
now returns a copy of the original tokenMagicLinkToken.prototype.getUrl
now returns a string for ISBN links- Each
ListToken
now contains at most one;
AttributeToken.prototype.getValue
now always trims leading and trailing whitespace
Removed
RedirectTargetToken.prototoype.text
method overridingrbspan
attribute of a<rt>
tag
2024-06-18
Added
AstElement.length
andAstText.length
are now writable
Fixed
- Fix event handling for
DoubleUnderscoreToken
Changed
- No longer report full-width punctuations in
ext-link-url
as an error inMagicLinkToken.prototype.lint
2024-06-10
Fixed
- Fix event handling since v1.9.0
- Fix issues related to
Parser.viewOnly
2024-06-09
Fixed
AstNode.font
,AstNode.bold
andAstNode.italic
for external links which have a lower precedence than apostrophes- Pseudo selector
:any-link
forFileToken
- Pseudo selector
:lang()
- Pseudo selector
:regex()
forAttributesToken
Changed
Token.prototype.normalizeTitle
is now a private methodParser.getConfig
is now available for public use
Removed
- Pseudo selectors
:nth-child
,:nth-last-child
,:nth-of-type
and:nth-last-of-type
no longer support comma-delimited arguments
2024-05-26
Added
- Magic links (RFC, PMID and ISBN) are now parsed as
MagicLinkToken
- New property
Parser.viewOnly
, which helps to speed upAstElement.prototype.lint
Changed
- Improved performance for table parsing inside a template
2024-05-20
Added
- New getters
AstNode.font
,AstNode.bold
andAstNode.italic
Fixed
Token.prototype.findEnclosingHtml
now correctly handles self-closing tags\r
is now automatically removed from EOL for CRLF (\r\n
) line breaks
Changed
Token.prototype.sections
now returns an array ofAstRange
objectsAstNode.nextVisibleSibling
,AstNode.previousVisibleSibling
,AstNode.prototype.destroy
andAstNode.prototype.getLine
were previously only available forAstElement
, but now they are also available forAstText
2024-05-13
Added
- Parse redirect pages
Fixed
- Allow an external image as
ext-link-text
- Ignore duplicated parameters containing extension tags in
TranscludeToken.prototype.lint
- Self-closing tags
<noinclude/>
and<includeonly/>
are now valid
Changed
- For redirects with a fragment, the fragment is now ignored by
Title.title
2024-03-17
Added
- Parser tests are now available
Fixed
- Mimic the structure of CSS combinators
- Fully escape
<
and>
when printing tag attributes - Recognize invalid
Title
patterns - Image size parameter with a suffix of
pxpx
is now also valid - Fix conflicts between image parameters and external links
- Fix free external links led by a Unicode character
Changed
- Error messages are gradually translated into English
2024-03-13
Added
- Linting errors can now be disabled using inline comments
Fixed
- Allow the image parameter
page
in PDF file links - Disallow empty strings as the
manual-upright
image parameter - Use
parseInt()
for therowspan
andcolspan
properties ofTdToken
Changed
- The start position of a linting error associated with a
TrToken
is now one character ahead
2024-03-12
Fixed
TableToken.prototype.lint
now ignores inconsistent table layout due to a largecolspan
value in the last column
Changed
- Lowered severity of ignored lines due to no image in
GalleryToken.prototype.lint
2024-03-07
Fixed
- Parsing a
TdToken
after anotherTdToken
with a multilineHtmlToken
in it ExtLinkToken
when the link text starts with a token with higher precedence
Changed
Title.fragment
no longer decodes the deprecated MediaWiki-style fragment encoding
2024-03-06
Fixed
ListToken.prototype.getRange
for<dt>
items
Changed
- Attribute selectors now regard falsy values as non-existent attributes
HeadingToken.innerText
andTdToken.innerText
now trim leading and trailing whitespace, whileLinkToken.innerText
trims leading whitespace only
Removed
ImagemapToken
no longer overrides thelinks
getter
2024-03-05
Fixed
- Ignore most invalid Wikitext syntax nested in a
PreToken
when linting
2024-03-03
Added
- New getter
FileToken.extension
Fixed
DdToken
is now correctly parsed whenQuoteToken
is present in the same line- Improved
ImageParameterToken
validation for different file extensions - Ignore incomplete Wikitext syntax in
before
andafter
attributes of a<choose>
extension tag when linting
2024-02-29
Added
- New property
rules
of the interfaceParser
Fixed
Changed
filter
in thestyle
attribute is no longer reported as an error
Removed
- Token type aliases have been malfunctioning since v1.4.3, and are now removed
2024-02-22
Added
- Auto-fix and suggestions for selected linting errors
Removed
AstElement.prototype.echo
method
2024-02-12
Added
- New property
rule
of the interfaceLintError
2024-02-04
Added
- New category of linting errors: inconsistent table layout
Fixed
- Inconsistent output from
AttributesToken.prototype.print
Changed
HtmlToken.prototype.print
andImageParameterToken.prototype.print
do not differentiate invalid tokens any moreHtmlToken.prototype.text
now treats void tags as self-closing tags
2024-01-31
Added
- New field
range
in the return value ofAstElement.prototype.json
Fixed
- Missing type declarations for
ExtLinkToken.firstChild
andConverterToken.firstChild
are added
2024-01-29
Fixed
AstText.prototype.lint
no longer reports warnings for matched single brace or bracket
2024-01-27
Added
- New category of linting errors:
<ref>
or external links without specified text inHeadingToken
- New preset configuration
enwiki
for English Wikipedia
Fixed
Changed
- Reported duplicated categories do not need to be child nodes of the same parent node
- Better recognition of bracket pair (
[]
) that actually breaks theExtLinkToken
2024-01-23
Added
- Linting errors for
LinkToken
are now also reported fromCategoryToken
andFileToken
where applicable - New category of linting errors: duplicated categories, and bold (either
QuoteToken
orHtmlToken
) inHeadingToken
Fixed
- Type declarations
2024-01-22
Added
- New categories of linting errors, including obsolete HTML tags and attributes, internal links in external links, and unmatched
QuoteToken
inside aHeadingToken
- New properties for
QuoteToken
:bold
anditalic
Fixed
Parser.isInterwiki
now returnsnull
if no interwiki prefix is found from the configuration- Title starting with multiple colons is invalid
2024-01-21
Changed
AstElement.prototype.json
now recordsAstText
as an object instead of a plain string, and some getter properties includingArgToken.default
,HeadingToken.level
,HtmlToken.closing
,HtmlToken.selfClosing
,ParameterToken.anon
,TableToken.closed
, andTdToken.subtype
are now supported
2024-01-19
Fixed
- Trailing whitespace as the last
ConverterRuleToken
is now allowed
Changed
- Double pipes in
TdToken
will now report an'error'
instead of a'warning'
2024-01-17
Changed
AttributesToken.prototype.setAttr
now also accepts an attribute object as argument
2024-01-16
Fixed
- Case-insensitive magic variables like
{{server}}
startIndex
andendIndex
ofMagicLinkToken.prototype.lint
2024-01-15
Fixed
- A case-sensitive parser function requires a colon after the function name
- External links like
[[//xyz]]
- Invalid closing void HTML tag except
</br>
2024-01-15
Added
- Reporting unclosed
IncludeToken
- Reporting lonely
<onlyinclude>
,<noinclude>
and<includeonly>
- Reporting errors such as
<pre>
insidePreToken
2024-01-14
Fixed
- Parsing an illegal template name, e.g.,
{{#if:{{<}}}}
2024-01-11
Changed
- Ingoring
'http'
in tag attribute values when linting
Removed
excerpt
field inLintError
2024-01-04
Fixed
- Allowing
<
and>
in the fragment of an internal link
Changed
HiddenToken
child nodes ofGalleryToken
are replaced byNoincludeToken
- The pseudo selector
:invalid
now reports invalidImageParameterToken
instead of redundant child nodes ofArgToken
Removed
- Pseudo selectors
:read-only
and:read-write
2024-01-03
Fixed
- Fully localized message in
LintError
2023-12-19
Fixed
- Magic words
!
and=
are now required in parser configurations
2023-12-18
Added
- New methods
AstText.prototype.escape
,ParameterToken.prototype.escape
andMagicLinkToken.prototype.escape
Fixed
- Removing unexpected
remove
andinsert
events dispatched byToken.prototype.safeReplaceWith
{{!}}
and{{=}}
can be part of an external link now
Changed
- Inserting a child node is now forbidden
2023-12-16
Fixed
- Fixing
Token.prototype.sections
since v1.1.2
Changed
Token.prototype.findEnclosingHtml
now returns anAstRange
object
2023-12-13
Changed
- Token type
converter-rule-noconvert
now regarded asconverter-rule-to
- Anonymous parameters will remain anonymous after
ParameterToken.prototype.setValue
Removed
HeadingToken.name
property
2023-12-11
Changed
getAttr
as the preferred method for attribute selector
2023-12-11
Added
- New properties and methods for
Title
objects:extension
,toSubjectPage
,toTalkPage
,isTalkPage
,toBasePage
,toRootPage
Fixed
- Wrapping the text after the last
</onlyinclude>
in aNoincludeToken
- Replacing remaining spaces in
Title.title
property with underscores AstRange
now maintains its content afterinsertNode
,deleteContents
,extractContents
andcloneContents
methods
Changed
startContainer
andendContainer
properties ofAstRange
must be siblings now
Removed
AstRange.prototype.intersectsNode
method
2023-12-05
First TypeScript version