Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added PostHog events for chat UI interactions (details card expand/collapse, copy answer, table of contents toggle) and repo tracking in `wa_chat_message_sent`. [#922](https://github.com/sourcebot-dev/sourcebot/pull/922)
- Added Bitbucket Cloud OAuth identity provider support (`provider: "bitbucket-cloud"`) for SSO and account-linked permission syncing. [#924](https://github.com/sourcebot-dev/sourcebot/pull/924)

### Fixed
- Fixed text inside angle brackets (e.g., `<id>`) being hidden in chat prompt display due to HTML parsing. [#929](https://github.com/sourcebot-dev/sourcebot/pull/929)

## [4.11.7] - 2026-02-23

### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ const ChatThreadListItemComponent = forwardRef<HTMLDivElement, ChatThreadListIte
<MarkdownRenderer
content={userQuestion.trim()}
className="prose-p:m-0"
disableRawHtml={true}
/>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,15 @@ const remarkTocExtractor = () => {
interface MarkdownRendererProps {
content: string;
className?: string;
/**
* When true, disables raw HTML parsing. This prevents text like `<id>` from
* being interpreted as HTML tags. Use this for user-provided content that
* shouldn't contain embedded HTML.
*/
disableRawHtml?: boolean;
}

const MarkdownRendererComponent = forwardRef<HTMLDivElement, MarkdownRendererProps>(({ content, className }, ref) => {
const MarkdownRendererComponent = forwardRef<HTMLDivElement, MarkdownRendererProps>(({ content, className, disableRawHtml = false }, ref) => {
const router = useRouter();

const remarkPlugins = useMemo((): PluggableList => {
Expand All @@ -115,8 +121,13 @@ const MarkdownRendererComponent = forwardRef<HTMLDivElement, MarkdownRendererPro
}, []);

const rehypePlugins = useMemo((): PluggableList => {
return [
rehypeRaw,
const plugins: PluggableList = [];

if (!disableRawHtml) {
plugins.push(rehypeRaw);
}

plugins.push(
[
rehypeSanitize,
{
Expand All @@ -129,8 +140,10 @@ const MarkdownRendererComponent = forwardRef<HTMLDivElement, MarkdownRendererPro
} satisfies SanitizeSchema,
],
annotateCodeBlocks,
];
}, []);
);

return plugins;
}, [disableRawHtml]);

const renderPre = useCallback(({ children, node, ...rest }: React.JSX.IntrinsicElements['pre'] & { node?: Element }) => {
if (node?.properties && node.properties.isBlock === true) {
Expand Down