why report 'file failed to load https://cdn.jsdelivr.net/npm/mathjax@2/jax/input/Tex/config.js' after configuration?
Closed this issue · 11 comments
I intended to use python-markdown-math to support math formula rendering, so i followed official tutorial to try to make such rendering work. i embeded CDN link 'https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js' into script tag like this:
{% block scripts %}
{{ super() }}
{{ pagedown.include_pagedown() }}
<script type='text'/javascript' id='MathJax-script' async src='https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js'>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
config: ["MMLorHTML.js"],
jax: ["input/Tex", "output/HTML-CSS", "output/NativeMML"],
extensions: ["MathMenu.js", "MathZoom.js"]
});
</script>
{% endblock %}
when i typed some math formula, the Edge browser reported message on web as follows :
' start to load [MathJax]input/Tex/config.js' ,
'file failed to load https://cdn.jsdelivr.net/npm/mathjax@2/jax/input/Tex/config.js'
i have checked each step and code carefully, use search engine, but can't figure it out. It really muddles me, so i presume to ask for help.
jax: ["input/Tex", "output/HTML-CSS", "output/NativeMML"],
You have a capitalization error in this line. It should be TeX
, not Tex
.
jax: ["input/Tex", "output/HTML-CSS", "output/NativeMML"],
You have a capitalization error in this line. It should be
TeX
, notTex
.
Thank you so much! There is no such report message after string modification, but it still seems that no formula is rendered.
For example, i typed the following formula:
\(e^x\)
and the above formula will be shown as '(e^x)e^x',
i made configuration in markdown.markdown function as follows:
extensions=['mdx_math'],
extension_configs={
'mdx_math': {
'enable_dollar_delimiter': True,
'add_preview': True
}
and the result of another input (
Can you show the full generated HTML please?
Can you show the full generated HTML please?
This is index html which inherits from base.html :
{% import 'bootstrap/wtf.html' as wtf %}
{% block app_content %}
<h1>{{ _('Hi, %(username)s!', username=current_user.username) }}</h1>
{% if form %}
{{ wtf.quick_form(form) }}
{% endif %}
{% for post in posts %}
{% include '_post.html' %}
{% endfor %}
<nav aria-label="...">
<ul class="pager">
<li class="previous{% if not prev_url %} disabled{% endif %}">
<a href="{{ prev_url or '#' }}">
<span aria-hidden="true">←</span> {{ _('Newer posts') }}
</a>
</li>
<li class="next{% if not next_url %} disabled{% endif %}">
<a href="{{ next_url or '#' }}">
{{ _('Older posts') }} <span aria-hidden="true">→</span>
</a>
</li>
</ul>
</nav>
{% endblock %}
{% block scripts %}
{{ super() }}
{{ pagedown.include_pagedown() }}
<script type="text/javascript" id='MathJax-script' async
src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js">
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
config: ["MMLorHTML.js"],
jax: ["input/TeX", "output/HTML-CSS", "output/NativeMML"],
extensions: ["MathMenu.js", "MathZoom.js"]
});
</script>
{% endblock %}```
By the way, the above full function is:
```def on_changed_body(target, value, oldvalue, initiator):
allowed_tags = ['a', 'abbr', 'acronym', 'b', 'blockquote', 'code', # define allowed html tags for Markdown
'em', 'i', 'li', 'ol', 'pre', 'strong', 'ul',
'h1', 'h2', 'h3', 'p', 'img', 'kbd', 'sup', 'sub', 'br',
'table', 'footer', 'thead', 'tbody', 'tr', 'th']
target.body_html = bleach.linkify(bleach.clean(
markdown(value, output_format='html',
extensions=['mdx_math'],
extension_configs={
'mdx_math': {
'enable_dollar_delimiter': True,
'add_preview': True
}
}),
tags=allowed_tags, strip=True))```
Sorry, you show me the template, but I want to see the final generated result. Can you please paste or attach it?
Sorry, you show me the template, but I want to see the final generated result. Can you please paste or attach it?
The final generated result just like this:
and the corresponding source code was pasted below:
<html>
<body>
<!--StartFragment-->
| <!DOCTYPE html>
-- | --
| <html>
| <head>
| <title>
| 主页 - Microblog
| </title>
| <meta name="viewport" content="width=device-width, initial-scale=1.0">
| <!-- Bootstrap -->
| <link href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
| </head>
| <body>
|
| <nav class="navbar navbar-default">
| <div class="container">
| <div class="navbar-header">
| <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
| <span class="sr-only">Toggle navigation</span>
| <span class="icon-bar"></span>
| <span class="icon-bar"></span>
| <span class="icon-bar"></span>
| </button>
| <a class="navbar-brand" href="/index">Microblog</a>
| </div>
| <div class="collapse navbar-collapse" id="bs-exmaple-navbar-collapse-1">
| <ul class="nav navbar-nav">
| <li><a href="/index">主页</a></li>
| <li><a href="/explore">更多评论</a></li>
| <li><a href="/upload">文件</a></li>
| </ul>
|
| <form class="navbar-form navbar-left" method="get" action="/search">
| <div class="form-group">
| <input class="form-control" id="q" name="q" placeholder="搜索" required size="20" type="text" value="">
| </div>
| </form>
|
| <ul class="nav navbar-nav navbar-right">
| <li>
|
| </li>
| <li><a href="/user/Markdown">个人资料</a></li>
| <li><a href="/auth/logout">登出</a></li>
|
| </ul>
| </div>
| </div>
| </nav>
|
| <div class="container">
| <h1>你好,Markdown!</h1>
| <form action="" method="post"
| class="form" role="form">
| <input id="csrf_token" name="csrf_token" type="hidden" value="IjVjZmU1NTQ4NWVkNTA2ZmIyNmEwMmE4ZjQ3Nzc0NTRmMzU5YTU3YjUi.Y882Rg.Ry6oJG-rhHwQ28HMGQrD4G_7lCw">
|
| <div class="form-group required"><label class="control-label" for="post">说点什么吧</label>
|
| <div class="flask-pagedown"><textarea class="form-control flask-pagedown-input" id="flask-pagedown-post" name="post" required>
| </textarea></div>
| <div class="flask-pagedown-preview" id="flask-pagedown-post-preview"></div>
| <script type="text/javascript">
| f = function() {
| if (typeof flask_pagedown_converter === "undefined")
| flask_pagedown_converter = Markdown.getSanitizingConverter().makeHtml;
| var textarea = document.getElementById("flask-pagedown-post");
| var preview = document.getElementById("flask-pagedown-post-preview");
| textarea.onkeyup = function() { preview.innerHTML = flask_pagedown_converter(textarea.value); }
| textarea.onkeyup.call(textarea);
| }
| if (document.readyState === 'complete')
| f();
| else if (window.addEventListener)
| window.addEventListener("load", f, false);
| else if (window.attachEvent)
| window.attachEvent("onload", f);
| else
| f();
| </script>
|
|
| </div>
|
| <input class="btn btn-default" id="submit" name="submit" type="submit" value="提交">
|
|</form>
| <table class="table table-hover">
| <tr>
| <td width="70px">
| <a href="/user/Markdown">
| <img src="https://www.gravatar.com/avatar/1f1175a8d2bae978ff54cc63d4f94875?d=identicon&s=70">
| </a>
| </td>
| <td>
|
|
| <a href="/user/Markdown">
| Markdown
| </a>
| 发布于 <span class="flask-moment" data-timestamp="2023-01-15T06:23:06Z" data-function="fromNow" data-refresh="0" style="display: none">2023-01-15T06:23:06Z</span>
| <br>
|
|
| <span id='post16'><p><code>json
| {'name': 'john', 'gender': 'male'}</code></p></span><br>
|
| <div style="text-align: right;">
|
| <form method="post" action="/post/16/delete" style="display: inline;">
| <input id="csrf_token" name="csrf_token" type="hidden" value="IjVjZmU1NTQ4NWVkNTA2ZmIyNmEwMmE4ZjQ3Nzc0NTRmMzU5YTU3YjUi.Y882Rg.Ry6oJG-rhHwQ28HMGQrD4G_7lCw">
| <input class="btn" type='submit' name="delete" value="Delete" onclick="return confirm('Are you sure?')">
| </form>
|
| <a href="/edit/16">编辑</a>
| <a href="/post/16">0 条评论</a>
| </div>
| </td>
|
| <br><br>
| <span id="translation16">
| <a href="javascript:translate(
| '#post16',
| '#translation16',
| 'af',
| 'zh');">翻译</a>
| </span>
|
| </tr>
| </table>
|
| <table class="table table-hover">
| <tr>
| <td width="70px">
| <a href="/user/Markdown">
| <img src="https://www.gravatar.com/avatar/1f1175a8d2bae978ff54cc63d4f94875?d=identicon&s=70">
| </a>
| </td>
| <td>
|
|
| <a href="/user/Markdown">
| Markdown
| </a>
| 发布于 <span class="flask-moment" data-timestamp="2023-01-15T05:59:22Z" data-function="fromNow" data-refresh="0" style="display: none">2023-01-15T05:59:22Z</span>
| <br>
|
|
| <span id='post15'><pre>pre标签以源文本
| 预定格式
| 编排
| 视觉效果类似代码块
| </pre></span><br>
|
| <div style="text-align: right;">
|
| <form method="post" action="/post/15/delete" style="display: inline;">
| <input id="csrf_token" name="csrf_token" type="hidden" value="IjVjZmU1NTQ4NWVkNTA2ZmIyNmEwMmE4ZjQ3Nzc0NTRmMzU5YTU3YjUi.Y882Rg.Ry6oJG-rhHwQ28HMGQrD4G_7lCw">
| <input class="btn" type='submit' name="delete" value="Delete" onclick="return confirm('Are you sure?')">
| </form>
|
| <a href="/edit/15">编辑</a>
| <a href="/post/15">0 条评论</a>
| </div>
| </td>
|
| </tr>
| </table>
|
| <table class="table table-hover">
| <tr>
| <td width="70px">
| <a href="/user/Markdown">
| <img src="https://www.gravatar.com/avatar/1f1175a8d2bae978ff54cc63d4f94875?d=identicon&s=70">
| </a>
| </td>
| <td>
|
|
| <a href="/user/Markdown">
| Markdown
| </a>
| 发布于 <span class="flask-moment" data-timestamp="2023-01-15T05:54:16Z" data-function="fromNow" data-refresh="0" style="display: none">2023-01-15T05:54:16Z</span>
| <br>
|
|
| <span id='post14'><ul>
| <li>first item <ul>
| <li>indented item</li>
| </ul>
| </li>
| <li>second item </li>
| </ul></span><br>
|
| <div style="text-align: right;">
|
| <form method="post" action="/post/14/delete" style="display: inline;">
| <input id="csrf_token" name="csrf_token" type="hidden" value="IjVjZmU1NTQ4NWVkNTA2ZmIyNmEwMmE4ZjQ3Nzc0NTRmMzU5YTU3YjUi.Y882Rg.Ry6oJG-rhHwQ28HMGQrD4G_7lCw">
| <input class="btn" type='submit' name="delete" value="Delete" onclick="return confirm('Are you sure?')">
| </form>
|
| <a href="/edit/14">编辑</a>
| <a href="/post/14">0 条评论</a>
| </div>
| </td>
|
| <br><br>
| <span id="translation14">
| <a href="javascript:translate(
| '#post14',
| '#translation14',
| 'la',
| 'zh');">翻译</a>
| </span>
|
| </tr>
| </table>
|
| <table class="table table-hover">
| <tr>
| <td width="70px">
| <a href="/user/Markdown">
| <img src="https://www.gravatar.com/avatar/1f1175a8d2bae978ff54cc63d4f94875?d=identicon&s=70">
| </a>
| </td>
| <td>
|
|
| <a href="/user/Markdown">
| Markdown
| </a>
| 发布于 <span class="flask-moment" data-timestamp="2023-01-15T05:53:01Z" data-function="fromNow" data-refresh="0" style="display: none">2023-01-15T05:53:01Z</span>
| <br>
|
|
| <span id='post13'><ol>
| <li>fisrt item </li>
| <li>first item <ol>
| <li>indented item </li>
| <li>indented item </li>
| </ol>
| </li>
| <li>third item</li>
| </ol></span><br>
|
| <div style="text-align: right;">
|
| <form method="post" action="/post/13/delete" style="display: inline;">
| <input id="csrf_token" name="csrf_token" type="hidden" value="IjVjZmU1NTQ4NWVkNTA2ZmIyNmEwMmE4ZjQ3Nzc0NTRmMzU5YTU3YjUi.Y882Rg.Ry6oJG-rhHwQ28HMGQrD4G_7lCw">
| <input class="btn" type='submit' name="delete" value="Delete" onclick="return confirm('Are you sure?')">
| </form>
|
| <a href="/edit/13">编辑</a>
| <a href="/post/13">0 条评论</a>
| </div>
| </td>
|
| <br><br>
| <span id="translation13">
| <a href="javascript:translate(
| '#post13',
| '#translation13',
| 'la',
| 'zh');">翻译</a>
| </span>
|
| </tr>
| </table>
|
| <table class="table table-hover">
| <tr>
| <td width="70px">
| <a href="/user/Markdown">
| <img src="https://www.gravatar.com/avatar/1f1175a8d2bae978ff54cc63d4f94875?d=identicon&s=70">
| </a>
| </td>
| <td>
|
|
| <a href="/user/Markdown">
| Markdown
| </a>
| 发布于 <span class="flask-moment" data-timestamp="2023-01-15T05:48:57Z" data-function="fromNow" data-refresh="0" style="display: none">2023-01-15T05:48:57Z</span>
| <br>
|
|
| <span id='post12'><ol>
| <li>first item</li>
| <li>second item </li>
| <li>third item </li>
| </ol></span><br>
|
| <div style="text-align: right;">
|
| <form method="post" action="/post/12/delete" style="display: inline;">
| <input id="csrf_token" name="csrf_token" type="hidden" value="IjVjZmU1NTQ4NWVkNTA2ZmIyNmEwMmE4ZjQ3Nzc0NTRmMzU5YTU3YjUi.Y882Rg.Ry6oJG-rhHwQ28HMGQrD4G_7lCw">
| <input class="btn" type='submit' name="delete" value="Delete" onclick="return confirm('Are you sure?')">
| </form>
|
| <a href="/edit/12">编辑</a>
| <a href="/post/12">0 条评论</a>
| </div>
| </td>
|
| <br><br>
| <span id="translation12">
| <a href="javascript:translate(
| '#post12',
| '#translation12',
| 'en',
| 'zh');">翻译</a>
| </span>
|
| </tr>
| </table>
|
| <table class="table table-hover">
| <tr>
| <td width="70px">
| <a href="/user/Markdown">
| <img src="https://www.gravatar.com/avatar/1f1175a8d2bae978ff54cc63d4f94875?d=identicon&s=70">
| </a>
| </td>
| <td>
|
|
| <a href="/user/Markdown">
| Markdown
| </a>
| 发布于 <span class="flask-moment" data-timestamp="2023-01-15T05:41:44Z" data-function="fromNow" data-refresh="0" style="display: none">2023-01-15T05:41:44Z</span>
| <br>
|
|
| <span id='post11'><p>使用 <kbd>Ctrl</kbd>+<kbd>C</kbd> 复制分子式 H<sub>2</sub>O, 并计算a<sup>2</sup></p></span><br>
|
| <div style="text-align: right;">
|
| <form method="post" action="/post/11/delete" style="display: inline;">
| <input id="csrf_token" name="csrf_token" type="hidden" value="IjVjZmU1NTQ4NWVkNTA2ZmIyNmEwMmE4ZjQ3Nzc0NTRmMzU5YTU3YjUi.Y882Rg.Ry6oJG-rhHwQ28HMGQrD4G_7lCw">
| <input class="btn" type='submit' name="delete" value="Delete" onclick="return confirm('Are you sure?')">
| </form>
|
| <a href="/edit/11">编辑</a>
| <a href="/post/11">0 条评论</a>
| </div>
| </td>
|
| <br><br>
| <span id="translation11">
| <a href="javascript:translate(
| '#post11',
| '#translation11',
| 'et',
| 'zh');">翻译</a>
| </span>
|
| </tr>
| </table>
|
| <table class="table table-hover">
| <tr>
| <td width="70px">
| <a href="/user/Markdown">
| <img src="https://www.gravatar.com/avatar/1f1175a8d2bae978ff54cc63d4f94875?d=identicon&s=70">
| </a>
| </td>
| <td>
|
|
| <a href="/user/Markdown">
| Markdown
| </a>
| 发布于 <span class="flask-moment" data-timestamp="2023-01-15T05:15:15Z" data-function="fromNow" data-refresh="0" style="display: none">2023-01-15T05:15:15Z</span>
| <br>
|
|
| <span id='post10'><p><code>single code, not code block</code></p></span><br>
|
| <div style="text-align: right;">
|
| <form method="post" action="/post/10/delete" style="display: inline;">
| <input id="csrf_token" name="csrf_token" type="hidden" value="IjVjZmU1NTQ4NWVkNTA2ZmIyNmEwMmE4ZjQ3Nzc0NTRmMzU5YTU3YjUi.Y882Rg.Ry6oJG-rhHwQ28HMGQrD4G_7lCw">
| <input class="btn" type='submit' name="delete" value="Delete" onclick="return confirm('Are you sure?')">
| </form>
|
| <a href="/edit/10">编辑</a>
| <a href="/post/10">0 条评论</a>
| </div>
| </td>
|
| <br><br>
| <span id="translation10">
| <a href="javascript:translate(
| '#post10',
| '#translation10',
| 'en',
| 'zh');">翻译</a>
| </span>
|
| </tr>
| </table>
|
| <table class="table table-hover">
| <tr>
| <td width="70px">
| <a href="/user/Markdown">
| <img src="https://www.gravatar.com/avatar/1f1175a8d2bae978ff54cc63d4f94875?d=identicon&s=70">
| </a>
| </td>
| <td>
|
|
| <a href="/user/Markdown">
| Markdown
| </a>
| 发布于 <span class="flask-moment" data-timestamp="2023-01-15T05:14:39Z" data-function="fromNow" data-refresh="0" style="display: none">2023-01-15T05:14:39Z</span>
| <br>
|
|
| <span id='post9'><pre><code>`a code block` in your markdown file
| 'print('this is code.')`
| </code></pre></span><br>
|
| <div style="text-align: right;">
|
| <form method="post" action="/post/9/delete" style="display: inline;">
| <input id="csrf_token" name="csrf_token" type="hidden" value="IjVjZmU1NTQ4NWVkNTA2ZmIyNmEwMmE4ZjQ3Nzc0NTRmMzU5YTU3YjUi.Y882Rg.Ry6oJG-rhHwQ28HMGQrD4G_7lCw">
| <input class="btn" type='submit' name="delete" value="Delete" onclick="return confirm('Are you sure?')">
| </form>
|
| <a href="/edit/9">编辑</a>
| <a href="/post/9">0 条评论</a>
| </div>
| </td>
|
| <br><br>
| <span id="translation9">
| <a href="javascript:translate(
| '#post9',
| '#translation9',
| 'la',
| 'zh');">翻译</a>
| </span>
|
| </tr>
| </table>
|
| <table class="table table-hover">
| <tr>
| <td width="70px">
| <a href="/user/Markdown">
| <img src="https://www.gravatar.com/avatar/1f1175a8d2bae978ff54cc63d4f94875?d=identicon&s=70">
| </a>
| </td>
| <td>
|
|
| <a href="/user/Markdown">
| Markdown
| </a>
| 发布于 <span class="flask-moment" data-timestamp="2023-01-15T05:10:23Z" data-function="fromNow" data-refresh="0" style="display: none">2023-01-15T05:10:23Z</span>
| <br>
|
|
| <span id='post8'><blockquote>
| <p>blockquote content</p>
| </blockquote></span><br>
|
| <div style="text-align: right;">
|
| <form method="post" action="/post/8/delete" style="display: inline;">
| <input id="csrf_token" name="csrf_token" type="hidden" value="IjVjZmU1NTQ4NWVkNTA2ZmIyNmEwMmE4ZjQ3Nzc0NTRmMzU5YTU3YjUi.Y882Rg.Ry6oJG-rhHwQ28HMGQrD4G_7lCw">
| <input class="btn" type='submit' name="delete" value="Delete" onclick="return confirm('Are you sure?')">
| </form>
|
| <a href="/edit/8">编辑</a>
| <a href="/post/8">0 条评论</a>
| </div>
| </td>
|
| </tr>
| </table>
|
| <table class="table table-hover">
| <tr>
| <td width="70px">
| <a href="/user/Markdown">
| <img src="https://www.gravatar.com/avatar/1f1175a8d2bae978ff54cc63d4f94875?d=identicon&s=70">
| </a>
| </td>
| <td>
|
|
| <a href="/user/Markdown">
| Markdown
| </a>
| 发布于 <span class="flask-moment" data-timestamp="2023-01-15T04:40:12Z" data-function="fromNow" data-refresh="0" style="display: none">2023-01-15T04:40:12Z</span>
| <br>
|
|
| <span id='post7'><p><abbr title="Hyper Text Markup Language">HTML</abbr></p></span><br>
|
| <div style="text-align: right;">
|
| <form method="post" action="/post/7/delete" style="display: inline;">
| <input id="csrf_token" name="csrf_token" type="hidden" value="IjVjZmU1NTQ4NWVkNTA2ZmIyNmEwMmE4ZjQ3Nzc0NTRmMzU5YTU3YjUi.Y882Rg.Ry6oJG-rhHwQ28HMGQrD4G_7lCw">
| <input class="btn" type='submit' name="delete" value="Delete" onclick="return confirm('Are you sure?')">
| </form>
|
| <a href="/edit/7">编辑</a>
| <a href="/post/7">0 条评论</a>
| </div>
| </td>
|
| <br><br>
| <span id="translation7">
| <a href="javascript:translate(
| '#post7',
| '#translation7',
| 'da',
| 'zh');">翻译</a>
| </span>
|
| </tr>
| </table>
|
| <table class="table table-hover">
| <tr>
| <td width="70px">
| <a href="/user/Markdown">
| <img src="https://www.gravatar.com/avatar/1f1175a8d2bae978ff54cc63d4f94875?d=identicon&s=70">
| </a>
| </td>
| <td>
|
|
| <a href="/user/Markdown">
| Markdown
| </a>
| 发布于 <span class="flask-moment" data-timestamp="2023-01-15T04:11:55Z" data-function="fromNow" data-refresh="0" style="display: none">2023-01-15T04:11:55Z</span>
| <br>
|
|
| <span id='post6'><p><a href="https://jtping.pythonanywhere.com/" rel="nofollow">电影打卡</a></p></span><br>
|
| <div style="text-align: right;">
|
| <form method="post" action="/post/6/delete" style="display: inline;">
| <input id="csrf_token" name="csrf_token" type="hidden" value="IjVjZmU1NTQ4NWVkNTA2ZmIyNmEwMmE4ZjQ3Nzc0NTRmMzU5YTU3YjUi.Y882Rg.Ry6oJG-rhHwQ28HMGQrD4G_7lCw">
| <input class="btn" type='submit' name="delete" value="Delete" onclick="return confirm('Are you sure?')">
| </form>
|
| <a href="/edit/6">编辑</a>
| <a href="/post/6">0 条评论</a>
| </div>
| </td>
|
| <br><br>
| <span id="translation6">
| <a href="javascript:translate(
| '#post6',
| '#translation6',
| 'en',
| 'zh');">翻译</a>
| </span>
|
| </tr>
| </table>
|
| <table class="table table-hover">
| <tr>
| <td width="70px">
| <a href="/user/Markdown">
| <img src="https://www.gravatar.com/avatar/1f1175a8d2bae978ff54cc63d4f94875?d=identicon&s=70">
| </a>
| </td>
| <td>
|
|
| <a href="/user/Markdown">
| Markdown
| </a>
| 发布于 <span class="flask-moment" data-timestamp="2023-01-15T04:10:31Z" data-function="fromNow" data-refresh="0" style="display: none">2023-01-15T04:10:31Z</span>
| <br>
|
|
| <span id='post5'><p>这是一个链接 <a href="http://markdown.com.cn" rel="nofollow">markdown</a></p></span><br>
|
| <div style="text-align: right;">
|
| <form method="post" action="/post/5/delete" style="display: inline;">
| <input id="csrf_token" name="csrf_token" type="hidden" value="IjVjZmU1NTQ4NWVkNTA2ZmIyNmEwMmE4ZjQ3Nzc0NTRmMzU5YTU3YjUi.Y882Rg.Ry6oJG-rhHwQ28HMGQrD4G_7lCw">
| <input class="btn" type='submit' name="delete" value="Delete" onclick="return confirm('Are you sure?')">
| </form>
|
| <a href="/edit/5">编辑</a>
| <a href="/post/5">0 条评论</a>
| </div>
| </td>
|
| <br><br>
| <span id="translation5">
| <a href="javascript:translate(
| '#post5',
| '#translation5',
| 'pt',
| 'zh');">翻译</a>
| </span>
|
| </tr>
| </table>
|
| <table class="table table-hover">
| <tr>
| <td width="70px">
| <a href="/user/Markdown">
| <img src="https://www.gravatar.com/avatar/1f1175a8d2bae978ff54cc63d4f94875?d=identicon&s=70">
| </a>
| </td>
| <td>
|
|
| <a href="/user/Markdown">
| Markdown
| </a>
| 发布于 <span class="flask-moment" data-timestamp="2023-01-13T03:51:21Z" data-function="fromNow" data-refresh="0" style="display: none">2023-01-13T03:51:21Z</span>
| <br>
|
|
| <span id='post4'><h3>Markdown level fourth</h3>
| <p><strong><em>headquarters</em></strong> is in north, fly !</p></span><br>
|
| <div style="text-align: right;">
|
| <form method="post" action="/post/4/delete" style="display: inline;">
| <input id="csrf_token" name="csrf_token" type="hidden" value="IjVjZmU1NTQ4NWVkNTA2ZmIyNmEwMmE4ZjQ3Nzc0NTRmMzU5YTU3YjUi.Y882Rg.Ry6oJG-rhHwQ28HMGQrD4G_7lCw">
| <input class="btn" type='submit' name="delete" value="Delete" onclick="return confirm('Are you sure?')">
| </form>
|
| <a href="/edit/4">编辑</a>
| <a href="/post/4">1 条评论</a>
| </div>
| </td>
|
| <br><br>
| <span id="translation4">
| <a href="javascript:translate(
| '#post4',
| '#translation4',
| 'en',
| 'zh');">翻译</a>
| </span>
|
| </tr>
| </table>
|
| <table class="table table-hover">
| <tr>
| <td width="70px">
| <a href="/user/Markdown">
| <img src="https://www.gravatar.com/avatar/1f1175a8d2bae978ff54cc63d4f94875?d=identicon&s=70">
| </a>
| </td>
| <td>
|
|
| <a href="/user/Markdown">
| Markdown
| </a>
| 发布于 <span class="flask-moment" data-timestamp="2023-01-12T00:54:39Z" data-function="fromNow" data-refresh="0" style="display: none">2023-01-12T00:54:39Z</span>
| <br>
|
|
| <span id='post3'><p>民生最念狂风后,世事常思细雨前.</p></span><br>
|
| <div style="text-align: right;">
|
| <form method="post" action="/post/3/delete" style="display: inline;">
| <input id="csrf_token" name="csrf_token" type="hidden" value="IjVjZmU1NTQ4NWVkNTA2ZmIyNmEwMmE4ZjQ3Nzc0NTRmMzU5YTU3YjUi.Y882Rg.Ry6oJG-rhHwQ28HMGQrD4G_7lCw">
| <input class="btn" type='submit' name="delete" value="Delete" onclick="return confirm('Are you sure?')">
| </form>
|
| <a href="/edit/3">编辑</a>
| <a href="/post/3">1 条评论</a>
| </div>
| </td>
|
| </tr>
| </table>
|
| <table class="table table-hover">
| <tr>
| <td width="70px">
| <a href="/user/susan">
| <img src="https://www.gravatar.com/avatar/8686902614ba532f8ee84522b5adbca5?d=identicon&s=70">
| </a>
| </td>
| <td>
|
|
| <a href="/user/susan">
| susan
| </a>
| 发布于 <span class="flask-moment" data-timestamp="2022-12-08T02:37:48Z" data-function="fromNow" data-refresh="0" style="display: none">2022-12-08T02:37:48Z</span>
| <br>
|
| <span id='post2'>guilty</span><br>
|
| <div style="text-align: right;">
|
| <a href="/edit/2">编辑</a>
| <a href="/post/2">0 条评论</a>
| </div>
| </td>
|
| </tr>
| </table>
|
| <nav aria-label="...">
| <ul class="pager">
| <li class="previous disabled">
| <a href="#">
| <span aria-hidden="true">←</span> 新的帖子
| </a>
| </li>
| <li class="next disabled">
| <a href="#">
| 旧的帖子 <span aria-hidden="true">→</span>
| </a>
| </li>
| </ul>
| </nav>
|
| </div>
|
|
|
|
|
| <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
| <script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
| <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.4/moment-with-locales.min.js" integrity="sha512-42PE0rd+wZ2hNXftlM78BSehIGzezNeQuzihiBCvUEB3CVxHvsShF86wBWwQORNxNINlBPuq7rG4WWhNiTVHFg==" crossorigin="anonymous"></script>
|
| <script>
| moment.locale("en");
| function flask_moment_render(elem) {{
| const timestamp = moment(elem.dataset.timestamp);
| const func = elem.dataset.function;
| const format = elem.dataset.format;
| const timestamp2 = elem.dataset.timestamp2;
| const no_suffix = elem.dataset.nosuffix;
| const units = elem.dataset.units;
| let args = [];
| if (format)
| args.push(format);
| if (timestamp2)
| args.push(moment(timestamp2));
| if (no_suffix)
| args.push(no_suffix);
| if (units)
| args.push(units);
| elem.textContent = timestamp[func].apply(timestamp, args);
| elem.classList.remove('flask-moment');
| elem.style.display = "";
| }}
| function flask_moment_render_all() {{
| const moments = document.querySelectorAll('.flask-moment');
| moments.forEach(function(moment) {{
| flask_moment_render(moment);
| const refresh = moment.dataset.refresh;
| if (refresh && refresh > 0) {{
| (function(elem, interval) {{
| setInterval(function() {{
| flask_moment_render(elem);
| }}, interval);
| }})(moment, refresh);
| }}
| }})
| }}
| document.addEventListener("DOMContentLoaded", flask_moment_render_all);
| </script>
|
| <script>
| moment.locale("zh");
| </script>
| <script>
| function translate(sourceElem, destElem, sourceLang, destLang) {
| $(destElem).html("<img src='/static/loading.gif' "); /* $ is jQuery() function as abbrevation */
| $.post('/translate', {
| text: $(sourceElem).text(), /* $(#elem) is a selector syntax of jQuery */
| source_language: sourceLang,
| dest_language: Lang,
| }).done(function(response) { // success callback
| $(destElem).text(response['text'])
| }).fail(function() { // error callback
| $(destElem).text("错误:无法连接服务器.");
| });
| }
| </script>
|
|
| <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/pagedown/1.0/Markdown.Converter.min.js"></script>
| <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/pagedown/1.0/Markdown.Sanitizer.min.js"></script>
|
| <script type="text/javascript" id='MathJax-script' async
| src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js">
| </script>
| <script type="text/x-mathjax-config">
| MathJax.Hub.Config({
| config: ["MMLorHTML.js"],
| jax: ["input/TeX", "output/HTML-CSS", "output/NativeMML"],
| extensions: ["MathMenu.js", "MathZoom.js"]
| });
| </script>
|
| </body>
| </html>
|
<!--EndFragment-->
</body>
</html>```
This is almost what I want, but:
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pagedown/1.0/Markdown.Converter.min.js"></script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pagedown/1.0/Markdown.Sanitizer.min.js"></script>
Here you are using pagedown JS library, not Python-Markdown!
How is it related to python-markdown-math?
You probably need to add some integration between pagedown and mathjax. Google returns some results if you search for pagedown mathjax
.