Module:WikitextParser/doc: Difference between revisions

Content deleted Content added
Usage: Improve example
mNo edit summary
Line 27:
* <code>getLead( wikitext )</code> — Returns the lead section from the given wikitext. The lead section is defined as everything before the first section title. May be empty if there's no lead section.
* <code>getSections( wikitext )</code> — Returns the sections from the given wikitext, as a Lua table with the section titles as keys and the section content as values. This method doesn't get the lead section (use <code>getLead</code> for that).
* <code>getSection( wikitext, title )</code> — Returns the content of the section with the given title., Includesincluding subsections. If you don't want subsection, use <code>getSections</code> instead. If the given section title appears more than once, only the first one will be returned. If the section is not found, <code>nil</code> will be returned.
 
For the ultimate documentation, see the source code below.