Tests about vertical space (vspace)


Vspace?disablevspace=1

Heading

This is a test.

This is a test.

Heading

This is a test.

This is a test.

Heading

This is a test.

This is a test.

Heading

This is a test.

Heading

This is a test.

This is a test.

Information from earlier discussions:

http://thread.gmane.org/gmane.comp.web.wiki.pmwiki.user/22917/focus=23047

">Why was <p class="vspace"> introduced in PmWiki?

Because HTML is broken. If you put the margins onto the <p> elements themselves, then it becomes very difficult to get lists and other block elements to appear adjacent to paragraphs."

From PITS:00783 "...headings would ignore a blank line that follows, such that a paragraph following a heading doesn't get 'vspace' unless there are at least two blank lines ahead of it. The purpose of this is to allow the vertical space between a heading and its subsequent paragraph to be smaller than the vertical space between paragraphs..."

Test cases

Paragraph 1

Paragraph 2

List "heading"

  • The first list item should have the
  • same vertical distance to the "heading"
  • as following list items to each other

List end

List "heading"

  • The first list item should have the
  • same vertical distance to the "heading"
  • as following list items to each other

List end

Heading

Text directly following a heading

Another heading

one blank line between heading and text

One more heading

two blank lines between heading and text. This produces slightly more vertical space, where is this documented? Is there any real world use of this feature? I consider this somewhat surprising.

Heading following a paragraph directly without a blank line

Heading

  • List directly
  • following a heading

Tests with tables

  • listitem_1
  • listitem_2
  • listitem_3

This paragraph should contain a word wrap so we need some nonsense test here. This paragraph should contain a word wrap so we need some nonsense test here. This paragraph should contain a word wrap so we need some nonsense test here.

  • listitem_4
  • listitem_5
  • listitem_6

forced
line break
in para

  • listitem_7
  • listitem_8
  • listitem_9

Paragraph 1

Paragraph 2

 0: 00.00 00.00 config start
 1: 00.01 00.00 config end
 2: 00.05 00.02 MarkupToHTML begin
 3: 00.09 00.04 ReadApprovedUrls SiteAdmin.ApprovedUrls begin
 4: 00.10 00.04 ReadApprovedUrls SiteAdmin.ApprovedUrls end
 5: 00.18 00.08 MarkupToHTML end
 6: 00.18 00.08 MarkupToHTML begin
 7: 00.21 00.09 MarkupToHTML end
 8: 00.21 00.09 MarkupToHTML begin
 9: 00.22 00.10 MarkupToHTML end
10: 00.22 00.10 now
Peak memory: 3,115,048 bytes