Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed May 3, 2024
1 parent 7c6116b commit 500b959
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions taxonium_component/src/utils/processNextstrain.js
Original file line number Diff line number Diff line change
Expand Up @@ -431,16 +431,20 @@ async function json_to_tree(json) {
function markdownToHTML(md) {
// Regular expression to match Markdown links
var markdownLinkRegex = /\[([^\]]+)\]\(([^)]+)\)/g;

// Replace Markdown links with HTML <a> tags
var html = md.replace(markdownLinkRegex, '<a class="underline" href="$2">$1</a>');

var html = md.replace(
markdownLinkRegex,
'<a class="underline" href="$2">$1</a>'
);

return html;
}
}

config.overlay = `<p>This is a tree extracted from a <a class='underline' href='//nextstrain.org'>Nextstrain</a> JSON file, being visualised in Taxonium.</p>.`;
if (json.meta.description) {
config.overlay = config.overlay + "<p>" + markdownToHTML(json.meta.description) + "</p>";
config.overlay =
config.overlay + "<p>" + markdownToHTML(json.meta.description) + "</p>";
}

if (json.meta && json.meta.updated) {
Expand Down

0 comments on commit 500b959

Please sign in to comment.