Skip to content

Commit

Permalink
merge integration to validation
Browse files Browse the repository at this point in the history
  • Loading branch information
b4pm-devops committed Dec 18, 2024
2 parents 55aed97 + e628d2a commit 0d0e765
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,13 @@ export class DocumentationComponent implements OnChanges, AfterViewInit {
// Regex to replace reference by <img>
const refRegex = /!\[.*?\](?:\[([^\]]+)\]|\(([^)]+)\))/g;
markdown = markdown.replace(refRegex, (match, p1) => {
const imageName = p1.replace(/_/g, '-');
if (imageRefs[imageName]) {
return `<img src="${imageRefs[imageName]}" alt="${imageName}">`;
if (p1) {
const imageName = p1.replace(/_/g, '-');
if (imageRefs[imageName]) {
return `<img src="${imageRefs[imageName]}" alt="${imageName}">`;
}
}

return match; // Return original text if not corresponding reference
});

Expand Down

0 comments on commit 0d0e765

Please sign in to comment.