Creates a new Wikitext
instance.
Usage:
const wikitext = new mwbot.Wikitext('Some wikitext');
A wikitext content.
Returns a list of valid HTML tag names that can be used in wikitext.
Set of tag names (all elements are in lowercase).
Checks whether a given tag name is valid in wikitext.
The tag name to check.
A boolean indicating whether the tag name is valid.
A wikitext content.
Creates a new instance by fetching the content of the given title.
Example:
const wikitext = await mwbot.Wikitext.newFromTitle('Foo').catch((err: MwbotError) => err);
if (wikitext instanceof MwbotError) {
console.error(wikitext);
return;
}
// Example for parsing the sections of the page 'Foo'
const sections = wikitext.parseSections();
The page title, either as a string or a Title instance.
Optional
requestOptions: MwbotRequestConfigOptional HTTP request options.
A Promise resolving to a new Wikitext
instance.
This interface defines the static members of the
Wikitext
class. For instance members, see Wikitext (defined separately due to TypeScript limitations).This class is accesible via Mwbot.Wikitext.