Add HTML snippet debug to see actual structure

This commit is contained in:
John Mizerek 2026-02-12 19:50:56 -08:00
parent 549f3cb31f
commit 99c2a6aa10

View file

@ -264,6 +264,14 @@
</cfif>
</cfloop>
<cfset response["DEBUG_H4_TAGS"] = h4Texts>
<!--- Debug: show raw HTML snippet around first h3 tag --->
<cfset h3Pos = findNoCase("<h3", combinedHtml)>
<cfif h3Pos GT 0>
<cfset snippetStart = max(1, h3Pos - 200)>
<cfset snippetEnd = min(len(combinedHtml), h3Pos + 500)>
<cfset response["DEBUG_HTML_SNIPPET"] = mid(combinedHtml, snippetStart, snippetEnd - snippetStart)>
</cfif>
<cfset arrayAppend(response.steps, "Found " & arrayLen(h3Texts) & " h3 and " & arrayLen(h4Texts) & " h4 tags")>
<!--- System prompt for URL analysis --->