Use Parsoid hack to remove whitespace from replies

Change-Id: I1ad0f5498c3c409df6d4eb2d400a0f714dff9908
This commit is contained in:
Ed Sanders 2019-11-13 14:36:36 +00:00 committed by Bartosz Dziewoński
parent cf32465832
commit 9733f72354

View file

@ -60,6 +60,12 @@ function addListAtComment( comment ) {
function addListItem( list ) {
var listItem = document.createElement( list.nodeName.toLowerCase() === 'dl' ? 'dd' : 'li' );
// HACK: Setting data-parsoid removes the whitespace after the list item,
// which makes nested lists work.
// This is undocumented behaviour and probably very fragile.
listItem.setAttribute( 'data-parsoid', '{}' );
list.appendChild( listItem );
return listItem;
}