Expanded the removeFormattings function to handle more Markdown syntax
Added preservation of text within bold and italic markers
Context
Azure AI Speech Services would not process text enclosed with asterisks (i.e. bold, italic...), issue #5560
Tests
Please check the fiddle I made to test the changes (markdown formatting stripping and cleanup)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/open-webui/open-webui/pull/7919
**Author:** [@denispol](https://github.com/denispol)
**Created:** 12/17/2024
**Status:** ✅ Merged
**Merged:** 12/17/2024
**Merged by:** [@tjbck](https://github.com/tjbck)
**Base:** `dev` ← **Head:** `main`
---
### 📝 Commits (2)
- [`d87584e`](https://github.com/open-webui/open-webui/commit/d87584e7ad21760ae540c76687016a49c78435c7) refactor(utils): enhance Markdown text cleaning for TTS compatibility
- [`e6add28`](https://github.com/open-webui/open-webui/commit/e6add2869bc0da0836d6337462e19a2f9a1555e9) Update index.ts
### 📊 Changes
**1 file changed** (+25 additions, -1 deletions)
<details>
<summary>View changed files</summary>
📝 `src/lib/utils/index.ts` (+25 -1)
</details>
### 📄 Description
# Enhanced Markdown formatting removal
Discussion #7925
## Changes
- Expanded the `removeFormattings` function to handle more Markdown syntax
- Added preservation of text within bold and italic markers
## Context
Azure AI Speech Services would not process text enclosed with asterisks (i.e. bold, italic...), issue #5560
## Tests
Please check the [fiddle](https://codepen.io/denispol/full/gbYgZvj) I made to test the changes (markdown formatting stripping and cleanup)
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/7919
Author: @denispol
Created: 12/17/2024
Status: ✅ Merged
Merged: 12/17/2024
Merged by: @tjbck
Base:
dev← Head:main📝 Commits (2)
d87584erefactor(utils): enhance Markdown text cleaning for TTS compatibilitye6add28Update index.ts📊 Changes
1 file changed (+25 additions, -1 deletions)
View changed files
📝
src/lib/utils/index.ts(+25 -1)📄 Description
Enhanced Markdown formatting removal
Discussion #7925
Changes
removeFormattingsfunction to handle more Markdown syntaxContext
Azure AI Speech Services would not process text enclosed with asterisks (i.e. bold, italic...), issue #5560
Tests
Please check the fiddle I made to test the changes (markdown formatting stripping and cleanup)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.