Page MenuHomePhabricator

Allow Blockedtext start with == heading ==
Closed, ResolvedPublic

Description

Author: Li-sung

Description:
line break before message Blockedtext

Message Blockedtext cannot start with == heading ==, it is rendered as "==".

I guess adding line break before message is inserted can fix this.


Version: 1.12.x
Severity: minor

Attached:

Details

Reference
bz13000

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.

Event Timeline

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

Proposed patch is insufficient; these permission errors are formatted in such a way that they *need to* be treated as single lines.

If there's only one, it's wrapped in a <div>; multiples are wrapped in <li>s in a <ul> bullet list.

If it were correct to allow block formatting (such as headers), then the whole function needs to be ripped out and totally rewritten.

That's probably a good idea then :D - since the few major wiki's I've checked all have headings, div's, tables and what not in MediaWiki:Blockedtext.

Krinkle

Though the cause of the rendering not happening might not be the cause of the (absence of a) linebreak, since on those few major wiki's it is just fine.

See also https://bugzilla.wikimedia.org/show_bug.cgi?id=22806 where I have an issue that might be related.

The newline from the patch was added in r50976. Is that a possible fix?

*Bulk BZ Change: +Patch to open bugs with patches attached that are missing the keyword*

sumanah wrote:

Li-sung, thanks for the patch. Do you have time and interest in updating it and revising it in accordance with the suggestions you've received in comments?

The wanted newline is in the code now. Considering this issue closed.

OutputPage.php:

2193 if ( count( $errors ) > 1 ) {
2194 $text .= '<ul class="permissions-errors">' . "\n";
2195
2196 foreach( $errors as $error ) {
2197 $text .= '<li>';
2198 $text .= call_user_func_array( array( $this, 'msg' ), $error )->plain();
2199 $text .= "</li>\n";
2200 }
2201 $text .= '</ul>';
2202 } else {
2203 $text .= "<div class=\"permissions-errors\">\n" .
2204 call_user_func_array( array( $this, 'msg' ), reset( $errors ) )->plain() .
2205 "\n</div>";
2206 }