From 3ca5e5080722fcc73f6ba4eb173cc7fec60fd2f5 Mon Sep 17 00:00:00 2001 From: Steven Cohn Date: Mon, 27 Nov 2023 23:08:45 -0500 Subject: [PATCH] Keep space before match #1126 --- OneMore/Commands/References/LinkReferencesCommand.cs | 2 +- OneMore/Commands/Search/SearchAndReplaceEditor.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OneMore/Commands/References/LinkReferencesCommand.cs b/OneMore/Commands/References/LinkReferencesCommand.cs index 21dc34cf3e..0d7863f0aa 100644 --- a/OneMore/Commands/References/LinkReferencesCommand.cs +++ b/OneMore/Commands/References/LinkReferencesCommand.cs @@ -173,7 +173,7 @@ private async Task Execute(UI.ProgressDialog progress, CancellationToken token) var whatText = $@"(?:^|\b|\s)({title.EscapeForRegex()})(?:$|\b|\s)"; var pageLink = one.GetHyperlink(page.PageId, string.Empty); - var withElement = new XElement("A", + var withElement = new XElement("a", new XAttribute("href", pageLink), title ); diff --git a/OneMore/Commands/Search/SearchAndReplaceEditor.cs b/OneMore/Commands/Search/SearchAndReplaceEditor.cs index c3aecc69c7..7273fe72e5 100644 --- a/OneMore/Commands/Search/SearchAndReplaceEditor.cs +++ b/OneMore/Commands/Search/SearchAndReplaceEditor.cs @@ -129,7 +129,7 @@ private int SearchAndReplace(XElement element) } else if (match.Groups.Count > 1) { - Replace(wrapper, match.Index, match.Length, + Replace(wrapper, match.Groups[1].Index, match.Groups[1].Length, replaceElement == null ? ExpandReplacement(match) : null); } }