Skip to content

Commit

Permalink
optional spans in regex
Browse files Browse the repository at this point in the history
  • Loading branch information
stevencohn authored and weissm committed Dec 5, 2023
1 parent 940866e commit 014e667
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion OneMore/Commands/References/RefreshPageLinksCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ private async Task Execute(UI.ProgressDialog progress, CancellationToken token)
// OneNote likes to inject \n\r before the href attribute so match any spaces
// also the A element may contain an optional SPAN (just one?)
var editor = new Regex(
$"(.*<a\\s+href=[^>]+{keys}[^>]+>(?:<span[^>]+>))([^<]*)((?:</span>)</a>.*)",
$"(.*<a\\s+href=[^>]+{keys}[^>]+>(?:<span[^>]+>)?)([^<]*)((?:</span>)?</a>.*)",
RegexOptions.Compiled | RegexOptions.Multiline);

foreach (var item in pageList)
Expand Down

0 comments on commit 014e667

Please sign in to comment.