mirror of
https://github.com/SableClient/Sable.git
synced 2026-11-20 09:01:17 -08:00
Previously, abbreviation term highlighting was skipped for any message that has a formatted_body (virtually all messages from modern clients using a rich-text editor), because RenderBody returned early from the customBody path before reaching the abbreviation logic. The fix adds an optional replaceTextNode callback to getReactCustomHtmlParser. Since opts closes over itself, renderChildren inside element handlers recurses through the same replace function, so text nodes nested inside <p>, <strong>, <em>, list items, etc. are all processed correctly. buildAbbrReplaceTextNode is exported from RenderBody.tsx and wired into both RoomTimeline and ThreadDrawer via useRoomAbbreviationsContext.