Full white space rendering and links fix (#11238)

This commit is contained in:
marthasharkey 2024-10-03 17:01:26 +01:00 committed by GitHub
parent c7cc5f0be0
commit 37621a9f90
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -205,10 +205,6 @@ function formatText(params: ICellRendererParams) {
.replaceAll('&', '&')
.replaceAll('<', '&lt;')
.replaceAll('>', '&gt;')
.replace(
/https?:\/\/([-()_.!~*';/?:@&=+$,A-Za-z0-9])+/g,
(url: string) => `<a href="${url}" target="_blank" class="link">${url}</a>`,
)
if (textFormatterSelected.value === 'off') {
return htmlEscaped.replace(/^\s+|\s+$/g, '&nbsp;')
@ -232,7 +228,12 @@ function formatText(params: ICellRendererParams) {
return `<span style="color: #df8800">${match.replaceAll(' ', '&#183;')}</span>`
})
const replaceReturns = replaceSpaces.replace(
const replaceLinks = replaceSpaces.replace(
/https?:\/\/([-()_.!~*';/?:@&=+$,A-Za-z0-9])+/g,
(url: string) => `<a href="${url}" target="_blank" class="link">${url}</a>`,
)
const replaceReturns = replaceLinks.replace(
/\r\n/g,
'<span style="color: #df8800">␍␊</span> <br>',
)