breaks lists in CharInsert
Open, Needs TriagePublic

Description

There is a bug with new line support in CharInsert extension (or with MediaWiki itself) in which it breaks list items if you try to use &#10; in <charinsert> in them. Right now this is a recommended method to add line breaks into CharInsert output:

Use &#10; to add new lines (\n).
https://www.mediawiki.org/wiki/Extension:CharInsert#Notes

Example:

* <charinsert><nowiki>== Литература ==&#10;</nowiki></charinsert>
* <charinsert><nowiki>== Ссылки ==&#10;</nowiki></charinsert>

Produces following in HTML:

<ul>
<li><a href="#" data-mw-charinsert-start="== Литература ==
" data-mw-charinsert-end="" class="mw-charinsert-item">== Литература ==</a></li>
</ul>
<p><a href="#" data-mw-charinsert-start="== Литература ==
" data-mw-charinsert-end="" class="mw-charinsert-item"></a></p>
<ul>
<li><a href="#" data-mw-charinsert-start="== Ссылки ==
" data-mw-charinsert-end="" class="mw-charinsert-item">== Ссылки ==</a></li>
</ul>
<p><a href="#" data-mw-charinsert-start="== Ссылки ==
" data-mw-charinsert-end="" class="mw-charinsert-item"></a></p>

Maybe it is an error related to https://meta.wikimedia.org/wiki/Help:HTML_in_wikitext#.3Cdiv.3E

This bug can be reproduced both with and without JavaScript, so it is server-side.

stjn created this task.May 4 2017, 1:23 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 4 2017, 1:23 AM
Base added a subscriber: Base.May 4 2017, 11:21 AM
Restricted Application added a subscriber: jeblad. · View Herald TranscriptApr 15 2018, 6:37 PM
SerDIDG added a subscriber: SerDIDG.Jul 8 2018, 8:35 PM

Change 445633 had a related patch set uploaded (by Saint Johann; owner: Saint Johann):
[mediawiki/extensions/CharInsert@master] Make \n insert line breaks in CharInsert

https://gerrit.wikimedia.org/r/445633

stjn edited projects, added Editing-team; removed Parsing-Team.Jul 13 2018, 11:43 PM

About the patch above: since it adds new functionality (and per guide), can someone please tell me if that would be OK? It is a frequently used functionality (adding line breaks) that even more frequently breaks the resulting wiki code and parser because of it (can’t work in lists, frequently breaks even paragraphs etc.). I figured that having it as a handled use case would be less problematic than continuing to advise using hacky HTML code.

[Removing team project tag as it's up to teams which tasks they plan to work on]

stjn added a comment.Jul 15 2018, 4:06 PM

Team project tag was added because I need the opinion from the team as they are the code stewards of this extension. Was that really inappropriate?

'I need feedback from maintainers' basically applies for every and any task and patch. :) Planning on team project workboards is up to teams.

'I need feedback from maintainers' basically applies for every and any task and patch. :) Planning on team project workboards is up to teams.