Open gschnabel opened 2 years ago
I just installed RStudio Server and I can reproduce this problem and the suggested fix. However, I really don't know enough about RStudio Server to say if that's the 'proper' way to address this issue.
The disadvantage of using server-add-header=X-Content-Type-Options:
to solve the problem is that the browser is instructed to ignore the content-type as provided by the server. A better solution would be to somehow instruct the server to serve js-files with the correct content-type specification. If I figure out how this can be done, I'll update this issue. From a practical point of view, the suggested solution is satisfactory for my personal package development needs.
Btw: thanks for developing mathjaxr, it is really a helpful package and I like it a lot!
Thanks for raising this issue. I never use RStudio Server, so it was not something I would ever come across. Also, thanks for the suggested fix. When I get the chance, I will document this here (done!). Of course, this fix only helps if you are actually the admin of the RStudio Server.
I am trying to use the mathjaxr package to inline equations in roxygen2 generated documentation. I followed the steps on the github website to install mathjaxr. Testing the display via preview_rd(...) produces the correct result. However, trying directly to display the help via ?... shows the equations verbatim. In the developer console I see that the mathjax library is not loaded due to MIME type mismatch:
The resource from “http://localhost:8787/help/library/mathjaxr/doc/mathjax/es5/tex-chtml-full.js” was blocked due to MIME type (“text/plain”) mismatch (X-Content-Type-Options: nosniff).
I managed to solve the issue by adding the following line to /etc/rstudio/rserver.conf
server-add-header=X-Content-Type-Options:
Formulas are now rendered correctly in the help pane shown by RStudio server. If it is of importance, there are still some error messages in the firefox developer console,
and