Skip to content

Commit a8f7026

Browse files
fix(digest): preserve underscores in identifiers and hide debug signatures
1. Remove underscore italics handling from Mrkdwn renderer - index names like idx_addresses_customer_id were being mangled to idxaddressescustomerid because underscores were treated as italic delimiters. 2. Filter out [sig:INDEX_RECOMMENDATIONS:...] debug lines from the web view. These internal dedupe markers should not be shown to users. Co-authored-by: Venkat SF <venkatesh.sakamuri@stayflexi.com>
1 parent 84252d8 commit a8f7026

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

‎src/components/sections/DigestSection.jsx‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ import styles from './DigestSection.module.css'
1010
// ─────────────────────────────────────────────
1111
function renderInline(text) {
1212
const parts = []
13-
const re = /(\*[^*]+\*|_[^_]+_|`[^`]+`)/g
13+
// Match bold (*text*) and code (`text`).
14+
// Skip underscore italics (_text_) to preserve index/table names like idx_orders_status.
15+
const re = /(\*[^*]+\*|`[^`]+`)/g
1416
let last = 0, m, key = 0
1517
while ((m = re.exec(text)) !== null) {
1618
if (m.index > last) parts.push(text.slice(last, m.index))
1719
const raw = m[0]
1820
if (raw.startsWith('*') && raw.endsWith('*'))
1921
parts.push(<strong key={key++}>{raw.slice(1, -1)}</strong>)
20-
else if (raw.startsWith('_') && raw.endsWith('_'))
21-
parts.push(<em key={key++}>{raw.slice(1, -1)}</em>)
2222
else if (raw.startsWith('`') && raw.endsWith('`'))
2323
parts.push(<code key={key++} className={styles.inlineCode}>{raw.slice(1, -1)}</code>)
2424
last = m.index + raw.length
@@ -146,7 +146,9 @@ function DigestCard({ digest }) {
146146
}
147147

148148
function DigestSection({ section }) {
149-
const nonEmpty = section.lines.filter(l => l.trim())
149+
const nonEmpty = section.lines
150+
.filter(l => l.trim())
151+
.filter(l => !l.includes('[sig:')) // Hide internal signature/dedupe markers
150152
return (
151153
<div className={styles.section}>
152154
<div className={styles.sectionTitle}>{section.title}</div>

0 commit comments

Comments
 (0)