Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
tyrasd committed Jul 2, 2024
1 parent 8fcb60d commit 7a3afe1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions js/popup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@ export function featurePopupContent(feature: GeoJSON.Feature) {
(wiki_lang = v.match(/^([a-zA-Z]+):(.*)$/)) &&
(wiki_page = wiki_lang[2]))
)
wiki_page = wiki_page.replace(/#.*$/, match => match.replace(/ /g, '_')); // 'Target page#Section header' -> 'Target page#Section_header'
v = `<a href="//${wiki_lang[1]}.wikipedia.org/wiki/${wiki_page}" target="_blank">${v}</a>`;
wiki_page = wiki_page.replace(/#.*$/, (match) =>
match.replace(/ /g, "_")
); // 'Target page#Section header' -> 'Target page#Section_header'
v = `<a href="//${wiki_lang[1]}.wikipedia.org/wiki/${wiki_page}" target="_blank">${v}</a>`;
// hyperlinks for wikidata entries
if (k.match(/(^|:)wikidata$/))
v = v.replace(
Expand Down

0 comments on commit 7a3afe1

Please sign in to comment.