[pmwiki-users] Numbered lists and multi-paragraph

Patrick R. Michaud pmichaud at pobox.com
Wed Jul 27 02:25:44 CDT 2005


On Tue, Jul 26, 2005 at 09:40:49PM -0400, DaveG wrote:
> : > Still not sure what's happening in this case:
> : >  # Line 1 \\
> : >  Attach:abc.jpg \\
> : >  # Line 2
> 
> : A backslash at the end of a line "joins" the subsequent line to the
> : previous one.  Extra backslashes introduce line breaks.  So, the
> : two slashes after the image above cause # Line 2 to be treated as
> : a continuation of Line 1, which isn't what you want.
>   
> Not sure your description is totally accurate. The \\ joins the subsequent
> line, but is primarily used when you want a styling affect to carry from
> the first to the second line, rather than to merely merge to lines. If you
> simply enter a single carriage return, the lines join together, no \\
> required:
>    abc
>    def

This is true for paragraphs, but not for lists.  If one does

    # Line 1
    Line 2

then "Line 2" is not a continuation of the list item on the previous
line.  To get it to continue one uses

    # Line 1 \
    Line 2

and to insert a carriage return one does

    # Line 1 \\
    Line 2

>    This is confusing, particularly with images:
>    abc
>    Attach:image.jpg

This may change now given the previous discussion about image
handling.  :-)

>    Newbie members at my site frequently hit a single cr at the end of a line,
>    only to have it join back to the originating line. Why not just do a <br>
>    on a single cr, and use the \\ to span styles over lines, and thus
>    eliminate \\\? I suspect there's plenty of history I'm missing here... :)

You're correct, there's been a *ton* of history and discussion on this
topic, with no clear majority opinion.  Some people want a carriage 
return to always produce a break, while others prefer PmWiki's current 
behavior that consecutive lines of paragraph text are automatically 
joined together.  Both sides are perfectly valid (and in fact PmWiki 
supports both, as we'll see in a moment).

The argument in favor of automatically joining is that it's very hard
to see carriage returns in text, and just as in email, a sequence of
consecutive lines *looks* like a single paragraph and so perhaps it
should be rendered as one.  In fact, when writing email and PmWiki 
pages I tend to add carriage returns every 60 characters or so even 
though they aren't strictly necessary, just because it looks 
better on my tty interface than having the very long lines.  The
downside to this is that it's not always obvious how to get a line
break that isn't a paragraph, and so one has to learn the \\ markup.

The argument in favor of converting carriage returns into line breaks
is that what the user types is exactly what they get.  Unfortunately,
this can produce really long lines in some edit forms, and it's not
always easy to see where the carriage returns are.  Plus, if one is
pasting a series of lines of text from another source into a PmWiki
page, it can be really annoying and difficult to go through and remove
all of the newlines in the middle of paragraphs.

The sides in the discussion have consistently been so evenly balanced 
that I tipped the decision to PmWiki's current choice based on
   - PmWiki's history
   - This was the approach most commonly used by other popular wikis
     at the time (especially Wikipedia)
   - Personal preference
So, that's where we are.

However, one is not entirely stuck with this choice; the recipe at
http://www.pmwiki.org/wiki/Cookbook/LineBreaks shows how to switch
to having carriage returns insert breaks.  It also provides (:linebreaks:)
and (:nolinebreaks:) directives which can be used to switch from one
mode to the other in the middle of a page.

Pm




More information about the pmwiki-users mailing list