Comments (23)
文件样例已经很简单明了,您可以选用任意自己熟悉的语言和技术进行解析,只要保证xml文本兼容即可。
from freeproblemset.
对于Katex的编码方案是否有一套规范?内联样式表并直接插入HTML不仅使得题目内容无法二次编辑,而且存在安全性问题,是否有方法进行转码?
from freeproblemset.
另,希望对languageId提出一套统一的规范。如c++在不同平台中可能表示为 c++ cpp cc cxx 等多种形式。
from freeproblemset.
另,希望对languageId提出一套统一的规范。如c++在不同平台中可能表示为 c++ cpp cc cxx 等多种形式。
然而他们都是c++,这里只提供标准,谁实现解析器谁负责翻译。
from freeproblemset.
对于Katex的编码方案是否有一套规范?内联样式表并直接插入HTML不仅使得题目内容无法二次编辑,而且存在安全性问题,是否有方法进行转码?
嵌入的html编辑如何实现问题,请实现解析的系统自行解决。
fps只存储交换数据用,不考虑二次编辑。
from freeproblemset.
然而他们都是c++,这里只提供标准,谁实现解析器谁负责翻译。
应对导出时提供统一的规范,如c++仅能导出为cpp
嵌入的html编辑如何实现问题,请实现解析的系统自行解决。
fps只存储交换数据用,不考虑二次编辑。
Katex不同版本的css不兼容,且未提供原始MathML,存在兼容性问题。
from freeproblemset.
以及一本通的example是不是把output全搞成input了((
from freeproblemset.
确实有这些问题,能力有限,欢迎PR
from freeproblemset.
- 个人认为不应当允许导出
<div class="xxx">
。 - 建议指定导出原始Katex code(如
<latex>x^2</latex>
此类)
这将定义一套新版本方案,可能需要各端进行适配。
from freeproblemset.
现行阶段支持本标准的OnlineJudge实现还比较少,已有的数据都使用html作为文本内容的存储格式,也许给出hustoj的直接补丁,可以作为其他实现的参考。
from freeproblemset.
Katex 虽然是一种更高级的技术,但是目前看不如html的兼容普遍性好,个人倾向于在跨系统传递保存时,将数学公式复杂图表统一转成图片形式进行处理,实现起来代码更简练,可以方便更多的其他系统来兼容实现本标准。
from freeproblemset.
不建议使用图片存储,理由如下:
- 几乎所有OnlineJudge均支持Katex。
- 后端很难导出时将Katex渲染为图片。
from freeproblemset.
几乎所有OnlineJudge均支持Katex?
恕我孤陋寡闻,POJ HDUOJ ZJU 都已经支持Katex了么?
后端很难导出时将Katex渲染为图片。
如果当初加题的时候就加成图片,就没这么麻烦了,对吧
from freeproblemset.
https://katex.org/ 上面写着
Server side rendering: KaTeX produces the same output regardless of browser or environment, so you can pre-render expressions using Node.js and send them as plain HTML.
也就是说它自己都认为HTML能更好的兼容老式浏览器,以致于要开发相关的代码做这件事。
from freeproblemset.
https://katex.org/ 上面写着
Server side rendering: KaTeX produces the same output regardless of browser or environment, so you can pre-render expressions using Node.js and send them as plain HTML.
也就是说它自己都认为HTML能更好的兼容老式浏览器,以致于要开发相关的代码做这件事。
Server-side-render仅为渲染为HTML。 渲染出的HTML是不存在 跨Katex 版本的兼容性的。
如: Katex0.10渲染出的HTML在Katex0.11版本css显示时会存在上下标偏移的问题。
纠正:原文意为 katex.min.js 在老式版本浏览器的兼容性可能不佳,和 HTML 无关。
from freeproblemset.
如果能够导出为 png/svg 的话会好很多,但相关技术仍不够成熟。
from freeproblemset.
作为开发者,我更关注的是广泛使用的开源项目(qduoj/dmoj/syzoj/vijos),而非 poj 此类高校使用,内部维护,无计划兼容fps协议的系统。
from freeproblemset.
这样的话,希望你能从开发者角度给出katex兼容实现的标准建议,显然你对这个技术比我更熟悉。
from freeproblemset.
最好能给出实现代码,方便我学习新技术
from freeproblemset.
如果继续使用HTML交换(这确实是兼容性最佳的方案),我建议导出富文本源码。<latex>x^2</latex>
此类,交给各平台导入,导出时处理。这在保证兼容性的同时提供了二次编辑支持,同时,对于使用markdown存储的后端服务器,可以很方便使用 turndown 配合
turndown.addRule('latex', {
filter: ['latex'],
replacement: function (content) {
return '$' + content + '$'
}
});
快速转换。另,这将提供对希望使用MathJax系统的更优兼容方案。
补充: 为什么不使用 pre-rendered html?
当前使用 <link rel="stylesheet">
的方案存在注入风险。
from freeproblemset.
这个看起来不错,不知道是不是我理解的这样。
x^2 这个是放在 description / input 等这些标签的cdata内部,对吗?
from freeproblemset.
对的,就等于添加一个自定义的类似 <b>
这类的tag
from freeproblemset.
vue使用katex时,当 contenteditable="true"时,修改浏览器页面上的公式,怎么样才能使 katex的公式代码也改变,比如\cfrac{a}{b},当我在浏览器页面修改时,把a修改成c,那么原来的cfrac{a}{b},应该变为cfrac{c}{b}
from freeproblemset.
Related Issues (20)
- 希望更多的OJ能分享他们的题目和数据! HOT 2
- 怎么将poj的题目导出为fps呢?难道要自己写导出工具吗? HOT 1
- SetMessage无法 使用 HOT 1
- ruby写的命令行小工具 HOT 1
- 现在是不是没有样例题目下载了? HOT 2
- 关于数学公式渲染 HOT 3
- 1032 题,这代码应该对的吧
- 建议的语言描述 language 属性 HOT 13
- Bug: python解析器对1.2版本的FPS解析时time_limit格式不正确。 HOT 1
- 看不懂fps的格式。。。 HOT 2
- 如何导入到DMOJ? HOT 3
- 建议添加subtask点支持, 谢谢 HOT 1
- 1053题好像有问题,我的代码应该是对的
- 1054 题,找不到输入的行数 HOT 2
- Web Board 不能发贴 HOT 2
- 请问大家都是怎么制作fps的?
- 能不能提供Vijos格式转FPS的现成工具 = =
- tyvj的好像有问题吧
- 写了一个小工具,可以查看XML里面的题目信息,保存测试数据,暂不支持图片查看
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from freeproblemset.