Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
mrd_h2t » Convert HTML to TEXT
This container tag will convert the enclosed text from html to text with line breaks. It will also set the base url on any relative links to that of your textpattern site root and add them as footnotes at the bottom of the text.
Credit: This is basically a wrapper around an excellent script by Jon Abernathy. Also Jeremy “igner” Amos, who basically co-wrote this.
Attributes
- columns: an integer to set the maximum width before text wraps, default is 70 eg.
columns="30"
- baseurl: a string to set the base url for all relative links, excluding the ‘http://’ default is Textpattern’s site url eg.
baseurl="yoursite.com"
Example:
The following code…
<txp:mrd_h2t columns="20" baseurl="fruityanimals">
<h4>A subhead</h4>
<p>some nice <strong>sample</strong> text <em>right here</em> with a <a href="/monkey/butt.html">link</a></p>
<p>another paragraph here</p>
</txp:mrd_h2t>
...should result in...
A subhead
some nice sample
text right here with
a link [1]
another paragraph
here
Links
-----
[1] http://fruityanimals.com/monkey/butt.html
Changes
- 0.1 Initial release
- 0.1.1 OK, how about we let the plugin parse tags?
- 0.1.2 Added Attributes columns and baseurl
Last edited by mrdale (2011-03-03 17:17:38)
Offline
Offline
#3 2011-03-02 21:03:24
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: mrd_h2t » Convert HTML to TEXT
Would you like me to replace ‘Moderator’ with ‘Plugin Author’ in your profile? ;)
Oh, and nice plugin :)
Last edited by els (2011-03-02 21:05:12)
Offline
Re: mrd_h2t » Convert HTML to TEXT
Els wrote:
Would you like me to replace ‘Moderator’ with ‘Plugin Author’ in your profile? ;)
nah. that title’s for the big boys and girls.
Offline
Re: mrd_h2t » Convert HTML to TEXT
Updated to include two attributes: columns and baseurl
Last edited by mrdale (2011-03-03 17:14:28)
Offline
Pages: 1