Skip to content

Commit c91cfb7

Browse files
committed
Added regex for comparison for URLs in sync output
1 parent 79d1293 commit c91cfb7

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
- Added link back to IRIS management portal from Settings, Git WebUI pages (#449)
1414
- Added Import all and Import All (Force) to basic mode menu (#498)
1515
- Improved behavior for commits when attribution settings are not configured (#450)
16+
- Convert URLs in Sync output UI into clickable links (#497)
1617

1718
### Fixed
1819
- Changed prompts in configure from 0/1 to no/yes (#461)
@@ -23,7 +24,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2324
- Fetch diff output uses correct remote branch (#509)
2425
- Properly handle more cases of truncated filenames from git pull (#511)
2526
- Made git-source-control backwards compatible with IRIS 2021.1 (#513)
26-
- Fix to convert URLs in Sync output UI into clickable links (#497)
2727

2828
## [2.5.0] - 2024-09-24
2929

csp/sync.csp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -147,15 +147,8 @@
147147
&js<
148148
var outputContainer = document.getElementById('outputBox');
149149
var lineText = #(..QuoteJS(escapedLine))#;
150-
var lineTextAsArr = lineText.split(" ");
151-
lineTextAsArr = lineTextAsArr.map(function(text){
152-
if (text.substring(0,8) === "https://") {
153-
return '<a href="' + text + '" target="_blank">' + text + '</a>';
154-
} else {
155-
return text;
156-
}
157-
});
158-
lineText = lineTextAsArr.join(" ")
150+
var urlRegex = /(https?:\/\/[^ ]*)/;
151+
lineText = lineText.replace(urlRegex, "<a href='$1' target=_blank>$1</a>");
159152
var lineTextNode = document.createTextNode(lineText);
160153
outputContainer.innerHTML += lineText + "<br>";
161154
>

0 commit comments

Comments
 (0)