Skip to content

Commit

Permalink
Merge pull request #1108 from morganmspencer/patch-1
Browse files Browse the repository at this point in the history
Account for multiline comments in markdown content
  • Loading branch information
Xantier authored Sep 11, 2023
2 parents 394ac0f + 8672138 commit 66999d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/witty-garlics-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@roadiehq/backstage-plugin-github-insights': patch
---

The `MarkdownContent` component currently removes only single line comments if `preserveHtmlComments` is not set.
This change accounts for single line and multiline HTML comments
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const GithubFileContent = (props: MarkdownContentProps) => {

let content = value.content;
if (!preserveHtmlComments) {
content = content.replace(/<!--.*?-->/g, '');
content = content.replace(/<!--(.|\n)*?-->/g, '');
}

return (
Expand Down

0 comments on commit 66999d2

Please sign in to comment.