Parent is shown as HTML in the subref edit dialog

Minor tweak to render the parent as HTML, without fixing anything
else about the layout.

Bug: T370873
Change-Id: I507acf7b86a20d1965bbb32fdc0132b41c929d0c
This commit is contained in:
Adam Wight 2024-07-24 16:06:34 +02:00
parent 8aa889dbe6
commit 7691f49ea8

View file

@ -214,11 +214,12 @@ ve.ui.MWReferenceDialog.prototype.updateExtendsWarningFromRef = function ( ref )
if ( ref.extendsRef ) {
const list = this.getFragment().getDocument().getInternalList();
const itemNode = list.getItemNode( list.keys.indexOf( ref.extendsRef ) );
const parentRefText = new ve.ui.MWPreviewElement( itemNode, { useView: true } ).$element.text();
// TODO extends i18n
this.editPanel.extendsWarning.setLabel( new OO.ui.HtmlSnippet(
`${ mw.msg( 'cite-ve-dialog-reference-editing-extends' ) }</br>${ parentRefText }`
) );
const $parentRefPreview = new ve.ui.MWPreviewElement( itemNode, { useView: true } ).$element;
this.editPanel.extendsWarning.setLabel(
$( '<p>' )
.text( mw.msg( 'cite-ve-dialog-reference-editing-extends' ) )
.append( $parentRefPreview )
);
}
this.editPanel.extendsWarning.toggle( !!ref.extendsRef );