Block-level {for} tokens before a paragraph get pulled into preceding blank paragaphs

VERIFIED FIXED in 2.3.2

Status

support.mozilla.org
Knowledge Base Software
P3
normal
VERIFIED FIXED
8 years ago
8 years ago

People

(Reporter: erik, Assigned: erik)

Tracking

unspecified
2.3.2

Firefox Tracking Flags

(Not tracked)

Details

(Assignee)

Description

8 years ago
Failing test:

    def test_leading_newlines(self):
        """Make sure leading newlines don't cause a block-level {for} to be
        sucked into the leading blank paragraph, causing the actual text to
        always be shown."""
        doc = pq(WikiParser().parse('\n\n{for linux}\nunixify\n{/for}'))
        eq_('unixify', doc('.for').text().strip())
(Assignee)

Comment 1

8 years ago
It's the explicit paragraph padding adding in strip_fors: it turns
u'\n\n\x070\x07\nunixify\n\x07/sf\x07' into
u'\n\n\x070\x07\n\nunixify\n\x07/sf\x07'.

It'll take some thought to figure out what the right thing is to do there.
Assignee: nobody → erik
Target Milestone: 2.3.1 → 2.3.2
Target Milestone: 2.3.2 → 2.4.1
(Assignee)

Comment 2

8 years ago
Fixed on master (https://github.com/jsocol/kitsune/commit/09c452b88d2f29189047e10bde04581278c54b28) and 2.3.x (https://github.com/jsocol/kitsune/commit/2e812b1e2ddfa55f71d26543b8bdd4bb0d4aef81).

To test:
Try rendering some wiki markup like this (without the quotes):
"


{for mac}
Here is some stuff.
{/for}
"

If it's still broken, "Here is some stuff." will always show, no matter what OS you select from the sidebar menu.
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
Target Milestone: 2.4.1 → 2.3.2
Verified fix-ed
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.