Skip to content

Commit 48c62ea

Browse files
committed
further demo tweaks
1 parent 1fc75ba commit 48c62ea

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

examples/unfinished/jsparse-demo/jsparse-demo.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ html, body { height: 100%; }
9191
border-radius: 5px;
9292
cursor: pointer;
9393
overflow: hidden;
94-
position: relative;
94+
/* position:relative breaks overflow:hidden effect of rounded corners? */
95+
position: static;
9596
}
9697

9798
.box.head {

examples/unfinished/jsparse-demo/jsparse-demo.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ if (Meteor.is_client) {
6262
var statementHeads = makeSet(
6363
('functionDecl expression label block variables ' +
6464
'if for do while return continue break throw with switch ' +
65-
'try debugger').split(' '));
65+
'try debugger empty').split(' '));
6666
var toHtml = function (obj) {
6767
if (_.isArray(obj)) {
6868
var head = obj[0] || 'none';
@@ -73,7 +73,8 @@ if (Meteor.is_client) {
7373
info,
7474
'<div class="box named' + (isStatement ? ' statement' : '') +
7575
'"><div class="box head">' +
76-
Handlebars._escape(head) + '</div>' +
76+
Handlebars._escape(head + (isStatement ? ' statement' : '')) +
77+
'</div>' +
7778
_.map(rest, toHtml).join('') + '</div>');
7879
unclosedInfos.push(info);
7980
return html;
@@ -86,9 +87,9 @@ if (Meteor.is_client) {
8687
unclosedInfos.length = 0;
8788
var text = obj.text;
8889
// insert zero-width spaces to allow wrapping
89-
text = text.replace(/\w{10}/g, "$&\n");
90+
text = text.replace(/.{20}/g, "$&\n");
9091
text = Handlebars._escape(text);
91-
text = text.replace(/\n/g, '&shy;');
92+
text = text.replace(/\n/g, '&#8203;');
9293
return Spark.setDataContext(
9394
obj,
9495
'<div class="box token">' + text + '</div>');

0 commit comments

Comments
 (0)