mirror of
https://github.com/irislib/iris-messenger.git
synced 2024-09-20 01:56:33 +00:00
hypertext
This commit is contained in:
parent
060868ca76
commit
029dbf54a9
@ -29,11 +29,11 @@ const HyperText = memo(
|
||||
|
||||
processedChildren = processedChildren.map((x, index, array) => {
|
||||
if (typeof x === 'string') {
|
||||
if (index < array.length - 1 && !array[index + 1].props?.href) {
|
||||
if (index < array.length - 1 && !array[index + 1]?.props?.href) {
|
||||
x = x.replace(/\n+$/, ''); // Remove trailing newlines if next element is not a link
|
||||
}
|
||||
|
||||
if (index > 0 && !array[index - 1].props?.href) {
|
||||
if (index > 0 && !array[index - 1]?.props?.href) {
|
||||
x = x.replace(/^\n+/, ''); // Remove leading newlines if previous element is not a link
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user