Skip to content

Commit 792cfcf

Browse files
t3dotggclaude
andcommitted
fix(server): bold titles with italic text inside also wait for content
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1 parent a35ade2 commit 792cfcf

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

‎apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5205,6 +5205,10 @@ describe("splitBufferedAssistantText", () => {
52055205
ready: "",
52065206
rest: "**Risk by area:**\n\n| a |\n|---|\n",
52075207
});
5208+
expect(splitBufferedAssistantText("**Use *npm* now**\n\nInstall it")).toEqual({
5209+
ready: "",
5210+
rest: "**Use *npm* now**\n\nInstall it",
5211+
});
52085212
expect(splitBufferedAssistantText("**Note:** read this.\n\nNext")).toEqual({
52095213
ready: "**Note:** read this.\n\n",
52105214
rest: "Next",

‎apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ const BLANK_LINE_PATTERN = /^[ \t]*$/;
213213
const LIST_ITEM_START_PATTERN = /^[ \t]*(?:[-*+]|\d{1,9}[.)])[ \t]/;
214214
// A section title: an ATX heading, or a line of only bold text, which models
215215
// often use as a heading.
216-
const SECTION_TITLE_PATTERN = /^ {0,3}(?:#{1,6}(?:[ \t]|$)|\*\*[^*]+\*\*:?$)/;
216+
const SECTION_TITLE_PATTERN = /^ {0,3}(?:#{1,6}(?:[ \t]|$)|\*\*(?:[^*]|\*(?!\*))+\*\*:?$)/;
217217
// An unindented ATX heading ends the paragraph or list above it, even with no
218218
// blank line between them. A bold line would continue the paragraph instead.
219219
const TOP_LEVEL_HEADING_PATTERN = /^#{1,6}(?:[ \t]|$)/;

0 commit comments

Comments
 (0)