Module:HTMLParse/doc: Difference between revisions

838 bytes added ,  19:48, 4 September 2019
m
no edit summary
mNo edit summary
mNo edit summary
Line 3: Line 3:
This module parses and manipulates HTML strings.
This module parses and manipulates HTML strings.


There is currently 2 functions:
There is currently 3 functions:
* pluralize
* pluralize
* make_possessive
* make_possessive
* strip_formatting




Line 34: Line 35:
== make_possessive ==
== make_possessive ==
Identical to <code>pluralize</code> except that instead of inserting an <code>s</code>, make_possessive inserts an <code>'s</code>
Identical to <code>pluralize</code> except that instead of inserting an <code>s</code>, make_possessive inserts an <code>'s</code>
== strip_formatting ==
Strips HTML tags from the input string. For example, <pre><span style="color:red;">help!</span></pre> becomes <pre>help!</pre>
Example:
<pre>{{#invoke: HTMLParse | make_possessive | html = <span style="color: #d74200;">c</span><span style="color: #cfc041;">r</span><span style="color: #00c420;">a</span><span style="color: #0096ff;">y</span><span style="color: #da5bd6;">o</span><span style="color: #77bfcf;">n</span><span style="color: #FFFFFF;">s</span> }}</pre>
Result:
{{#invoke: HTMLParse | make_possessive | html = <span style="color: #d74200;">c</span><span style="color: #cfc041;">r</span><span style="color: #00c420;">a</span><span style="color: #0096ff;">y</span><span style="color: #da5bd6;">o</span><span style="color: #77bfcf;">n</span><span style="color: #FFFFFF;">s</span> }}
<includeonly>
<includeonly>
<!-- Template categories/interwiki here -->
<!-- Template categories/interwiki here -->