≡

wincent.dev

  • Products
  • Blog
  • Wiki
  • Issues
You are viewing an historical archive of past issues. Please report new issues to the appropriate project issue tracker on GitHub.
Home » Issues » Bug #1690

Bug #1690: Multiple blank lines render as a single line

Kind bug
Product wikitext
When Created 2010-09-12T15:35:42Z, updated 2010-09-14T06:45:58Z
Status open
Reporter anonymous
Tags no tags

Description

Again, same disclaimer applies to this admittedly lame bug report.

What I expect: In mediawiki, if I put multiple blank lines (containing no printable/visible characters followed by a carriage return), each line gets parsed to a <br /> element.

What happens: In your wikitext library, they get collapsed to a single line.

My users are affected by this divergence from the reference implementation, even though it's fairly trivial.

Comments

  1. Greg Hurrell 2010-09-12T18:01:32Z

    Out of interest, what's the use case here? I personally can't see myself ever needing this, but if you could explain a bit why this is a useful thing then I'd be willing to consider adding it.

  2. Greg Hurrell 2010-09-12T18:12:41Z

    Just headed over to Wikipedia and did a quick test. Multiple consecutive blank lines are actually getting translated into <p></p> spans, each containing a <br /> tag;

    ie (one blank line):

    hello
    
    world

    And (two blank lines):

    hello
    
    
    world

    Both get marked up as:

    <p>hello</p>
    
    <p>world</p>

    But (three blank lines):

    hello
    
    
    
    world

    Gets marked up as:

    <p>hello</p>
    
    <p><br /></p>
    
    <p>world</p>
  3. anonymous 2010-09-14T01:42:53Z

    The biggest case I can make for it is the adherence to the mediawiki behavior. (Thanks for looking at it, and sorry to have glossed over the details you outlined above).

    An example of where my end users try to use it is when there is a floating image on the right side of a section, with text in normal flow on the left. The text doesn't reach the bottom of the image before the next ==h2== section starts. As a result, the section heading "runs into" the image.

    It seems intuitive to the users that adding blank lines prior to the section heading would "move it down", and it feels unresponsive when it doesn't.

    Attempted illustration where you might want to move a section down:

    ==Example==
    Lorem ipsum dolor sit amet,   +-------------+
    consectetur adipiscing elit.  |             |
    Pellentesque suscipit, augue  |             |
    sit amet sollicitudin         |             |
    pellentesque, mi libero       |             |
    lacinia dui, non lacinia      |             |
    risus nulla ac massa. Sed     |             |
                                  |             |
                                  |             |
    ==second h2 element==         |             |
                                  |             |
                                  |             |
                                  |             |
                                  +-------------+
    
  4. Greg Hurrell 2010-09-14T06:45:50Z

    Ok, seems like a fair enough use case. Going to mark this one as "open" and will check out if it can be implemented without too many invasive changes to the parser.

  5. Greg Hurrell 2010-09-14T06:45:58Z

    Status changed:

    • From: new
    • To: open
Add a comment

Comments are now closed for this issue.

  • contact
  • legal

Menu

  • Blog
  • Wiki
  • Issues
  • Snippets