Browse Source

Releases v1.4.1

master
pandao 10 years ago
parent
commit
f368df1f5a
  1. 14
      CHANGE.md
  2. 10
      README.md
  3. 2
      bower.json
  4. 12
      css/editormd.css
  5. 4
      css/editormd.logo.css
  6. 2
      css/editormd.logo.min.css
  7. 4
      css/editormd.min.css
  8. 4
      css/editormd.preview.css
  9. 2
      css/editormd.preview.min.css
  10. 25
      editormd.amd.js
  11. 6
      editormd.amd.min.js
  12. 25
      editormd.js
  13. 6
      editormd.min.js
  14. 1
      examples/full.html
  15. 4
      examples/image-cross-domain-upload.html
  16. 2
      examples/image-upload.html
  17. 84
      examples/katex.html
  18. 6
      lib/codemirror/addons.min.js
  19. 16
      lib/codemirror/modes.min.js
  20. 2
      package.json
  21. 2
      plugins/image-dialog/image-dialog.js
  22. 2
      scss/editormd.menu.scss
  23. 21
      src/editormd.js
  24. 132
      tests/katex-tests.html

14
CHANGE.md

@ -417,4 +417,16 @@ v1.2.0 主要更新:
- 新增插入分页符的工具栏图标和方法`pagebreak()`;
- 新增插入分页符的快捷键`Shift + Alt + P`;
- 修复一些Bug,包括[#51](https://github.com/pandao/editor.md/issues/51)等;
- 新增和修改以上更新的相关示例;
- 新增和修改以上更新的相关示例;
####v1.4.1
- 新增配置项`syncScrolling`,即是否开启同步滚动预览,默认值为`false`;
- 修复Bug[64](https://github.com/pandao/editor.md/issues/64);
- 更新`editormd.katexURL`资源地址的默认值,即更新版本为`0.3.0`;
- 新增测试用例`tests/katex-tests.html`;
- 修改示例文件`examples/katex.html`;
- 修复Bug[66](https://github.com/pandao/editor.md/issues/66);
- 修改`editormd.emoji`和`editormd.twemoji`属性,即去掉`http:`,以匹配`https:`;
- 修复编辑器工具栏按钮`:hover` CSS3 transition无效的问题;
- 修改`README.md`;

10
README.md

@ -9,11 +9,11 @@
![](https://img.shields.io/github/issues/pandao/editor.md.svg)
![](https://img.shields.io/bower/v/editor.md.svg)
**Editor.md** is the open source online markdown editor, based on CodeMirror & jQuery & Marked.
**Editor.md** is the open source online markdown editor (component), based on CodeMirror & jQuery & Marked.
### Features
- Support Standard Markdown and GFM(GitHub Flavored Markdown);
- Support Standard Markdown/CommonMark and GFM(GitHub Flavored Markdown);
- Full-featured: Real-time Preview, Image (cross-domain) upload, Preformatted text/Code blocks/Tables insert, Code fold, Search replace, Read only, Themes, Multi-languages, L18n, HTML entities, Code syntax highlighting...;
- Markdown Extras : Support [ToC (Table of Contents)](https://pandao.github.io/editor.md/examples/toc.html), [Emoji](https://pandao.github.io/editor.md/examples/emoji.html), [Task lists](https://pandao.github.io/editor.md/examples/task-lists.html), [@Links](https://pandao.github.io/editor.md/examples/@links.html)...;
- Compatible with all major browsers (IE8+), compatible Zepto.js and iPad;
@ -27,14 +27,14 @@
--------
**Editor.md** 是一个基于CodeMirror、jQuery 和 Marked 构建的 Markdown 在线编辑器。
**Editor.md** 是一个基于CodeMirror、jQuery 和 Marked 构建的开源 Markdown 在线编辑器(组件)
![editormd-screenshot](https://pandao.github.io/editor.md/examples/images/editormd-screenshot.png "editormd-screenshot")
#### 主要特性
- 支持“标准”Markdown和Github风格的语法,也可[变身为代码编辑器](https://pandao.github.io/editor.md/examples/change-mode.html);
- 支持实时预览、图片(跨域)上传、预格式文本/代码/表格插入、代码折叠、搜索替换、只读模式、自定义样式主题和多语言语法高亮等功能;
- 支持“标准”Markdown/CommonMark和Github风格的语法,也可[变身为代码编辑器](https://pandao.github.io/editor.md/examples/change-mode.html);
- 支持实时预览、图片(跨域)上传、预格式文本/代码/表格插入、代码折叠、跳转到行、搜索替换、只读模式、自定义样式主题和多语言语法高亮等功能;
- 支持[ToC(Table of Contents)](https://pandao.github.io/editor.md/examples/toc.html)、[Emoji表情](https://pandao.github.io/editor.md/examples/emoji.html)、[Task lists](https://pandao.github.io/editor.md/examples/task-lists.html)、[@链接](https://pandao.github.io/editor.md/examples/@links.html)等Markdown扩展语法;
- 支持TeX科学公式(基于[KaTeX](https://pandao.github.io/editor.md/examples/katex.html))、流程图 [Flowchart](https://pandao.github.io/editor.md/examples/flowchart.html) 和 [时序图 Sequence Diagram](https://pandao.github.io/editor.md/examples/sequence-diagram.html);
- 支持[识别和解析HTML标签,并且支持自定义过滤标签解析](https://pandao.github.io/editor.md/examples/html-tags-decode.html),具有可靠的安全性和几乎无限的扩展性;

2
bower.json

@ -1,6 +1,6 @@
{
"name": "editor.md",
"version": "1.4.0",
"version": "1.4.1",
"homepage": "https://github.com/pandao/editor.md",
"authors": [
"Pandao <pandao@vip.qq.com>"

12
css/editormd.css

@ -2,12 +2,12 @@
* Editor.md
*
* @file /editormd.css
* @version v1.4.0
* @version v1.4.1
* @description Open source online markdown editor.
* @license MIT License
* @author Pandao
* {@link https://github.com/pandao/editor.md}
* @updateTime 2015-03-23
* @updateTime 2015-04-07
*/
@charset "UTF-8";
@ -117,10 +117,6 @@
-o-border-radius: 2px;
border-radius: 2px;
border: 1px solid #fff;
}
.editormd-menu > li > a:hover, .editormd-menu > li > a.active {
border: 1px solid #ddd;
background: #eee;
-webkit-transition: all 300ms ease-out;
/* Safari, Chrome */
-moz-transition: all 300ms ease-out;
@ -128,6 +124,10 @@
transition: all 300ms ease-out;
/* IE >9, FF >15, Opera >12.0 */
}
.editormd-menu > li > a:hover, .editormd-menu > li > a.active {
border: 1px solid #ddd;
background: #eee;
}
.editormd-menu > li > a > .fa {
text-align: center;
display: block;

4
css/editormd.logo.css

@ -2,12 +2,12 @@
* Editor.md
*
* @file /editormd.logo.css
* @version v1.4.0
* @version v1.4.1
* @description Open source online markdown editor.
* @license MIT License
* @author Pandao
* {@link https://github.com/pandao/editor.md}
* @updateTime 2015-03-23
* @updateTime 2015-04-07
*/
/*! prefixes.scss v0.1.0 | Author: Pandao | https://github.com/pandao/prefixes.scss | MIT license | Copyright (c) 2015 */

2
css/editormd.logo.min.css

@ -1,2 +1,2 @@
/*! Editor.md v1.4.0 | /editormd.logo.min.css | Open source online markdown editor. | MIT License | By: Pandao | https://github.com/pandao/editor.md | 2015-03-23 */
/*! Editor.md v1.4.1 | /editormd.logo.min.css | Open source online markdown editor. | MIT License | By: Pandao | https://github.com/pandao/editor.md | 2015-04-07 */
/*! prefixes.scss v0.1.0 | Author: Pandao | https://github.com/pandao/prefixes.scss | MIT license | Copyright (c) 2015 */@font-face{font-family:editormd-logo;src:url(../fonts/editormd-logo.eot?-5y8q6h);src:url(.../fonts/editormd-logo.eot?#iefix-5y8q6h)format("embedded-opentype"),url(../fonts/editormd-logo.woff?-5y8q6h)format("woff"),url(../fonts/editormd-logo.ttf?-5y8q6h)format("truetype"),url(../fonts/editormd-logo.svg?-5y8q6h#icomoon)format("svg");font-weight:400;font-style:normal}.editormd-logo,.editormd-logo-1x,.editormd-logo-2x,.editormd-logo-3x,.editormd-logo-4x,.editormd-logo-5x,.editormd-logo-6x,.editormd-logo-7x,.editormd-logo-8x{font-family:editormd-logo;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;font-size:inherit;line-height:1;display:inline-block;text-rendering:auto;vertical-align:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.editormd-logo-1x:before,.editormd-logo-2x:before,.editormd-logo-3x:before,.editormd-logo-4x:before,.editormd-logo-5x:before,.editormd-logo-6x:before,.editormd-logo-7x:before,.editormd-logo-8x:before,.editormd-logo:before{content:"\e1987"}.editormd-logo-1x{font-size:1em}.editormd-logo-lg{font-size:1.2em}.editormd-logo-2x{font-size:2em}.editormd-logo-3x{font-size:3em}.editormd-logo-4x{font-size:4em}.editormd-logo-5x{font-size:5em}.editormd-logo-6x{font-size:6em}.editormd-logo-7x{font-size:7em}.editormd-logo-8x{font-size:8em}.editormd-logo-color{color:#2196F3}

4
css/editormd.min.css

File diff suppressed because one or more lines are too long

4
css/editormd.preview.css

@ -2,12 +2,12 @@
* Editor.md
*
* @file /editormd.preview.css
* @version v1.4.0
* @version v1.4.1
* @description Open source online markdown editor.
* @license MIT License
* @author Pandao
* {@link https://github.com/pandao/editor.md}
* @updateTime 2015-03-23
* @updateTime 2015-04-07
*/
/*! prefixes.scss v0.1.0 | Author: Pandao | https://github.com/pandao/prefixes.scss | MIT license | Copyright (c) 2015 */

2
css/editormd.preview.min.css

@ -1,4 +1,4 @@
/*! Editor.md v1.4.0 | /editormd.preview.min.css | Open source online markdown editor. | MIT License | By: Pandao | https://github.com/pandao/editor.md | 2015-03-23 */
/*! Editor.md v1.4.1 | /editormd.preview.min.css | Open source online markdown editor. | MIT License | By: Pandao | https://github.com/pandao/editor.md | 2015-04-07 */
/*! prefixes.scss v0.1.0 | Author: Pandao | https://github.com/pandao/prefixes.scss | MIT license | Copyright (c) 2015 *//*!
* Font Awesome 4.3.0 by @davegandy - http://fontawesome.io - @fontawesome
* License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)

25
editormd.amd.js

@ -2,12 +2,12 @@
* Editor.md
*
* @file editormd.amd.js
* @version v1.4.0
* @version v1.4.1
* @description Open source online markdown editor.
* @license MIT License
* @author Pandao
* {@link https://github.com/pandao/editor.md}
* @updateTime 2015-03-23
* @updateTime 2015-04-07
*/
;(function(factory) {
@ -129,7 +129,7 @@
};
editormd.title = editormd.$name = "Editor.md";
editormd.version = "1.4.0";
editormd.version = "1.4.1";
editormd.homePage = "https://pandao.github.io/editor.md/";
editormd.classPrefix = "editormd-";
@ -177,6 +177,7 @@
autoHeight : false,
autoCloseTags : true,
searchReplace : true,
syncScrolling : true,
readOnly : false,
lineNumbers : true,
matchWordHighlight : true, // options: true, false, "onselected"
@ -1478,7 +1479,7 @@
this.previewContainer.find("." + editormd.classNames.tex).each(function(){
var tex = $(this);
editormd.$katex.render(tex.html(), tex[0]);
editormd.$katex.render(tex.text(), tex[0]);
});
return this;
@ -1606,6 +1607,10 @@
var settings = this.settings;
var codeMirror = this.codeMirror;
var mouseOrTouch = editormd.mouseOrTouch;
if (!settings.syncScrolling) {
return this;
}
var cmBindScroll = function() {
codeMirror.find(".CodeMirror-scroll").bind(mouseOrTouch("scroll", "touchmove"), function(event) {
@ -1687,6 +1692,10 @@
var cm = this.cm;
var settings = this.settings;
if (!settings.syncScrolling) {
return this;
}
cm.on("change", function(_cm, changeObj) {
if (settings.watch)
@ -3201,13 +3210,13 @@
// Emoji graphics files url path
editormd.emoji = {
path : "http://www.emoji-cheat-sheet.com/graphics/emojis/",
path : "//www.emoji-cheat-sheet.com/graphics/emojis/",
ext : ".png"
};
// Twitter Emoji (Twemoji) graphics files url path
editormd.twemoji = {
path : "http://twemoji.maxcdn.com/36x36/",
path : "//twemoji.maxcdn.com/36x36/",
ext : ".png"
};
@ -3913,8 +3922,8 @@
// 使用国外的CDN,加载速度有时会很慢,或者自定义URL
// You can custom KaTeX load url.
editormd.katexURL = {
css : "//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.1.1/katex.min",
js : "//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.1.1/katex.min"
css : "//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min",
js : "//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min"
};
editormd.kaTeXLoaded = false;

6
editormd.amd.min.js

File diff suppressed because one or more lines are too long

25
editormd.js

@ -2,12 +2,12 @@
* Editor.md
*
* @file editormd.js
* @version v1.4.0
* @version v1.4.1
* @description Open source online markdown editor.
* @license MIT License
* @author Pandao
* {@link https://github.com/pandao/editor.md}
* @updateTime 2015-03-23
* @updateTime 2015-04-07
*/
;(function(factory) {
@ -59,7 +59,7 @@
};
editormd.title = editormd.$name = "Editor.md";
editormd.version = "1.4.0";
editormd.version = "1.4.1";
editormd.homePage = "https://pandao.github.io/editor.md/";
editormd.classPrefix = "editormd-";
@ -107,6 +107,7 @@
autoHeight : false,
autoCloseTags : true,
searchReplace : true,
syncScrolling : true,
readOnly : false,
lineNumbers : true,
matchWordHighlight : true, // options: true, false, "onselected"
@ -1408,7 +1409,7 @@
this.previewContainer.find("." + editormd.classNames.tex).each(function(){
var tex = $(this);
editormd.$katex.render(tex.html(), tex[0]);
editormd.$katex.render(tex.text(), tex[0]);
});
return this;
@ -1536,6 +1537,10 @@
var settings = this.settings;
var codeMirror = this.codeMirror;
var mouseOrTouch = editormd.mouseOrTouch;
if (!settings.syncScrolling) {
return this;
}
var cmBindScroll = function() {
codeMirror.find(".CodeMirror-scroll").bind(mouseOrTouch("scroll", "touchmove"), function(event) {
@ -1617,6 +1622,10 @@
var cm = this.cm;
var settings = this.settings;
if (!settings.syncScrolling) {
return this;
}
cm.on("change", function(_cm, changeObj) {
if (settings.watch)
@ -3131,13 +3140,13 @@
// Emoji graphics files url path
editormd.emoji = {
path : "http://www.emoji-cheat-sheet.com/graphics/emojis/",
path : "//www.emoji-cheat-sheet.com/graphics/emojis/",
ext : ".png"
};
// Twitter Emoji (Twemoji) graphics files url path
editormd.twemoji = {
path : "http://twemoji.maxcdn.com/36x36/",
path : "//twemoji.maxcdn.com/36x36/",
ext : ".png"
};
@ -3843,8 +3852,8 @@
// 使用国外的CDN,加载速度有时会很慢,或者自定义URL
// You can custom KaTeX load url.
editormd.katexURL = {
css : "//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.1.1/katex.min",
js : "//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.1.1/katex.min"
css : "//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min",
js : "//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min"
};
editormd.kaTeXLoaded = false;

6
editormd.min.js

File diff suppressed because one or more lines are too long

1
examples/full.html

@ -50,6 +50,7 @@
path : '../lib/',
markdown : md,
codeFold : true,
//syncScrolling : false,
saveHTMLToTextarea : true, // 保存HTML到Textarea
searchReplace : true,
//watch : false, // 关闭实时预览

4
examples/image-cross-domain-upload.html

@ -75,9 +75,9 @@ exit;
path : '../lib/',
imageUpload : true,
imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp"],
imageUploadURL : "http://www.ipandao.com/editor.md/examples/php/cross-domain-upload.php",
imageUploadURL : "http://www.ipandao.com/editor.md/examples/php/cross-domain-upload.php?test=dfdf",
crossDomainUpload : true,
uploadCallbackURL : "http://localhost/editor.md/examples/php/upload_callback.html"
uploadCallbackURL : "http://localhost/editor.md/examples/php/upload_callback.html?test=dfdf"
/*
跨域时,上传的图片服务器后台只需要返回一个跳转URL并跳转到原页面同域下的callback页面,结构如下:

2
examples/image-upload.html

@ -60,7 +60,7 @@ $(function() {
//dialogMaskBgColor : "#000", // 设置透明遮罩层的背景颜色,全局通用,默认为#fff
imageUpload : true,
imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp"],
imageUploadURL : "./php/upload.php",
imageUploadURL : "./php/upload.php?test=dfdf",
/*
上传的后台只需要返回一个JSON数据,结构如下:

84
examples/katex.html

@ -25,6 +25,17 @@
tex : true
}
####Custom KaTeX source URL
```javascript
// Default using CloudFlare KaTeX's CDN
// You can custom url
editormd.katexURL = {
js : "your url", // default: //cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min
css : "your url" // default: //cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min
};
```
####Examples
$$E=mc^2$$
@ -33,6 +44,8 @@ Inline 行内的公式$$E=mc^2$$行内的公式,行内的$$E=mc^2$$公式。
$$c = \\pm\\sqrt{a^2 + b^2}$$
$$x > y$$
$$f(x) = x^2$$
$$\alpha = \sqrt{1-e^2}$$
@ -49,16 +62,69 @@ $$\displaystyle \frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}}
$$\displaystyle \left( \sum\_{k=1}^n a\_k b\_k \right)^2 \leq \left( \sum\_{k=1}^n a\_k^2 \right) \left( \sum\_{k=1}^n b\_k^2 \right)$$
####Custom KaTeX source URL
$$a^2$$
```javascript
// Default using CloudFlare KaTeX's CDN
// You can custom url
editormd.katexURL = {
js : "your url",
css : "your url"
};
```
$$a^{2+2}$$
$$a_2$$
$${x_2}^3$$
$$x_2^3$$
$$10^{10^{8}}$$
$$a_{i,j}$$
$$_nP_k$$
$$c = \pm\sqrt{a^2 + b^2}$$
$$\frac{1}{2}=0.5$$
$$\dfrac{k}{k-1} = 0.5$$
$$\dbinom{n}{k} \binom{n}{k}$$
$$\oint_C x^3\, dx + 4y^2\, dy$$
$$\bigcap_1^n p \bigcup_1^k p$$
$$e^{i \pi} + 1 = 0$$
$$\left ( \frac{1}{2} \right )$$
$$x_{1,2}=\frac{-b\pm\sqrt{\color{Red}b^2-4ac}}{2a}$$
$${\color{Blue}x^2}+{\color{YellowOrange}2x}-{\color{OliveGreen}1}$$
$$\textstyle \sum_{k=1}^N k^2$$
$$\dfrac{ \tfrac{1}{2}[1-(\tfrac{1}{2})^n] }{ 1-\tfrac{1}{2} } = s_n$$
$$\binom{n}{k}$$
$$0+1+2+3+4+5+6+7+8+9+10+11+12+13+14+15+16+17+18+19+20+\cdots$$
$$\sum_{k=1}^N k^2$$
$$\textstyle \sum_{k=1}^N k^2$$
$$\prod_{i=1}^N x_i$$
$$\textstyle \prod_{i=1}^N x_i$$
$$\coprod_{i=1}^N x_i$$
$$\textstyle \coprod_{i=1}^N x_i$$
$$\int_{1}^{3}\frac{e^3/x}{x^2}\, dx$$
$$\int_C x^3\, dx + 4y^2\, dy$$
$${}_1^2\!\Omega_3^4$$
$$x', y'', f', f''$$
#### KaTeX vs MathJax

6
lib/codemirror/addons.min.js

File diff suppressed because one or more lines are too long

16
lib/codemirror/modes.min.js

File diff suppressed because one or more lines are too long

2
package.json

@ -1,6 +1,6 @@
{
"name": "editor.md",
"version": "1.4.0",
"version": "1.4.1",
"description": "Open source online markdown editor.",
"directories": {
"doc": "docs",

2
plugins/image-dialog/image-dialog.js

@ -34,7 +34,7 @@
if (editor.find("." + dialogName).length < 1)
{
var guid = (new Date).getTime();
var action = settings.imageUploadURL + "?guid=" + guid;
var action = settings.imageUploadURL + (settings.imageUploadURL.indexOf("?") >= 0 ? "&" : "?") + "guid=" + guid;
if (settings.crossDomainUpload)
{

2
scss/editormd.menu.scss

@ -29,11 +29,11 @@
text-align: center;
@include border-radius(2px);
border: 1px solid #fff;
@include transition(all 300ms ease-out);
&:hover, &.active {
border: 1px solid $borderColor;
background: #eee;
@include transition(all 300ms ease-out);
}
> .fa {

21
src/editormd.js

@ -47,7 +47,7 @@
};
editormd.title = editormd.$name = "Editor.md";
editormd.version = "1.4.0";
editormd.version = "1.4.1";
editormd.homePage = "https://pandao.github.io/editor.md/";
editormd.classPrefix = "editormd-";
@ -95,6 +95,7 @@
autoHeight : false,
autoCloseTags : true,
searchReplace : true,
syncScrolling : true,
readOnly : false,
lineNumbers : true,
matchWordHighlight : true, // options: true, false, "onselected"
@ -1396,7 +1397,7 @@
this.previewContainer.find("." + editormd.classNames.tex).each(function(){
var tex = $(this);
editormd.$katex.render(tex.html(), tex[0]);
editormd.$katex.render(tex.text(), tex[0]);
});
return this;
@ -1524,6 +1525,10 @@
var settings = this.settings;
var codeMirror = this.codeMirror;
var mouseOrTouch = editormd.mouseOrTouch;
if (!settings.syncScrolling) {
return this;
}
var cmBindScroll = function() {
codeMirror.find(".CodeMirror-scroll").bind(mouseOrTouch("scroll", "touchmove"), function(event) {
@ -1605,6 +1610,10 @@
var cm = this.cm;
var settings = this.settings;
if (!settings.syncScrolling) {
return this;
}
cm.on("change", function(_cm, changeObj) {
if (settings.watch)
@ -3119,13 +3128,13 @@
// Emoji graphics files url path
editormd.emoji = {
path : "http://www.emoji-cheat-sheet.com/graphics/emojis/",
path : "//www.emoji-cheat-sheet.com/graphics/emojis/",
ext : ".png"
};
// Twitter Emoji (Twemoji) graphics files url path
editormd.twemoji = {
path : "http://twemoji.maxcdn.com/36x36/",
path : "//twemoji.maxcdn.com/36x36/",
ext : ".png"
};
@ -3831,8 +3840,8 @@
// 使用国外的CDN,加载速度有时会很慢,或者自定义URL
// You can custom KaTeX load url.
editormd.katexURL = {
css : "//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.1.1/katex.min",
js : "//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.1.1/katex.min"
css : "//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min",
js : "//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min"
};
editormd.kaTeXLoaded = false;

132
tests/katex-tests.html

@ -0,0 +1,132 @@
<!DOCTYPE html>
<html lang="zh">
<head>
<title>KaTeX Tests</title>
<meta charset="UTF-8">
<meta name="description" content="" />
<meta name="keywords" content="" />
<style>
* {
margin:0;
padding:0;
}
body{font-size:14px;color:#444;font-family:"微软雅黑",Arial;background:#fff;padding: 15px;}
.katex {display: block;margin-bottom: 10px;}
</style>
</head>
<body>
<a href="http://khan.github.io/KaTeX/" target="_blank">http://khan.github.io/KaTeX/</a><br/><br/>
<a href="http://meta.wikimedia.org/wiki/Help:Displaying_a_formula" target="_blank">http://meta.wikimedia.org/wiki/Help:Displaying_a_formula</a>
<br/><br/>
<span class="katex">a^2</span>
<span class="katex">a^{2+2}</span>
<span class="katex">a_2</span>
<span class="katex">{x_2}^3</span>
<span class="katex">x_2^3</span>
<span class="katex">10^{10^{8}}</span>
<span class="katex">a_{i,j}</span>
<span class="katex">_nP_k</span>
<span class="katex">E=MC^2</span>
<span class="katex">\left \{ \frac{a}{b} \right \} \quad \left \lbrace \frac{a}{b} \right \rbrace</span>
<span class="katex">\left [ \frac{a}{b} \right ] \quad \left \lbrack \frac{a}{b} \right \rbrack</span>
<span class="katex">\left ( \frac{a}{b} \right )</span>
<span class="katex">\left \langle \frac{a}{b} \right \rangle</span>
<span class="katex">x > y = 100</span>
<span class="katex">c = \pm\sqrt{a^2 + b^2}</span>
<span class="katex">\left . \frac{A}{B} \right \} \to X</span>
<span class="katex">\left / \frac{a}{b} \right \backslash</span>
<span class="katex">\left \lfloor \frac{a}{b} \right \rfloor \left \lceil \frac{c}{d} \right \rceil</span>
<span class="katex">\frac{1}{2}=0.5</span>
<span class="katex">\dfrac{k}{k-1} = 0.5</span>
<span class="katex">\dbinom{n}{k} \binom{n}{k}</span>
<span class="katex">\oint_C x^3\, dx + 4y^2\, dy</span>
<span class="katex">\bigcap_1^n p \bigcup_1^k p</span>
<span class="katex">\phi_n(\kappa) =
\frac{1}{4\pi^2\kappa^2} \int_0^\infty
\frac{\sin(\kappa R)}{\kappa R}
\frac{\partial}{\partial R}
\left[R^2\frac{\partial D_n(R)}{\partial R}\right]\,dR</span>
<span class="katex">\sum_{m=1}^\infty\sum_{n=1}^\infty\frac{m^2\,n}
{3^m\left(m\,3^n+n\,3^m\right)}</span>
<span class="katex">e^{i \pi} + 1 = 0</span>
<span class="katex">\left ( \frac{1}{2} \right )</span>
<span class="katex">x_{1,2}=\frac{-b\pm\sqrt{\color{Red}b^2-4ac}}{2a}</span>
<span class="katex">{\color{Blue}x^2}+{\color{YellowOrange}2x}-{\color{OliveGreen}1}</span>
<span class="katex">\textstyle \sum_{k=1}^N k^2</span>
<span class="katex">\dfrac{ \tfrac{1}{2}[1-(\tfrac{1}{2})^n] }{ 1-\tfrac{1}{2} } = s_n</span>
<span class="katex">\binom{n}{k}</span>
<span class="katex">0+1+2+3+4+5+6+7+8+9+10+11+12+13+14+15+16+17+18+19+20+\cdots</span>
<span class="katex">f(x) = \int_{-\infty}^\infty
\hat f(\xi)\,e^{2 \pi i \xi x}
\,d\xi</span>
<span class="katex">\displaystyle \frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} = 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}} {1+\frac{e^{-8\pi}} {1+\cdots} } } }</span>
<span class="katex">\displaystyle \left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)</span>
<span class="katex">\displaystyle 1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots = \prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})}, \quad\quad \text{for }\lvert q\rvert<1.</span>
<span class="katex">2 = \left(
\frac{\left(3-x\right) \times 2}{3-x}
\right)</span>
<span class="katex">S_{\text{new}} = S_{\text{old}} - \frac{ \left( 5-T \right) ^2} {2}</span>
<span class="katex">x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}</span>
<span class="katex">ax^2 + bx + c = 0\,</span>
<span class="katex">\int_a^x \!\!\!\int_a^s f(y)\,dy\,ds
= \int_a^x f(y)(x-y)\,dy</span>
<span class="katex">\sum_{m=1}^\infty\sum_{n=1}^\infty\frac{m^2\,n}
{3^m\left(m\,3^n+n\,3^m\right)}</span>
<span class="katex">u'' + p(x)u' + q(x)u=f(x),\quad x>a</span>
<span class="katex">|\bar{z}| = |z|,
|(\bar{z})^n| = |z|^n,
\arg(z^n) = n \arg(z)</span>
<span class="katex">\lim_{z\rightarrow z_0} f(z)=f(z_0)</span>
<span class="katex">\phi_n(\kappa) =
0.033C_n^2\kappa^{-11/3},\quad
\frac{1}{L_0}\ll\kappa\ll\frac{1}{l_0}</span>
<span class="katex">\sum_{k=1}^N k^2</span>
<span class="katex">\textstyle \sum_{k=1}^N k^2</span>
<span class="katex">\prod_{i=1}^N x_i</span>
<span class="katex">\textstyle \prod_{i=1}^N x_i</span>
<span class="katex">\coprod_{i=1}^N x_i</span>
<span class="katex">\textstyle \coprod_{i=1}^N x_i</span>
<span class="katex">\int_{1}^{3}\frac{e^3/x}{x^2}\, dx</span>
<span class="katex">\int_C x^3\, dx + 4y^2\, dy</span>
<span class="katex">{}_1^2\!\Omega_3^4</span>
<span class="katex">x', y'', f', f''</span>
<span class="katex">\dot{x}, \ddot{x}</span>
<span class="katex">\hat a \ \bar b \ \vec c</span>
<span class="katex">\lessapprox \lesssim \eqslantless \leqslant \leqq \geqq \geqslant \eqslantgtr \gtrsim \gtrapprox</span>
<span class="katex">\smile \frown \wr \triangleleft \triangleright \infty \bot \top</span>
<span class="katex">\leftarrow \gets \rightarrow \to \nleftarrow \nrightarrow \leftrightarrow \nleftrightarrow \longleftarrow \longrightarrow \longleftrightarrow</span>
<span class="katex">\uparrow \downarrow \updownarrow \Uparrow \Downarrow \Updownarrow \nearrow \searrow \swarrow \nwarrow</span>
<span class="katex">\rightharpoonup \rightharpoondown \leftharpoonup \leftharpoondown \upharpoonleft \upharpoonright \downharpoonleft \downharpoonright \rightleftharpoons \leftrightharpoons</span>
<span class="katex">\curvearrowleft \circlearrowleft \Lsh \upuparrows \rightrightarrows \rightleftarrows \Rrightarrow \rightarrowtail \looparrowright</span>
<span class="katex">\curvearrowright \circlearrowright \Rsh \downdownarrows \leftleftarrows \leftrightarrows \Lleftarrow \leftarrowtail \looparrowleft</span>
<span class="katex">\mapsto \longmapsto \hookrightarrow \hookleftarrow \multimap \leftrightsquigarrow \rightsquigarrow</span>
<span class="katex">\Diamond \Box \triangle \angle \perp \mid \nmid \| 45^\circ</span>
<span class="katex">
\sim \approx \simeq \cong \dot= \overset{\underset{\mathrm{def}}{}}{=}</span>
<span class="katex"></span>
<span class="katex"></span>
<span class="katex"></span>
<span class="katex"></span>
<span class="katex"></span>
<span class="katex"></span>
<span class="katex"></span>
<span class="katex"></span>
<span class="katex"></span>
<span class="katex"></span>
<span class="katex"></span>
<script src="../examples/js/jquery.min.js"></script>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min.js"></script>
<script type="text/javascript">
$(function() {
$(".katex").each(function(){
var tex = $(this);
katex.render(tex.text(), tex[0]);
});
});
</script>
</body>
</html>
Loading…
Cancel
Save