Module:WikitextParser/doc: Difference between revisions

Content deleted Content added
Document more methods
 
(6 intermediate revisions by the same user not shown)
Line 89:
<code>getTags( wikitext )</code>
 
Returns a table with each value being a tag and its contents (like <nowiki><div></nowiki>, <nowiki><gallery></nowiki>, <nowiki><ref></nowiki>, <nowiki><noinclude></nowiki>) including its contents. Tags inside tags will be skippedignored. If you're interested in getting them too, run this method again for each of the returned tags.
 
==== getTagName ====
Line 113:
<code>getReferences( wikitext )</code>
 
Returns a table with each value being a reference. This includes self-closing references (like <code><nowiki><ref name="foo" /></nowiki></code>) as well as full references.
 
==== getTables ====
Line 121:
Returns a table with each value being a wiki table.
 
==== getTableIdgetTableAttribute ====
 
<code>getTableIdgetTableAttribute( tableWikitext, attribute )</code>
 
Returns the idvalue of an attribute in the given wiki table. For example the id or the class.
 
==== getTableByIdgetTable ====
 
<code>getTableByIdgetTable( wikitext, id )</code>
 
Returns the wiki table with the given id. If not found, nil will be returned.
Line 143:
<code>getLinks( wikitext )</code>
 
Returns a Lua table with each value being a wiki link. For external links, use [[#getExternalLinks|getExternalLinks]] instead.
 
==== getFileLinks ====
Line 167:
<code>getExternalLinks( wikitext )</code>
 
Returns a Lua table with each value being an external link. For internal links, use [[#getLinks|getLinks]] instead.
 
== See also ==