Skip to content

feat: support markdown style math tags (#12149) #1

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/unit/test_csp.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ def test_includeme():
"'sha256-U3hKDidudIaxBDEzwGJApJgPEf2mWk6cfMWghrAa6i0='",
"https://cdn.jsdelivr.net/npm/[email protected]/",
"'sha256-1CldwzdEg2k1wTmf7s5RWVd7NMXI/7nxxjJM2C4DqII='",
"'sha256-0POaN8stWYQxhzjKS+/eOfbbJ/u4YHO5ZagJvLpMypo='",
],
"style-src": [
"'self'",
Expand Down
3 changes: 3 additions & 0 deletions warehouse/csp.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ def includeme(config):
"https://cdn.jsdelivr.net/npm/[email protected]/",
# Hash for v3.2.2 of MathJax tex-svg.js
"'sha256-1CldwzdEg2k1wTmf7s5RWVd7NMXI/7nxxjJM2C4DqII='",
# Hash for MathJax inline config
# See warehouse/templates/packaging/detail.html
"'sha256-0POaN8stWYQxhzjKS+/eOfbbJ/u4YHO5ZagJvLpMypo='",
],
"style-src": [
SELF,
Expand Down
7 changes: 7 additions & 0 deletions warehouse/templates/packaging/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,13 @@ <h3>
{% endblock %}

{% block extra_js %}
<script>
MathJax = {
tex: {
inlineMath: [['$', '$'], ['\\(', '\\)']]
},
};
</script>
<script async
src="https://cdn.jsdelivr.net/npm/[email protected]/es5/tex-svg.js"
integrity="sha256-1CldwzdEg2k1wTmf7s5RWVd7NMXI/7nxxjJM2C4DqII="
Expand Down