LibreChat/client/src
Danny Avila 1915d7b195
🧮 fix: Properly Escape Currency and Prevent Code Block LaTeX Bugs (#9248)
* fix(latex): prevent LaTeX conversion when closing $ is preceded by backtick

When text contained patterns like "$lookup namespace" followed by "`$lookup`",
the regex would match from the first $ to the backtick's $, treating the entire
span as a LaTeX expression. This caused programming constructs to be incorrectly
converted to double dollars.

- Added negative lookbehind (?<!`) to single dollar regex
- Prevents matching when closing $ immediately follows a backtick
- Fixes issues with inline code blocks containing $ symbols

* fix(latex): detect currency amounts with 4+ digits without commas

The currency regex pattern \d{1,3} only matched amounts with 1-3 initial digits,
causing amounts like $1157.90 to be interpreted as LaTeX instead of currency.
This resulted in text like "$1157.90 (text) + $500 (text) = $1657.90" being
incorrectly converted to a single LaTeX expression.

- Changed pattern from \d{1,3} to \d+ to match any number of initial digits
- Now properly escapes $1000, $10000, $123456, etc. without requiring commas
- Maintains support for comma-formatted amounts like $1,234.56

* fix(latex): support currency with unlimited decimal places

The currency regex limited decimal places to 1-2 digits (\.\d{1,2}), which
failed to properly escape amounts with more precision like cryptocurrency
values ($0.00001234), gas prices ($3.999), or exchange rates ($1.23456).

- Changed decimal pattern from \.\d{1,2} to \.\d+
- Now supports any number of decimal places
- Handles edge cases like scientific calculations and high-precision values
2025-08-25 02:44:13 -04:00
..
@types
a11y 📦 feat: Move Shared Components to @librechat/client (#8685) 2025-07-27 12:19:01 -04:00
common 🛠️ fix: Restrict Editable Content Types & Consolidate Typing (#9173) 2025-08-20 13:21:47 -04:00
components 🌍 i18n: Add Bosnian and Norsk Bokmål Languages (#9176) 2025-08-20 14:17:23 -04:00
constants 🔐 feat: Granular Role-based Permissions + Entra ID Group Discovery (#7804) 2025-08-13 16:24:17 -04:00
data-provider 🧑‍💻 refactor: Secure Field Selection for 2FA & API Build Sourcemap (#9087) 2025-08-15 18:55:49 -04:00
hooks 🏄‍♂️ refactor: Improve Cancelled Stream Handling for Pending Authentication (#9235) 2025-08-24 12:42:34 -04:00
locales 🌍 i18n: Update translation.json with latest translations (#9228) 2025-08-24 12:42:57 -04:00
Providers 📛 refactor: Decouple MCP Dialog UI from BadgeRowContext (#8920) 2025-08-18 11:20:45 -04:00
routes 🗨️ refactor: Optimize Prompt Queries 2025-08-13 16:24:25 -04:00
store 🪄 feat: Artifacts Badge & Optimize Ephemeral Agent State (#8252) 2025-07-04 13:25:04 -04:00
utils 🧮 fix: Properly Escape Currency and Prevent Code Block LaTeX Bugs (#9248) 2025-08-25 02:44:13 -04:00
App.jsx 📦 feat: Move Shared Components to @librechat/client (#8685) 2025-07-27 12:19:01 -04:00
main.jsx 🎨 feat: add copy-tex to improve copying KaTeX (#7308) 2025-05-15 12:08:47 -04:00
mobile.css 🧪 fix: Editor Styling, Incomplete Artifact Editing, Optimize Artifact Context (#8953) 2025-08-08 15:49:58 -04:00
style.css 🎨 style: Theming and Consistency Improvements for Agent Marketplace 2025-08-13 16:24:18 -04:00
vite-env.d.ts