Page MenuHomePhabricator

Add <form> to list of non-paragraph-mode tags
Open, LowPublic

Description

Author: ahel

Description:
Add <form and </form to $openmatch and $closematch, respectively, in Parser.php

Currently, users of SimpleForms cannot produce pages that validate. The reason is that the form tag is forced by the parser into paragraph mode. The <form> tag isn't allowed inside paragraphs. Moreover, the paragraph tag also ends up being closed incorrectly. Here's a slightly doctored example:

{{#form:
{{#input: type = hidden | name = title | value = Completed form}}
{{#input: type = hidden | name = formmailer | value = formmailer}}
{{{!}}
! align=right {{!}} Test:
{{!}} {{#input: type = text | name = test }}
{{!}}}
}}

With the 1.11.0 MediaWiki, I get this:

<p>
<form action="/blah" id="sf-47a8f52225ef1"><input type="hidden" name="title" value="Completed form"/>
<input type="hidden" name="formmailer" value="formmailer"/>
</p>

<table> <tr> <th align="right"> Test: </th><td> <input type="text" name="test"/> </td></tr></table></form> That's not valid HTML. With the fix (see attachment), I get this: <form action="/~lesha/us13/index.php" id="sf-47a8fd25c4e8f"><input type="hidden" name="title" value="Completed form"/> <input type="hidden" name="formmailer" value="formmailer"/> <table> <tr> <th align="right"> Test: </th><td> <input type="text" name="test"/> </td></tr></table></form> I think this fix shouldn't have any negative side effects. -------------------------- **Version**: 1.11.x **Severity**: minor //attachment mediawiki-form-patch ignored as obsolete//

Details

Reference
bz12932

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:07 PM
bzimport set Reference to bz12932.
bzimport added a subscriber: Unknown Object (MLST).

sumanah wrote:

ahel, thank you for the patch. I'm sorry, but in the time since you provided
your patch, MediaWiki's codebase has changed enough that your patch no longer
applies cleanly to trunk. Therefore I'm marking it obsolete and removing the
"need-review" and "patch" keywords.

We are currently working on a rewrite of the parser, so I'm cc'ing Gabriel Wicke, who is working on that. If the <form> issue is still one you're interested in working on, please join us in IRC
https://www.mediawiki.org/wiki/MediaWiki_on_IRC and talk with other developers -- maybe you can help with the rewrite. Thanks for your interest in improving MediaWiki!

sumanah wrote:

Comment on attachment 4618
Add <form and </form to $openmatch and $closematch, respectively, in Parser.php

This patch no longer applies to trunk per Rusty Burchfield's automated testing
https://docs.google.com/spreadsheet/ccc?key=0Ah_71HHl7qa7dGtvSms3TGpHQU9NU2Y1VmNzUEUteWc
.