Skip to content

Commit b17462b

Browse files
Fix JS syntax error when displaying generated scraper code (#104)
The generated Python scraper code was being inserted raw into HTML, which could break parsing if the code contained sequences like "</script>" or "</code>" in string literals. Added the |e (escape) filter to properly HTML-escape the code content. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com>
1 parent 42d3137 commit b17462b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

backend/app/templates/admin/partials/generated_scraper.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ <h3 class="text-lg font-semibold dark:text-white flex items-center gap-2">
6363
Copy
6464
</button>
6565
</div>
66-
<pre id="scraper-code" class="bg-gray-900 text-gray-100 rounded-lg p-4 overflow-x-auto text-sm font-mono max-h-96 overflow-y-auto"><code>{{ result.code }}</code></pre>
66+
<pre id="scraper-code" class="bg-gray-900 text-gray-100 rounded-lg p-4 overflow-x-auto text-sm font-mono max-h-96 overflow-y-auto"><code>{{ result.code|e }}</code></pre>
6767
</div>
6868
</details>
6969

0 commit comments

Comments
 (0)