Creates a new listing object.
Additional data about the page
Optional
listingPage: CopyrightProblemsPageThe page that this listing is on. This is not necessarily the page that the listing's wikitext is on, nor is it necessarily the root page.
A discriminator used to avoid collisions when a page is listed multiple times.
The listing page that this listing belongs to.
an ID representation of this listing. Helps in finding it inside of wikitext.
Static
articleResponsible for determining listings on a page. This method allows for full-metadata listing detection, and makes the process of detecting a given listing much more precise.
This regular expression must catch three groups:
*
, used to keep the correct number of whitespace between parts.id="..."
, ONLY IF the page is listed with an
article-cv
-like template.article-cv
-like template.article-cv
.A regular expression.
Gets the line number of a listing based on the page's wikitext. This is further used when attempting to insert comments to listings.
This provides an object with start
and end
keys. The start
denotes
the line on which the listing appears, the end
denotes the last line
where there is a comment on that specific listing.
Use in conjunction with listingPage.getWikitext()
to get the lines in wikitext.
See documentation body.
Serialize this listing. Used for tests.
Static
getA much more loose version of CopyrightProblemsListing#getListing,
which only checks if a given page is a link at the start of a paragraph or
<[uo]l>
list. Metadata is unavailable with this method.
Data related to the listing, for use in instantiation; false
if not a listing.
Static
getDetermines if a given element is a valid anchor element (<a>
) which
makes up a "listing" (a page for checking on the Copyright Problems page).
Detection is based on the {{article-cv}} template. Changes to the template must be reflected here, with backwards compatibility for older listings. The {{anchor}} is not the tracked element here, since it remains invisible to the user.
Data related to the listing, for use in instantiation; false
if not a listing.
Represents an existing copyright problems listing. To add or create new listings, use the associated functions in CopyrightProblemsPage.