[pmwiki-users] Word wrap problem

Patrick R. Michaud pmichaud at pobox.com
Wed Apr 20 10:03:21 CDT 2005


On Wed, Apr 20, 2005 at 03:39:45PM +0100, Hans wrote:
> Wednesday, April 20, 2005, 3:08:14 PM, Radu wrote:
> > Even better would be to automatically color-code different levels of reply
> > text, or even name-tag them, if the name tags are consistently recognizable
> > in strings like
> > "At 04:52 PM 4/19/2005, Sivakatirswami wrote:"
> 
> That was precisely my thinking, so I created buttons for the edit
> window to apply custom styles to selected paragraphs, giving various
> background colors. See:
> http://www.pmwiki.org/wiki/Cookbook/GuiEdit
> 
> I hope Patrick still comes up with a magic function for a button to
> remove leading spaces from paragraphs, then tidying up and adding
> special styling to emails etc should be easy.

It's low priority for me at the moment, because I don't think
tidying up in this manner will be easy.  And if someone is already
going through the trouble of adding the special styles, then
removing the leading spaces from the paragraphs is no longer an
issue and gets in the way.

For example, consider markup that after pasting from email
looks like

    Here is some text.  Lorem ipsum dolor sit amet, consectetuer 
    adipiscing elit. Etiam vel nulla eu purus convallis feugiat. 

    Nulla facilisi.

        Quisque suscipit lectus pulvinar lectus. 

    Vestibulum adipiscing risus. Suspendisse magna orci, 
    auctor sed, feugiat vel, ullamcorper ac, wisi.

        Integer lobortis justo vitae nulla. Donec nec sem.

    Pellentesque aliquet aliquam lacus. Sed vel arcu eget 
    quam varius malesuada.

where the "Quisque suscipit..." and "Integer..." represent a reply or 
quoted text of some sort that have been indicated by indentation.  
(Of course, how do we know that?  Perhaps these lines were indented 
in the original.)

If we just remove the leading spaces, we're left with

    Here is some text.  Lorem ipsum dolor sit amet, consectetuer 
    adipiscing elit. Etiam vel nulla eu purus convallis feugiat. 

    Nulla facilisi.

    Quisque suscipit lectus pulvinar lectus. 

    Vestibulum adipiscing risus. Suspendisse magna orci, 
    auctor sed, feugiat vel, ullamcorper ac, wisi.

    Integer lobortis justo vitae nulla. Donec nec sem.

    Pellentesque aliquet aliquam lacus. Sed vel arcu eget 
    quam varius malesuada.

and now it's not at all obvious, even to the editor doing the work, 
which lines are the quoted ones, or where the styles should be placed.  
But if we're going to be placing styles here anyway, there's no 
need to get rid of the spaces -- simply place the cursor at the 
beginning of the indented lines and insert the desired wikistyle, 
as in:

    Here is some text.  Lorem ipsum dolor sit amet, consectetuer 
    adipiscing elit. Etiam vel nulla eu purus convallis feugiat. 

    Nulla facilisi.

    %s1%    Quisque suscipit lectus pulvinar lectus. 

    Vestibulum adipiscing risus. Suspendisse magna orci, 
    auctor sed, feugiat vel, ullamcorper ac, wisi.

    %s1%    Integer lobortis justo vitae nulla. Donec nec sem.

    Pellentesque aliquet aliquam lacus. Sed vel arcu eget 
    quam varius malesuada.

Since the lines no longer begin with spaces, they're no longer
preformatted, which is what was desired in the first place.  And
inserting the wikistyle could be made easier on the editor via a 
GUI button or keyboard shortcut.

In short, I don't think we need a button to remove spaces from the 
beginnings of lines.

Pm



More information about the pmwiki-users mailing list