Replies: 1 comment
|
I reproduced the exact transformation, but the source boundary points to a narrower cause than the Harness pipeline itself. In rc.7, html.replace('</html>', `${script}</html>`)JavaScript replacement strings have their own token grammar. The sequence return '$' + valuecreates The robust fix is to return the dynamic content from a callback: html.replace('</html>', () => `${script}</html>`)or use I documented the reproduction, diagnostic boundary, safe insertion forms, and regression matrix here: https://sandbaseai.github.io/deepseek-harness-handbook/tapindex-dollar-corruption.html Independent community handbook, not an official DeepSeek AI project. |
Uh oh!
There was an error while loading. Please reload this page.
[Bug] HTML pipeline replaces
'$'sequence with</html>in injected scriptsFirst of all, thanks for the great work on DSH — it's a really well-designed plugin system. I came across a small issue while building a plugin and wanted to report it in case it's helpful.
Symptom
The browser console shows:
The offending line is inside a plugin-injected
<script>tag:The original source was:
What I think is happening
The injected HTML goes through some server-side HTML processing before being served. During that processing, the sequence
'$'(single-quote + dollar + single-quote) gets replaced with\n</html>\n, which breaks the JavaScript inside the<script>tag.I verified this by comparing the source string vs. the served response: the source has 2
$characters and 0</html>occurrences; the served output has 1$and 1</html>.Reproduction
Any plugin that injects a
<script>block containing a'$'sequence viactx.webServer.tapIndex()triggers this. For example, a script line like:gets served as:
Workaround I used
I changed the script to avoid the
'$'sequence (e.g. using double quotes orString.fromCharCode(36)), which works around it. But I'm not sure if this affects other legit plugin scripts, so I wanted to flag it here.If this is a known limitation or if I'm missing something about how tapIndex/HTML processing works, please let me know — happy to adjust my approach. Thanks for reading!
All reactions