Git Product home page Git Product logo

Comments (23)

zhblue avatar zhblue commented on May 29, 2024

文件样例已经很简单明了,您可以选用任意自己熟悉的语言和技术进行解析,只要保证xml文本兼容即可。

from freeproblemset.

undefined-moe avatar undefined-moe commented on May 29, 2024

对于Katex的编码方案是否有一套规范?内联样式表并直接插入HTML不仅使得题目内容无法二次编辑,而且存在安全性问题,是否有方法进行转码?

from freeproblemset.

undefined-moe avatar undefined-moe commented on May 29, 2024

另,希望对languageId提出一套统一的规范。如c++在不同平台中可能表示为 c++ cpp cc cxx 等多种形式。

from freeproblemset.

zhblue avatar zhblue commented on May 29, 2024

另,希望对languageId提出一套统一的规范。如c++在不同平台中可能表示为 c++ cpp cc cxx 等多种形式。

然而他们都是c++,这里只提供标准,谁实现解析器谁负责翻译。

from freeproblemset.

zhblue avatar zhblue commented on May 29, 2024

对于Katex的编码方案是否有一套规范?内联样式表并直接插入HTML不仅使得题目内容无法二次编辑,而且存在安全性问题,是否有方法进行转码?

嵌入的html编辑如何实现问题,请实现解析的系统自行解决。
fps只存储交换数据用,不考虑二次编辑。

from freeproblemset.

undefined-moe avatar undefined-moe commented on May 29, 2024

然而他们都是c++,这里只提供标准,谁实现解析器谁负责翻译。

应对导出时提供统一的规范,如c++仅能导出为cpp

嵌入的html编辑如何实现问题,请实现解析的系统自行解决。
fps只存储交换数据用,不考虑二次编辑。

Katex不同版本的css不兼容,且未提供原始MathML,存在兼容性问题。

from freeproblemset.

undefined-moe avatar undefined-moe commented on May 29, 2024

以及一本通的example是不是把output全搞成input了((

from freeproblemset.

zhblue avatar zhblue commented on May 29, 2024

确实有这些问题,能力有限,欢迎PR

from freeproblemset.

undefined-moe avatar undefined-moe commented on May 29, 2024
  1. 个人认为不应当允许导出 <div class="xxx">
  2. 建议指定导出原始Katex code(如 <latex>x^2</latex> 此类)

这将定义一套新版本方案,可能需要各端进行适配。

from freeproblemset.

zhblue avatar zhblue commented on May 29, 2024

现行阶段支持本标准的OnlineJudge实现还比较少,已有的数据都使用html作为文本内容的存储格式,也许给出hustoj的直接补丁,可以作为其他实现的参考。

from freeproblemset.

zhblue avatar zhblue commented on May 29, 2024

Katex 虽然是一种更高级的技术,但是目前看不如html的兼容普遍性好,个人倾向于在跨系统传递保存时,将数学公式复杂图表统一转成图片形式进行处理,实现起来代码更简练,可以方便更多的其他系统来兼容实现本标准。

from freeproblemset.

undefined-moe avatar undefined-moe commented on May 29, 2024

不建议使用图片存储,理由如下:

  1. 几乎所有OnlineJudge均支持Katex。
  2. 后端很难导出时将Katex渲染为图片。

from freeproblemset.

zhblue avatar zhblue commented on May 29, 2024

几乎所有OnlineJudge均支持Katex?
恕我孤陋寡闻,POJ HDUOJ ZJU 都已经支持Katex了么?

后端很难导出时将Katex渲染为图片。
如果当初加题的时候就加成图片,就没这么麻烦了,对吧

from freeproblemset.

zhblue avatar zhblue commented on May 29, 2024

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.

undefined-moe avatar undefined-moe commented on May 29, 2024

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.

undefined-moe avatar undefined-moe commented on May 29, 2024

如果能够导出为 png/svg 的话会好很多,但相关技术仍不够成熟。

from freeproblemset.

undefined-moe avatar undefined-moe commented on May 29, 2024

作为开发者,我更关注的是广泛使用的开源项目(qduoj/dmoj/syzoj/vijos),而非 poj 此类高校使用,内部维护,无计划兼容fps协议的系统。

from freeproblemset.

zhblue avatar zhblue commented on May 29, 2024

这样的话,希望你能从开发者角度给出katex兼容实现的标准建议,显然你对这个技术比我更熟悉。

from freeproblemset.

zhblue avatar zhblue commented on May 29, 2024

最好能给出实现代码,方便我学习新技术

from freeproblemset.

undefined-moe avatar undefined-moe commented on May 29, 2024

如果继续使用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.

zhblue avatar zhblue commented on May 29, 2024

这个看起来不错,不知道是不是我理解的这样。
x^2 这个是放在 description / input 等这些标签的cdata内部,对吗?

from freeproblemset.

undefined-moe avatar undefined-moe commented on May 29, 2024

对的,就等于添加一个自定义的类似 <b> 这类的tag

from freeproblemset.

quanzhongxian avatar quanzhongxian commented on May 29, 2024

vue使用katex时,当 contenteditable="true"时,修改浏览器页面上的公式,怎么样才能使 katex的公式代码也改变,比如\cfrac{a}{b},当我在浏览器页面修改时,把a修改成c,那么原来的cfrac{a}{b},应该变为cfrac{c}{b}

from freeproblemset.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.