微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

API输出未显示MathJax LaTex方程

如何解决API输出未显示MathJax LaTex方程

我创建了一个API,该API以HTML输出我的网站页面。一切工作正常,除了我使用以下代码Traceback (most recent call last): File "C:\python38\lib\site-packages\discord\client.py",line 312,in _run_event await coro(*args,**kwargs) File "C:\Users\cuzto\Desktop\discordBot.-py\cogs\events.py",line 106,in on_message if not message.author.permissions_in(message.channel).manage_messages: File "C:\python38\lib\site-packages\discord\user.py",line 232,in permissions_in return channel.permissions_for(self) File "C:\python38\lib\site-packages\discord\channel.py",line 146,in permissions_for base = super().permissions_for(member) File "C:\python38\lib\site-packages\discord\abc.py",line 475,in permissions_for roles = member.roles AttributeError: 'User' object has no attribute 'roles' 添加的网站上的LaTex代码不会显示在API输出上,而是在网站本身上正常工作。

在API输出上,我看到LaTex代码像这样 @commands.Cog.listener() async def on_message(self,message): if not message.author.permissions_in(message.channel).manage_messages: if "discord.gg" in message.content.lower(): await message.delete() await message.channel.send(f"temp,<@{message.author.id}>") 被剥离并显示,而不是实际格式化的数学方程式或公式。

在实际站点上,MathJax被配置为使用MathJax CDN服务,而不是服务器上托管的脚本,因此我猜测API某种程度上没有向CDN发出请求。

如何获取显示Mathjax LaTex数学方程式的API?

您的建议将不胜感激。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。