w3c / requestidlecallback

Cooperative Scheduling of Background Tasks
https://w3c.github.io/requestidlecallback/
Other
50 stars 19 forks source link

(Editorial) Example 1 does not render properly #67

Closed iherman closed 6 years ago

iherman commented 6 years ago

The original source says

var x = Math.random() * r * 2 - r;
var y = Math.random() * r * 2 - r;

However, the '*' character does not display on some (all?) browsers; an empty space is displayed. See, for example,

image

I see the same in FF, Vivaldi, FF Dev edition, Chrome...

igrigorik commented 6 years ago

Thanks for flagging this. Paging @marcoscaceres.. This looks like a respec issue, I think.

marcoscaceres commented 6 years ago

Whoa.. yeah. That's messed up. The highlighter seems to be stripping the "*". Will poke at it a bit more. You might want to add CSS class "nohighlight" for now.

marcoscaceres commented 6 years ago

Filed: https://github.com/w3c/respec/issues/1389

Will poke at it look soon.

marcoscaceres commented 6 years ago

It's actually a bug with the markdown parser :( I might need to replace the markdown parser. Looking for options.

marcoscaceres commented 6 years ago

@igrigorik, unfortunately, it's going to be another 2 weeks or so before I get to this. Could you maybe change the example to (the problem happens when "*" appears twice on the same line):

var rand = Math.random() * r;
var x =  rand * 2 - r;
rand = Math.random() * r;
var y =  rand * 2 - r;
igrigorik commented 6 years ago

Closing, resolved via https://github.com/rmcilroy/requestidlecallback/commit/c216c4b1190f79fb4cefd32eedfec590fe997774. Thanks Ross!

rmcilroy commented 6 years ago

I don't actually think rmcilroy/requestidlecallback@c216c4b fixes this (at least didn't seem to when I checked, that's why I hadn't made a pull request). Does it fix the issue when you checked?

igrigorik commented 6 years ago

cmd-shift-R... Doh.

@rmcilroy any objections to Marcos' suggestion on changing the example?

rmcilroy commented 6 years ago

Nope if that fixes it SGTM, thanks

igrigorik commented 6 years ago

Actually, it didn't.. Doh, again. @marcoscaceres back to the drawing board? :)

marcoscaceres commented 6 years ago

Could kindly try what I suggested here: https://github.com/w3c/requestidlecallback/issues/67#issuecomment-337467575

I hit a couple of snags replacing the markdown parse - other parsers are over 100kb minified (compared to ~40kb) for Marked.js... so I’m a bit hesitant to replace it as it would bloat ReSpec to over 500kb. I’ll investigate if there is a fix for this as a PR in marked.js’ repo.

Alternatively, I’m also considering moving markdown parsing off main thread. It’s a bit more work, but might give the right balance between speed, download size, and not having this bug.

igrigorik commented 6 years ago

@marcoscaceres I did, same issue.

image

marcoscaceres commented 6 years ago

Apologies, I misread. I’ll try a few things out and get back to you soon!

marcoscaceres commented 6 years ago

Sent a PR for this: #69