miniflux / v2

Minimalist and opinionated feed reader
https://miniflux.app
Apache License 2.0
6.65k stars 706 forks source link

Support correct display of latex math formulas #1690

Open aaro-n opened 1 year ago

aaro-n commented 1 year ago
sherlcok314159 commented 6 months ago

提供一下解决方案:

  1. fork 该仓库,然后看 doc 进行跑通
  2. 在代码中的 template/templates/common/layout.html 的第 24 行加入以下代码:
    <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
    <script>
    MathJax = {
        tex: {
            inlineMath: [['$', '$'], ['\\(', '\\)']],
            tags: 'ams'
        },
        chtml:{
                minScale: .9,                  // smallest scaling factor to use
        }
    };
    </script>
    <script id="MathJax-script" async
    src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js">
    </script>
  1. 注释掉有关 Content-Security-Policy 的部分,即下方的 if-end 段
  2. 重新运行即可看到渲染后的结果