g, '<br>');

                // Make URLs clickable by converting them to <a> tags
                formattedContent = formattedContent.replace(
                    /(https?:\/\/[^\s]+)/g,
                    '<a href="$1" target="_blank">$1</a>'
                );

        return formattedContent;
    }
    </script>
</body>
</html>