Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong header level #386

Closed
lanthaler opened this issue Dec 23, 2014 · 3 comments
Closed

Wrong header level #386

lanthaler opened this issue Dec 23, 2014 · 3 comments

Comments

@lanthaler
Copy link
Member

A recent update apparently started to change the header level for JavaScript-injected content in our spec.

If you look at http://www.hydra-cg.com/spec/latest/core/#classes you'll see that not only 6. Classes is a h2 but also hydra:ApiDocumentation and hydra:Class. The HTML we inject sets uses h3 but ReSpec changes them to h2. Please note that the TOC is correct.

The script that injects this content can be found here: https://github.com/HydraCG/Specifications/blob/master/spec/js/respec-w3c-extensions.js#L53-L64

This was originally reported as HydraCG/Specifications#78

@darobin
Copy link
Member

darobin commented Jan 23, 2015

Hmmm, this looks like a problem with the order in which modules are run.

@darobin
Copy link
Member

darobin commented Jan 25, 2015

Okay, I've looked at your code and I'm in fact seeing erratic behaviour that I suspect is not ReSpec's fault. You appear to be generating your content in the callback from getJSON(). The problem is that getJSON() is asynchronous, so the content is getting inserted at potentially unpredictable moments.

This doesn't mean that there isn't also a problem in ReSpec, but you should probably try loading content synchronously first. We can't make guarantees as to when the loop is spun or generally defend against race conditions like that.

@marcoscaceres
Copy link
Member

Marking as invalid based on Robin's analysis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants