Closed xsgordon closed 11 years ago
The offending block is:
if (counter >= iterations && cb ) {
if (_hasCDATA) { // don't rewrite it if it has CDATA, we'll lose it then
$ = null;
return cb(err, xml);
} else { // rewrite if it has no CDATA
$ = null;
return cb(err, $.html());
}
}
To work around the issue for now I have made the second branch return XML as well rather than trying to access the html() function of a variable that at least in some cases is null. Appears to be working for now but probably has other impacts?
Looking closer I image the "other impacts" would be that my changes results in circumventing the point of that entire function, that being to rewrite incorrectly capitalized language values :D.
Ah, i did that null assignment while tracking down memory leaks. Will look at it today.
On Thursday, May 30, 2013, Steve Gordon wrote:
Looking closer I image the "other impacts" would be that my changes results in circumventing the point of that entire function, that being to rewrite incorrectly capitalized language values :D.
— Reply to this email directly or view it on GitHubhttps://github.com/jwulf/press-star/issues/39#issuecomment-18644665 .
OK, I'll fix this and refactor the validator into parts that can be meaningfully unit tested.
Added an automated test: https://github.com/jwulf/press-star/commit/4f78e1446c54750fdad65d56ee6a91a1e3f2eb53
When the editor encounters a programlisting element without a language attribute (which is valid and handled gracefully by Publican, csprocessor, and PressGang) clicking validate results in:
On the server side the output returned before app.js crashes is: