Skip to content

Commit

Permalink
Improve HTML text detection
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson authored and github-actions[bot] committed Jan 30, 2025
1 parent 004ad8e commit 1aa1e55
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gui/qgsrichtexteditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,8 @@ void QgsRichTextEditor::setText( const QString &text )
return;
}

if ( text[0] == '<' )
const thread_local QRegularExpression sIsHtmlRx( QStringLiteral( "^\\s*<" ) );
if ( sIsHtmlRx.match( text ).hasMatch() )
{
mTextEdit->setHtml( text );
mSourceEdit->setText( text );
Expand Down

0 comments on commit 1aa1e55

Please sign in to comment.