mirror of
				https://github.com/severian-dev/sucker.severian.dev.git
				synced 2025-10-30 21:55:40 +00:00 
			
		
		
		
	chore: odd, let me try this
This commit is contained in:
		| @@ -53,34 +53,36 @@ function findTagsBetween(content: string, startMarker: string, endMarker: string | |||||||
|     return []; |     return []; | ||||||
|   } |   } | ||||||
|    |    | ||||||
|   const endIdx = content.indexOf(endMarkerTag); |   // Look for any XML-style tags after the system tag | ||||||
|   console.log("End marker index:", endIdx); |   const section = content.slice(startIdx); | ||||||
|   if (endIdx === -1) { |  | ||||||
|     console.log("End marker not found"); |  | ||||||
|     return []; |  | ||||||
|   } |  | ||||||
|    |  | ||||||
|   const section = content.slice(startIdx, endIdx); |  | ||||||
|   console.log("Section length:", section.length); |   console.log("Section length:", section.length); | ||||||
|   console.log("Section found:", section); |  | ||||||
|    |    | ||||||
|   const matches: PersonaMatch[] = []; |   const matches: PersonaMatch[] = []; | ||||||
|    |    | ||||||
|  |   // Match any tag that comes before the scenario tag | ||||||
|   const tagPattern = /<([^/>\s][^>]*)>([\s\S]*?)<\/\1>/g; |   const tagPattern = /<([^/>\s][^>]*)>([\s\S]*?)<\/\1>/g; | ||||||
|   console.log("Using pattern:", tagPattern); |   console.log("Using pattern:", tagPattern); | ||||||
|   let match; |   let match; | ||||||
|    |    | ||||||
|   try { |   try { | ||||||
|     while ((match = tagPattern.exec(section)) !== null) { |     while ((match = tagPattern.exec(section)) !== null) { | ||||||
|       console.log("Found match:", { |       // Stop if we hit the scenario tag | ||||||
|         fullMatch: match[0], |       if (match[1] === endMarker) { | ||||||
|         tag: match[1], |         break; | ||||||
|         contentPreview: match[2].substring(0, 50) + "..." |       } | ||||||
|       }); |        | ||||||
|       matches.push({ |       // Skip the system tag | ||||||
|         tag: match[1].trim(), |       if (match[1] !== startMarker) { | ||||||
|         content: match[2].trim() |         console.log("Found match:", { | ||||||
|       }); |           fullMatch: match[0], | ||||||
|  |           tag: match[1], | ||||||
|  |           contentPreview: match[2].substring(0, 50) + "..." | ||||||
|  |         }); | ||||||
|  |         matches.push({ | ||||||
|  |           tag: match[1].trim(), | ||||||
|  |           content: match[2].trim() | ||||||
|  |         }); | ||||||
|  |       } | ||||||
|     } |     } | ||||||
|   } catch (error) { |   } catch (error) { | ||||||
|     console.error("Error during regex execution:", error); |     console.error("Error during regex execution:", error); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Severian
					Severian