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
9 changes: 1 addition & 8 deletions packages/kilo-vscode/src/shared/browser-feedback.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { partReview, type ReviewMessageData } from "./review-comments"
import { fenced, partReview, type ReviewMessageData } from "./review-comments"

export interface BrowserReference {
id: string
Expand Down Expand Up @@ -190,13 +190,6 @@ function escapeInline(value: string): string {
return value.replace(/[\r\n]+/g, " ").replace(/([\\`*_[\]{}()#+\-!|<>])/g, "\\$1")
}

function fenced(value: string): string[] {
const matches = value.match(/`+/g) ?? []
const longest = matches.reduce((max, item) => Math.max(max, item.length), 0)
const fence = "`".repeat(Math.max(3, longest + 1))
return [fence, value, fence]
}

function page(item: BrowserReference): string | undefined {
if (!item.url && !item.title) return undefined
return `Page: ${item.title ? escapeInline(item.title) : "Untitled"}${item.url ? ` (\`${escapeInline(item.url)}\`)` : ""}`
Expand Down
2 changes: 1 addition & 1 deletion packages/kilo-vscode/src/shared/review-comments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function escapeInline(value: string): string {
}

/** Wrap a snippet in a fence long enough to survive backticks inside it. */
function fenced(value: string): string[] {
export function fenced(value: string): string[] {
const matches = value.match(/`+/g) ?? []
const longest = matches.reduce((max, item) => Math.max(max, item.length), 0)
const fence = "`".repeat(Math.max(3, longest + 1))
Expand Down
Loading