• Robert Knight's avatar
    Fix KaTeX font loading · e3384922
    Robert Knight authored
    When rendering math, the custom KaTex fonts failed to load due to the
    relative URL references in `build/styles/katex.min.css` not matching the
    actual location of the fonts in `build/fonts`. The KaTeX CSS assumes a
    URL structure like:
    
    ```
    katex.min.css
    fonts/
      KaTeX_AMS-Regular.woff2
    ```
    
    Previously font URLs in katex.min.css were rewritten from
    `url('fonts/foo.woff2')` to `url('../fonts/foo.woff2')` by a PostCSS
    plugin when building the CSS bundles. However this got lost when
    replacing the client's local style-bundling script with the one from the
    @hypothesis/frontend-shared package.
    
    By relocating the fonts to a subdirectory of `build/styles` we can make
    the asset references work without needing to do any rewriting of URLs in
    the KaTeX CSS bundle.
    
    In the process, the list of fonts included in the bundle was simplified
    to include just WOFF2 fonts, since all modern browsers support that
    format. Additionally an obsolete reference to fonts in src/styles/vendor
    was removed.
    e3384922
Name
Last commit
Last update
.github Loading commit data...
bin Loading commit data...
dev-server Loading commit data...
docs Loading commit data...
embedding-examples Loading commit data...
images Loading commit data...
requirements Loading commit data...
scripts Loading commit data...
src Loading commit data...
.babelrc Loading commit data...
.dockerignore Loading commit data...
.eslintignore Loading commit data...
.eslintrc Loading commit data...
.gitignore Loading commit data...
.npmignore Loading commit data...
.npmrc Loading commit data...
.prettierignore Loading commit data...
.python-version Loading commit data...
CODE_OF_CONDUCT Loading commit data...
Dockerfile Loading commit data...
Jenkinsfile Loading commit data...
LICENSE Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
codecov.yml Loading commit data...
gulpfile.mjs Loading commit data...
package.json Loading commit data...
pyproject.toml Loading commit data...
requirements-dev.in Loading commit data...
rollup-tests.config.mjs Loading commit data...
rollup.config.mjs Loading commit data...
tox.ini Loading commit data...
tsconfig.json Loading commit data...
yarn.lock Loading commit data...