Skip to content

Commit f51b7d9

Browse files
author
Philip Guo
committed
got generator expressions displayed properly
1 parent 89e52c2 commit f51b7d9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎v3/js/pytutor.js‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2054,11 +2054,13 @@ String.prototype.rtrim = function() {
20542054
// are NOT legal names for CSS ID's.
20552055
// I also threw in '{', '}', '(', ')', '<', '>' as illegal characters.
20562056
//
2057+
// also some variable names are like '.0' (for generator expressions),
2058+
// and '.' seems to be illegal.
20572059
// TODO: what other characters are illegal???
20582060
var lbRE = new RegExp('\\[|{|\\(|<', 'g');
20592061
var rbRE = new RegExp('\\]|}|\\)|>', 'g');
20602062
function varnameToCssID(varname) {
2061-
return varname.replace(lbRE, 'LeftB_').replace(rbRE, '_RightB');
2063+
return varname.replace(lbRE, 'LeftB_').replace(rbRE, '_RightB').replace('.', '_DOT_');
20622064
}
20632065

20642066

0 commit comments

Comments
 (0)