[Pmwiki-users] discussion on line breaks

Patrick R. Michaud pmichaud
Wed Jul 16 12:41:01 CDT 2003


Several people have remarked on this listserv and in other communications
about the meaning of line breaks in markup text, as well as the ugly
[[<<]] markup for adding line breaks in the output.

I have a few ideas on this topic that I want to present to the group for 
discussion.  Note that at the moment I'm doing this only for 
brainstorming/discussion purposes--I'm not necessarily intending to 
change anything along these lines.  I just want to solicit opinions
from the group and gauge interest.

Currently, PmWiki combines consecutive lines of text that don't have
leading markup into a single paragraph.  Thus, if someone enters markup
text as

    Knowing others is intelligence;
    knowing yourself is true wisdom.
    Mastering others is strength;
    mastering yourself is true power.

then PmWiki currently renders this as 

    Knowing others is intelligence; knowing yourself is true
    wisdom. Mastering others is strength; mastering yourself
    is true power.

The reason that PmWiki works this way is largely historical--I was
trying to keep PmWiki similar to other wiki engines and this is how
they worked.  But over time I've been refining the principle that
the output text ought to look something like the markup source, and
clearly that is not what happens here.  In PmWiki's current implementation,
if someone wants the phrases above to appear on separate lines they must 
enter something like
    
    Knowing others is intelligence;
    [[<<]]knowing yourself is true wisdom.
    [[<<]]Mastering others is strength;
    [[<<]]mastering yourself is true power.

which I think everyone agrees looks pretty awful.

So, one idea that I've been playing with is the notion that newlines 
occurring between two text lines could be treated as line breaks in the 
output.  Blank lines would still be used to create paragraph breaks, as
before, newlines would still mark the end of list items, and newlines
could be still escaped using \ at the end of a line.  Thus markup of

    one
    two

    three
    four

would display that way on output.

Another idea is to introduce a new markup, say [/.../], that has the
sole purpose of grouping multiple lines together into a single line
for block-level formatting purposes but continuing to honor embedded
markup.  For example, the markup text

    # This is item 1
    # [/This is item #2 with
    item text that
    contain line breaks, italics, bold, links,

    and paragraph breaks and still be 
    within the same item./]
    # This is item 3

could then render as

    1. This is item 1
    2. This is item #2 with
       item text that
       contain line breaks, italics, bold, links,

       and paragraph breaks and still be 
       within the same item.
    3. This is item 3

Or, we could take a completely opposite approach, and use a markup such
as [/.../] to mean ignore intervening newlines entirely, as in

    one
    two

    three

    [/four
    five 

    six/]

which would render as 

    one
    two

    three

    four five six


Or, we could look at other combinations.

I'm very interested to hear opinions on:
  - does any of this make sense?
  - would it pose any real problems for existing installations?
  - is it too radical a change?
  - are there other considerations I haven't thought about?

This is just an exploratory discussion for the moment, but it could rapidly
lead to an implementation if I hear good consensus or strong demand for
something like this.  And I'm not really wanting to aim towards even more
drastic changes in the overall markup strategy--this one just seems like
it might be worthwhile.

Comments and discussion can be made to the listserv, or sent to me via
private email.  Thanks in advance!

Pm



More information about the pmwiki-users mailing list