text: Title: Javascript TypeError with renderedMarkdown in streamlit v1.41.1: nt.replaceAll is not a function
  Body: ### Checklist
  
  - [x] I have searched the [existing issues](https://github.com/streamlit/streamlit/issues) for similar issues.
  - [x] I added a very descriptive title to this issue.
  - [x] I have provided sufficient information below to help reproduce this issue.
  
  ### Summary
  
  On occassion we get a JavaScript error which hints to a rendering issue with Markdown. The error can not be reproduced reliably.
  Even a simple refresh can fix the error until a later time of the day. Therefore it is hard to reproduce.
  
  The error messages started to occur after an update of the `streamlit` version from `1.36` to `1.41.1`. Other versions inbetween might be effected.
  
  ### Reproducible Code Example
  
  ```Python
  
  ```
  
  ### Steps To Reproduce
  
  _No response_
  
  ### Expected Behavior
  
  _No response_
  
  ### Current Behavior
  
  Error message:
  ```
  TypeError: nt.replaceAll is not a function
  at RenderedMarkdown (https://<snip>/static/js/index.Phesr84n.js:442:1744)
  at Nh (https:<snip>/static/js/index.Phesr84n.js:46:18935)
  at Vk (https:<snip>/static/js/index.Phesr84n.js:48:48583)
  at Uk (https:<snip>/static/js/index.Phesr84n.js:48:43849)
  at Tk (https:<snip>/static/js/index.Phesr84n.js:48:43778)
  at Ik (https:<snip>/static/js/index.Phesr84n.js:48:43622)
  at Ek (https:<snip>/static/js/index.Phesr84n.js:48:40437)
  at jg (https:<snip>/static/js/index.Phesr84n.js:46:3536)
  at gi (https: <snip>/static/js/index.Phesr84n.js:48:37425)
  at ii (https:<snip>/static/js/index.Phesr84n.js:46:24857)
  ```
  
  ### Is this a regression?
  
  - [x] Yes, this used to work in a previous version.
  
  ### Debug info
  
  - Streamlit version: 1.41.1
  - Python version: 3.10
  - Operating System: macOS 14.7.2
  - Browser: Firefox
  
  
  ### Additional Information
  
  _No response_