do not replace the selected text when insert file link.

This commit is contained in:
Ben
2025-09-28 18:05:17 +08:00
parent 2bdc7e1bc3
commit 297f91da00

View File

@ -97,7 +97,7 @@
if(file != null) if(file != null)
{ {
_linkAttributes.Href = file.Url; _linkAttributes.Href = file.Url;
if (string.IsNullOrWhiteSpace(_linkAttributes.InnerText) && _linkTextEditable) if ((string.IsNullOrWhiteSpace(_linkAttributes.InnerText) || _linkAttributes.InnerText == _previousFile?.Name) && _linkTextEditable)
{ {
_linkAttributes.InnerText = file.Name; _linkAttributes.InnerText = file.Name;
} }