Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jaanonim committed Sep 18, 2024
1 parent 0e1f432 commit ab9ea6f
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/GenerateLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,23 @@ export default function GenerateLinks(
suggestions.map((suggestion) => {
const index = suggestions.indexOf(suggestion);
if (index >= 0) {
suggestions = suggestions.slice(index, 1)
suggestions = suggestions.slice(index, 1);
}
})
return suggestions
}
});
return suggestions;
};

const lines = editor.lineCount();
for (let i = 0; i < lines; i++) {
const line = editor.getLine(i);

const match = [...line.matchAll(linkRegex)];
const match = [...line.matchAll(linkRegex)];
match.forEach((match) => {
const suggestions = removeDuplicatedSuggestionsHandler(getSuggestionsFromQuery(
match[0],
true,
settings
));
const suggestions = removeDuplicatedSuggestionsHandler(
getSuggestionsFromQuery(match[0], true, settings)
);
suggestions.forEach(async (s) => {
if (match.index === undefined) return;
if (match.index === undefined) return;
editor.replaceRange(
await s.toReplace(),
{
Expand Down

0 comments on commit ab9ea6f

Please sign in to comment.