Commit 154812c8 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix line feed lost on project notes paste.

Fixes #1382
parent 1e891803
Pipeline #155191 passed with stage
in 7 minutes and 50 seconds
......@@ -214,6 +214,7 @@ void NotesWidget::addTextNote(const QString &text)
void NotesWidget::insertFromMimeData(const QMimeData *source)
{
QString pastedText = source->text();
bool enforceHtml = false;
// Check for timecodes
QStringList words = pastedText.split(QLatin1Char(' '));
for (const QString &w : qAsConst(words)) {
......@@ -222,8 +223,13 @@ void NotesWidget::insertFromMimeData(const QMimeData *source)
int frames = pCore->timecode().getFrameCount(w);
if (frames > 0) {
pastedText.replace(w, QStringLiteral("<a href=\"") + QString::number(frames) + QStringLiteral("\">") + w + QStringLiteral("</a> "));
enforceHtml = true;
}
}
}
insertHtml(pastedText);
if (enforceHtml || Qt::mightBeRichText(pastedText)) {
insertHtml(pastedText);
} else {
insertPlainText(pastedText);
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment