Skip to content

Commit fbed86e

Browse files
committed
[layouts] Fix label expression contains unicode characters when edited
Fixes #19743 (cherry picked from commit bb91170)
1 parent 1c3d1e7 commit fbed86e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/app/layout/qgslayoutlabelwidget.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@ void QgsLayoutLabelWidget::mInsertExpressionButton_clicked()
187187

188188
QString selText = mTextEdit->textCursor().selectedText();
189189

190+
// html editor replaces newlines with Paragraph Separator characters - see https://issues.qgis.org/issues/19743
191+
selText = selText.replace( QChar( 0x2029 ), QChar( '\n' ) );
192+
190193
// edit the selected expression if there's one
191194
if ( selText.startsWith( QLatin1String( "[%" ) ) && selText.endsWith( QLatin1String( "%]" ) ) )
192195
selText = selText.mid( 2, selText.size() - 4 );

0 commit comments

Comments
 (0)