TiddlySpace / tiddlyspace

A discoursive social model for tiddlers
http://tiddlyspace.com
Other
106 stars 38 forks source link

empty HtmlJavascript leads to invalid HTML #1095

Closed FND closed 11 years ago

FND commented 11 years ago

I've created an empty "HtmlJavascript" tiddler in order to disable the defaults (i.e. Takenote).

This, however, leads to Firefox reporting "SyntaxError: line 1" in the firendly tiddler view (e.g. http://sandbox.tiddlyspace.com/TiddlyWeb%20with%20Nginx%20%2B%20uWSGI).

The HTML validator reports this:

Error Line 119, Column 15: Bad value for attribute src on element script: Must be non-empty.

<script src=""></script><script src="/bags/common/tiddlers/backstage.js"></script>

Seems like there's a subtle bug in the processing of "HtmlJavascript" tiddlers?

FND commented 11 years ago

@pads and (to a lesser extent) I think we've figured it out: https://github.com/TiddlySpace/tiddlyspace/blob/968249b62f5a06cdc374301c420cafd8c0b2491f/tiddlywebplugins/tiddlyspace/template.py#L66-67 This never returns an empty array, as ''.split('\n') == [''].

cdent commented 11 years ago

Yeah, I noticed this a couple days ago and then forgot to make note of it. Given the mechanics of how it works it is kind of what you would expect to happen, but that doesn't make it any less wrong. Will need to make a special guard.