Automatic <p> and </p> Tags

Post your requests for addons here, and discuss any addons in development here, as well.
Once an addon has completed development, it will be released in the "Addon Release" forum.

Moderator: Spunkmeyer

Automatic <p> and </p> Tags

Postby Gansos » Wed Jul 26, 2006 7:08 am

Coranto can automatically convert line breaks to <br> (or <br />) tags. However, in the up-and-coming world of web standards and CSS, it's often better to enclose paragraphs in <p> and </p> tags.

Furthermore, if you turn off automatic line break conversion, all line breaks are completely removed from the post. So, if I put line beaks between HTML elements in a text field, all the HTML is compacted upon submission. This makes it very hard to modify posts later, as they are difficult to read.

Ideally, these two things could be combined into one addon. The addon would automatically insert <p> and </p> tags around paragraphs, while maintaining any whitespace in between.

Does anyone see enough value in this that they would be interested in developing it? If not, I've written simple addons before, so I may be able to do it myself if I'm pointed in the right direction. By "direction" I mean where in the core this would hook in, and how I might differentiate between the beginning of a paragraph and the end.

Thanks to everyone out there who can lend a hand.
Gansos
 
Posts: 62
Joined: Thu Jan 11, 2007 8:33 pm

Postby Jgold723 » Tue Aug 08, 2006 2:26 pm

This is exactly what I'm looking for. I'd like to be able to turn off the automatic conversion of line breaks in a text field -- but still retain them in the editing mode to make that easier.

Unfortunately, I know nothing about Perl coding, but I'll certainly add my vote for this addon/feature!

John
Jgold723
 
Posts: 63
Joined: Wed Jan 10, 2007 6:44 pm

Postby Parahead » Fri Aug 11, 2006 7:45 pm

Maybe you could use the Search and Replace addon to convert two BR-tags to one </P><P> instead? And encapsulate the Text tag with P-tags, something like this: <P><Field: Text></P>

This way, if you press return twice in the Coranto submit page, that will be treated as a new paragraph. Just a simple suggestion...
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby Gansos » Sat Aug 12, 2006 1:03 am

I suppose that would work.

What would be really cool if is Textile could be made into a Coranto addon. This would give the user many more possibilities to control how body text looks without the need for HTML skills.
Gansos
 
Posts: 62
Joined: Thu Jan 11, 2007 8:33 pm

Postby Parahead » Sat Aug 12, 2006 1:10 pm

gansos wrote:What would be really cool if is Textile could be made into a Coranto addon. This would give the user many more possibilities to control how body text looks without the need for HTML skills.
A small tip. It is always good to provide a link to the tool/script/whatever mentioned in a post, so we know exactly what it is and can do some reading on the subject. I guess it is this?

Personally I think that would be just *another* language to learn, for example here in the forum BBCode is used, so why not an addon that transfer BBCode to HTML? Actually that can be achived with the Search And Replace addon as well, on my own site I use this technique to transfer code & quote-tags (example page).

The two S&R-lines I have to accomplish this is:

search for:
[code]

Replace with:
</P><table width="90%" cellspacing="1" cellpadding="3" border="0"
align="center"><tr><td class="code">

Case Insensitive? true

Search for:
\[\/code\](<br( \/)?>)?

Replace with:
<\/td><\/tr><\/table><P>

Case Insensitive? true
Allow Metacharacters? true


If you would like to create a BBCode (or Textile) addon, it would basically be a matter of taking the S&R addon and bundle it with a bunch of transfers and voíla.
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden


Return to Addon Development and Requests

Who is online

Users browsing this forum: No registered users and 2 guests

cron