Take into account spans.

git-svn-id: http://textpattern.googlecode.com/svn/development/4.x@5306 2fea6a4d-a838-0410-917b-93a53c48e9d2
Last, not first.

git-svn-id: http://textpattern.googlecode.com/svn/development/4.x@5307 2fea6a4d-a838-0410-917b-93a53c48e9d2
Rogue semicolon.

git-svn-id: http://textpattern.googlecode.com/svn/development/4.x@5308 2fea6a4d-a838-0410-917b-93a53c48e9d2
Renders extra LF when no pages are present.

git-svn-id: http://textpattern.googlecode.com/svn/development/4.x@5309 2fea6a4d-a838-0410-917b-93a53c48e9d2