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

No css output without html or htmlNode #292

Closed
pkra opened this issue Feb 15, 2017 · 2 comments
Closed

No css output without html or htmlNode #292

pkra opened this issue Feb 15, 2017 · 2 comments

Comments

@pkra
Copy link
Contributor

pkra commented Feb 15, 2017

Extracting this from #289 (comment)

[...] to handle requests for css when there is no request for html or htmlNode. You may want to move line 594 to the top of that function, right before line 566.

If I make the change, the following test still fails.

 var tape = require('tape');
var mjAPI = require("../lib/main.js");

tape('CSS output', function(t) {
    t.plan(1);
    mjAPI.start();
    var tex = 'x';
    mjAPI.typeset({
        math: tex,
        format: "TeX",
        css: true
    }, function(data) {
        t.ok(data.css, 'css output while no other output');
    });
});

Digging a little bit, CHTMLSTYLES is undefined at that point. Maybe it's a restarting issue?

@dpvc
Copy link
Member

dpvc commented Feb 15, 2017

OK, I checked a little further, and I had misremembered how things worked. I thought both output jax had been forced to load, but it is only the input jax that are forced. The output jax defaults to SVG unless data.html (or now data.htmlNode) is specified, so that's why the CHTMLSTYLES its undefined. So you are probably right, adding data.css to line 687 is probably the answer. you will also need to add it to line 787, I suspect, so that if both data.css and data.svg are specified (an unlikely case), you get both.

pkra added a commit that referenced this issue Feb 16, 2017
@pkra pkra added this to the What comes next -- towards v1.0 milestone Feb 16, 2017
@pkra pkra added the Fixed label Feb 21, 2017
@pkra
Copy link
Contributor Author

pkra commented Feb 21, 2017

Merged into develop.

@pkra pkra closed this as completed Feb 21, 2017
pkra added a commit that referenced this issue Mar 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants