Skip to content

Commit

Permalink
changes based on Zak's review
Browse files Browse the repository at this point in the history
  • Loading branch information
RakeshUP committed Jul 2, 2021
1 parent b711c08 commit a6a855a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions client/scripts/views/components/markdown_formatted_text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ import smartTruncate from 'smart-truncate';

const renderer = new marked.Renderer();
renderer.link = (href, title, text) => {
if (href.contains('://localhost') || href.contains('://commonwealth.im/')) {
return `<a href="${href}">${text}</a>`;
}
return `<a target="_blank" href="${href}">${text}</a>`;
return `<a ${!href.contains('://commonwealth.im/') && 'target="_blank"'} href="${href}">${text}</a>`;
};

marked.setOptions({
Expand Down

0 comments on commit a6a855a

Please sign in to comment.