Browse Source

Releases v1.4.5

master
pandao 10 years ago
parent
commit
4c0a4ab469
  1. 485
      CHANGE.md
  2. 42
      README.md
  3. 2
      bower.json
  4. 4
      css/editormd.css
  5. 4
      css/editormd.logo.css
  6. 2
      css/editormd.logo.min.css
  7. 2
      css/editormd.min.css
  8. 4
      css/editormd.preview.css
  9. 2
      css/editormd.preview.min.css
  10. 32
      editormd.amd.js
  11. 7
      editormd.amd.min.js
  12. 1818
      editormd.js
  13. 7
      editormd.min.js
  14. 2
      examples/@links.html
  15. 6
      examples/code-fold.html
  16. 2
      examples/custom-keyboard-shortcuts.html
  17. 10
      examples/define-plugin.html
  18. 8
      examples/dynamic-create-editormd.html
  19. 20
      examples/emoji.html
  20. 22
      examples/extends.html
  21. 2
      examples/external-use.html
  22. 19
      examples/form-get-value.html
  23. 8
      examples/full.html
  24. 22
      examples/html-preview-markdown-to-html.html
  25. 22
      examples/html-tags-decode.html
  26. 10
      examples/image-cross-domain-upload.html
  27. 12
      examples/image-upload.html
  28. 26
      examples/index.html
  29. 19
      examples/katex.html
  30. 5
      examples/manually-load-modules.html
  31. 19
      examples/multi-editormd.html
  32. 14
      examples/php/cross-domain-upload.php
  33. 24
      examples/php/editormd.uploader.class.php
  34. 7
      examples/php/upload.php
  35. 3
      examples/php/upload_callback.html
  36. 4
      examples/resettings.html
  37. 4
      examples/sequence-diagram.html
  38. 18
      examples/set-get-replace-selection.html
  39. 14
      examples/task-lists.html
  40. 2
      examples/test.md
  41. 10
      examples/themes.html
  42. 49
      examples/toc.html
  43. 4
      examples/toolbar-auto-fixed.html
  44. 6
      examples/use-requirejs.html
  45. 28
      examples/use-seajs.html
  46. 16
      examples/use-zepto.html
  47. 2
      lib/codemirror/addons.min.js
  48. 10779
      lib/codemirror/modes.min.js
  49. 2
      package.json
  50. 60
      plugins/image-dialog/image-dialog.js
  51. 28
      src/editormd.js

485
CHANGE.md

@ -1,306 +1,306 @@
##更新日志
## 更新日志
###v1.0.x
### v1.0.x
#####v1.0.0 beta
##### v1.0.0 beta
预览版:基本功能完成; 预览版:基本功能完成;
#####v1.0.0 releases
##### v1.0.0 releases
发布v1.0.0正式版。
发布 v1.0.0 正式版。
主要更新: 主要更新:
- 新建分支 `mathjax-version`,但不打算继续对此分支进行开发; - 新建分支 `mathjax-version`,但不打算继续对此分支进行开发;
- 移除MathJax,改用KaTeX [#2](https://github.com/pandao/editor.md/issues/2),解析和预览响应速度大幅度提高 [#3](https://github.com/pandao/editor.md/issues/3);
- 移除 MathJax,改用 KaTeX [#2](https://github.com/pandao/editor.md/issues/2),解析和预览响应速度大幅度提高 [#3](https://github.com/pandao/editor.md/issues/3);
- 移除 `mathjax` 配置项; - 移除 `mathjax` 配置项;
- 移除 `mathjaxURL` 属性; - 移除 `mathjaxURL` 属性;
- 移除 `setMathJaxConfig()` 方法; - 移除 `setMathJaxConfig()` 方法;
- 移除 `loadMathJax()` 方法; - 移除 `loadMathJax()` 方法;
- 移除MathJax的所有示例; - 移除MathJax的所有示例;
- 新增 `tex` 配置项,表示是否开启支持科学公式TeX,基于KaTeX;
- 新增 `tex` 配置项,表示是否开启支持科学公式 TeX ,基于 KaTeX;
- 新增 `katexURL` 属性; - 新增 `katexURL` 属性;
- 新增 `loadKaTeX` 方法; - 新增 `loadKaTeX` 方法;
- 新增KaTeX的示例;
- 新增 KaTeX 的示例;
- `setCodeEditor()`方法更名为`setCodeMirror()`;
- `setCodeEditor()` 方法更名为 `setCodeMirror()`
- 合并CodeMirror使用到的多个JS模块文件,大幅减少HTTP请求,加快下载速度;
- 新增合并后的两个模块文件:`./lib/codemirror/modes.min.js`、`./lib/codemirror/addons.min.js`;
- `Gulpfile.js` 新增合并CodeMirror模块文件的任务方法`codemirror-mode`和`codemirror-addon`;
- 另外在使用Require.js时,因为CodeMirror的严格模块依赖的限制,不能使用上述合并的模块文件,仍然采用动态加载多个模块文件;
- 合并 CodeMirror 使用到的多个 JS 模块文件,大幅减少 HTTP 请求,加快下载速度;
- 新增合并后的两个模块文件:`./lib/codemirror/modes.min.js`、`./lib/codemirror/addons.min.js`
- `Gulpfile.js` 新增合并 CodeMirror 模块文件的任务方法 `codemirror-mode` `codemirror-addon`
- 另外在使用 Require.js 时,因为 CodeMirror 的严格模块依赖的限制,不能使用上述合并的模块文件,仍然采用动态加载多个模块文件;
- 更新 `README.md` 等相关文档和示例; - 更新 `README.md` 等相关文档和示例;
- 解决Sea.js环境下Raphael.js无法运行导致不支持流程图和时序图的问题,即必须先加载Raphael.js,后加载Sea.js;
- 解决 Sea.js 环境下 Raphael.js 无法运行导致不支持流程图和时序图的问题,即必须先加载 Raphael.js ,后加载 Sea.js
###v1.1.x
### v1.1.x
#####v1.1.0
##### v1.1.0
主要更新: 主要更新:
- 设计并更换了Logo;
- 设计并更换了 Logo;
- 新增添加图片、链接、锚点链接、代码块、预格式文本等操作弹出对话框层及示例; - 新增添加图片、链接、锚点链接、代码块、预格式文本等操作弹出对话框层及示例;
- 新增支持图片(跨域)上传; - 新增支持图片(跨域)上传;
- 改用`<textarea>`来存放Markdown源文档;
- 改用 `<textarea>` 来存放 Markdown 源文档;
- 新增支持自定义工具栏; - 新增支持自定义工具栏;
- 新增支持多语言; - 新增支持多语言;
- 新增支持Zepto.js;
- 新增支持多个Editor.md并存和动态加载Editor.md及示例;
- 新增支持智能识别和解析HTML标签及示例;
- 新增支持 Zepto.js;
- 新增支持多个 Editor.md 并存和动态加载 Editor.md 及示例;
- 新增支持智能识别和解析 HTML 标签及示例;
- 新增多个外部操作方法接口及示例; - 新增多个外部操作方法接口及示例;
- 修复了一些大大小小的Bug;
- 修复了一些大大小小的 Bug;
具体更新如下: 具体更新如下:
- 更换Logo,建立基础VI;
- 创建了全系列WebFont字体`dist/fonts/editormd-logo.*`;
- 新增样式类`editormd-logo`等;
- 更换 Logo,建立基础 VI;
- 创建了全系列 WebFont 字体 `dist/fonts/editormd-logo.*`
- 新增样式类 `editormd-logo` 等;
- 改用`<textarea>`来存放Markdown源文档;
- 原先使用`<script type="text/markdown"></script>`来存放Markdown源文档;
- 创建Editor.md只需要写一个`<div id="xxxx"></div>`,如果没有添加`class="editormd"`属性会自动添加,另外如果不存在`<textarea>`标签,则也会自动添加`<textarea>`
- 改用 `<textarea>` 来存放 Markdown 源文档;
- 原先使用 `<script type="text/markdown"></script>` 来存放 Markdown 源文档;
- 创建 Editor.md 只需要写一个 `<div id="xxxx"></div>` ,如果没有添加 `class="editormd"` 属性会自动添加,另外如果不存在 `<textarea>` 标签,则也会自动添加 `<textarea>`
- 新增支持智能识别和解析HTML标签,增强了Markdown语法的扩展性,几乎无限,例如:插入视频等等;
- 新增配置项`htmlDecode`,表示是否开启HTML标签识别和解析,但是为了安全性,默认不开启;
- 新增识别和解析HTML标签的示例;
- 新增支持智能识别和解析 HTML 标签,增强了 Markdown 语法的扩展性,几乎无限,例如:插入视频等等;
- 新增配置项 `htmlDecode` ,表示是否开启 HTML 标签识别和解析,但是为了安全性,默认不开启;
- 新增识别和解析 HTML 标签的示例;
- 新增插入链接、锚点链接、预格式文本和代码块的弹出对话框层; - 新增插入链接、锚点链接、预格式文本和代码块的弹出对话框层;
- 弹出层改为使用固定定位; - 弹出层改为使用固定定位;
- 新增动态创建对话框的方法 `createDialog()` - 新增动态创建对话框的方法 `createDialog()`
- 新增静态属性`editormd.codeLanguages`,用于存放代码语言列表;
- 新增静态属性 `editormd.codeLanguages` ,用于存放代码语言列表;
- 开始支持图片上传; - 开始支持图片上传;
- 新增添加图片(上传)弹出对话框层; - 新增添加图片(上传)弹出对话框层;
- 支持基于iframe的跨域上传,并添加相应的示例(PHP版);
- 支持基于 iframe 的跨域上传,并添加相应的示例( PHP 版);
- 开始支持自定义工具栏图标及操作处理; - 开始支持自定义工具栏图标及操作处理;
- 配置项`toolbarIcons`类型由数组更改为函数,返回一个图标按钮列表数组;
- 新增配置项`toolbarHandlers` 和 `toolbarIconsTexts`,分别用于自定义按钮操作处理和按钮内容文本;
- 新增方法`getToolbarHandles()`,用于可在外部使用默认的操作方法;
- 新增成员属性`activeIcon`,可获取当前或上次点击的工具栏图标的jQuery实例对象;
- 配置项 `toolbarIcons` 类型由数组更改为函数,返回一个图标按钮列表数组;
- 新增配置项 `toolbarHandlers``toolbarIconsTexts` ,分别用于自定义按钮操作处理和按钮内容文本;
- 新增方法 `getToolbarHandles()` ,用于可在外部使用默认的操作方法;
- 新增成员属性 `activeIcon` ,可获取当前或上次点击的工具栏图标的 jQuery 实例对象;
- 新增表单取值、自定义工具栏、图片上传、多个Editor.md并存和动态加载Editor.md等多个示例;
- 新增表单取值、自定义工具栏、图片上传、多个 Editor.md 并存和动态加载 Editor.md 等多个示例;
- 新增插入锚点按钮和操作处理; - 新增插入锚点按钮和操作处理;
- 新增预览HTML内容窗口的关闭按钮,之前只能按ESC才能退出HTML全窗口预览;
- 新增预览 HTML 内容窗口的关闭按钮,之前只能按 ESC 才能退出 HTML 全窗口预览;
- 新增多语言(l18n)及动态加载语言包支持;
- 新增英语`en`和繁体中文`zh-tw`语言包模块;
- 新增多语言( l18n )及动态加载语言包支持;
- 新增英语 `en` 和繁体中文 `zh-tw` 语言包模块;
- 修改一些方法的内部实现以支持动态语言加载: - 修改一些方法的内部实现以支持动态语言加载:
- `toolbarHandler()`更为`setToolbarHandler()`;
- `setToolbar()`方法包含`setToolbarHandler()`;
- 新建`createInfoDialog()`方法;
- 修改`showInfoDialog()`和`hideInfoDialog()`方法的内部实现等;
- `toolbarHandler()` 更为 `setToolbarHandler()`
- `setToolbar()` 方法包含 `setToolbarHandler()`
- 新建 `createInfoDialog()` 方法;
- 修改 `showInfoDialog()` `hideInfoDialog()` 方法的内部实现等;
- 修改多次Bug,并优化触摸事件,改进对iPad的支持;
- 修改多次 Bug ,并优化触摸事件,改进对 iPad 的支持;
- 工具栏新增清空按钮和清空方法`clear()`,解决工具栏文本会被选中出现蓝底的问题;
- 工具栏新增清空按钮和清空方法 `clear()` ,解决工具栏文本会被选中出现蓝底的问题;
- 配置项`tocStartLevel`的默认值由2改为1,表示默认从H1开始生成ToC;
- 配置项 `tocStartLevel` 的默认值由 2 改为 1,表示默认从 H1 开始生成 ToC;
- 解决IE8下加载出错的问题;
- 新增两个静态成员属性`isIE`和`isIE8`,用于判断IE8;
- 由于IE8不支持FlowChart和SequenceDiagram,默认在IE8下不加载这两个组件,无论是否开启;
- 解决 IE8 下加载出错的问题;
- 新增两个静态成员属性 `isIE` `isIE8` ,用于判断 IE8;
- 由于 IE8 不支持 FlowChart SequenceDiagram,默认在 IE8 下不加载这两个组件,无论是否开启;
- 新增Zepto.js的支持;
- 为了兼容Zepto,某些元素在操作处理上不再使用`outerWidth()`、`outerHeight()`、`hover()`、`is()`等方法;
- 为了避免修改flowChart.js和sequence-diagram.js的源码,所以想支持flowChart或sequenceDiagram得加上这一句:`var jQuery = Zepto;`;
- 新增 Zepto.js 的支持;
- 为了兼容 Zepto.js ,某些元素在操作处理上不再使用 `outerWidth()` `outerHeight()` 、`hover()` 、`is()` 等方法;
- 为了避免修改 flowChart.js sequence-diagram.js 的源码,所以想支持 flowChart sequenceDiagram 得加上这一句: `var jQuery = Zepto;`
- 新增`editormd.$name`属性,修改`editormd.homePage`属性的新地址;
- 新增 `editormd.$name` 属性,修改 `editormd.homePage` 属性的新地址;
- `editormd.markdownToHTML()`新增方法返回一个jQuery实例对象;
- 该实例对象定义了一个`getMarkdown()`方法,用于获取Markdown源代码;
- 该实例对象定义了一个`tocContainer`成员属性,即ToC列表的父层的jQuery实例对象;
- `editormd.markdownToHTML()` 新增方法返回一个 jQuery 实例对象;
- 该实例对象定义了一个 `getMarkdown()`方法,用于获取 Markdown 源代码;
- 该实例对象定义了一个 `tocContainer` 成员属性,即 ToC 列表的父层的 jQuery 实例对象;
- 新增只读模式; - 新增只读模式;
- 新增配置项`readOnly`,默认值为`false`,即可编辑模式;
- 新增配置项 `readOnly` ,默认值为 `false` ,即可编辑模式;
- 其他相关改动; - 其他相关改动;
- 新增方法`focus()`、`setCursor()`、`getCursor()`、`setSelection()`、`getSelection()`、`replaceSelection()`和`insertValue()`方法,并增加对应的示例;
- 新增方法 `focus()` `setCursor()` `getCursor()` 、`setSelection()` 、`getSelection()` `replaceSelection()` `insertValue()` 方法,并增加对应的示例;
- 新增配置项`saveHTMLToTextarea`,用于将解析后的HTML保存到Textarea,以供提交到后台程序;
- `getHTML()`方法必须在`saveHTMLToTextarea == true`的情况下才能使用;
- 新增`getHTML()`方法的别名`getTextareaSavedHTML()`方法;
- 新增方法`getPreviewedHTML()`,用于获取预览窗口的HTML;
- 新增配置项 `saveHTMLToTextarea` ,用于将解析后的 HTML 保存到 Textarea,以供提交到后台程序;
- `getHTML()` 方法必须在 `saveHTMLToTextarea == true` 的情况下才能使用;
- 新增 `getHTML()` 方法的别名 `getTextareaSavedHTML()` 方法;
- 新增方法 `getPreviewedHTML()` ,用于获取预览窗口的 HTML
- 修复了一些大大小小的Bugs;
- 修复了一些大大小小的 Bugs;
#####v1.1.1
##### v1.1.1
- 接受一个pull请求,修复了`getHTML ()`和`getPreviewedHTML()`方法中的3处错误;
- 接受一个 pull 请求,修复了 `getHTML ()` `getPreviewedHTML()` 方法中的 处错误;
#####v1.1.2
##### v1.1.2
- 修复Bug [#10](https://github.com/pandao/editor.md/issues/10);
- 修复Bug [#12](https://github.com/pandao/editor.md/issues/12);
- 修复 Bug [#10](https://github.com/pandao/editor.md/issues/10);
- 修复 Bug [#12](https://github.com/pandao/editor.md/issues/12);
#####v1.1.3
##### v1.1.3
- 修复Bug [#14](https://github.com/pandao/editor.md/issues/14);
- 修复Bug [#15](https://github.com/pandao/editor.md/issues/15);
- 修复 Bug [#14](https://github.com/pandao/editor.md/issues/14);
- 修复 Bug [#15](https://github.com/pandao/editor.md/issues/15);
#####v1.1.4
##### v1.1.4
- 修复Bug [#17](https://github.com/pandao/editor.md/issues/17);
- 修改了`getToolbarHandles()`和`setToolbarHandler()`方法;
- 从`editormd.scss`中分离出`editormd.logo.scss`,并生成`editormd.logo.css`,以便单独使用;
- 同时修改了`Gulpfile.js`的相应任务;
- 修复 Bug [#17](https://github.com/pandao/editor.md/issues/17);
- 修改了 `getToolbarHandles()` `setToolbarHandler()` 方法;
- 从 `editormd.scss` 中分离出 `editormd.logo.scss` ,并生成 `editormd.logo.css` ,以便单独使用;
- 同时修改了 `Gulpfile.js` 的相应任务;
#####v1.1.5
##### v1.1.5
- 修复Bug [#18](https://github.com/pandao/editor.md/issues/18);
- 修改了`showInfoDialog()`和`createInfoDialog()`方法;
- 新增`infoDialogPosition()`方法;
- 修复 Bug [#18](https://github.com/pandao/editor.md/issues/18);
- 修改了 `showInfoDialog()` `createInfoDialog()` 方法;
- 新增 `infoDialogPosition()` 方法;
- 修复Bug [#20](https://github.com/pandao/editor.md/issues/20);
- 修复 Bug [#20](https://github.com/pandao/editor.md/issues/20);
- 修改了引用的处理函数; - 修改了引用的处理函数;
- 插入的headers的`#`号后面都加上了一个空格;
- 插入的 headers `#` 号后面都加上了一个空格;
#####v1.1.6
##### v1.1.6
修复多处Bug,具体如下:
修复多处 Bug,具体如下:
- 修复Bug [#23](https://github.com/pandao/editor.md/issues/23),即Headers的id属性的重复及中文问题;
- 修改了`editormd.markedRenderer()`方法;
- 修复 Bug [#23](https://github.com/pandao/editor.md/issues/23),即 Headers id 属性的重复及中文问题;
- 修改了 `editormd.markedRenderer()` 方法;
- 修复Bug [#24](https://github.com/pandao/editor.md/issues/24);
- 修改了`setMarkdown()`、`clear()`和`loadedDisplay()`方法的内部实现;
- 新增了`katexRender()`、`flowChartAndSequenceDiagramRender()`、`previewCodeHighlight()`方法;
- 修复 Bug [#24](https://github.com/pandao/editor.md/issues/24);
- 修改了 `setMarkdown()` `clear()` `loadedDisplay()` 方法的内部实现;
- 新增了 `katexRender()` `flowChartAndSequenceDiagramRender()` `previewCodeHighlight()` 方法;
- 修复有些情况下无法保存Markdown源文档到textarea的问题;
- 修改了`setCodeMirror()`、`recreateEditor()`等方法;
- 修复有些情况下无法保存 Markdown 源文档到 textarea 的问题;
- 修改了 `setCodeMirror()` `recreateEditor()` 等方法;
- 修改了以上Bug及部分相关示例文件;
- 修改了以上 Bug 及部分相关示例文件;
#####v1.1.7
##### v1.1.7
修复多处Bug,具体如下:
修复多处 Bug,具体如下:
- 修复Bug [#25](https://github.com/pandao/editor.md/issues/25);
- 修改了`loadedDisplay()`方法,将`settings.onload`移动了`CodeMirror.on("change")`事件注册后再触发;
- 修复 Bug [#25](https://github.com/pandao/editor.md/issues/25);
- 修改了 `loadedDisplay()` 方法,将 `settings.onload` 移动了 `CodeMirror.on("change")` 事件注册后再触发;
- 修复Bug [#26](https://github.com/pandao/editor.md/issues/26);
- 修改了`saveToTextareas()`方法;
- 新增`state.loaded`和`state.watching`两个属性;
- 修复 Bug [#26](https://github.com/pandao/editor.md/issues/26);
- 修改了 `saveToTextareas()` 方法;
- 新增 `state.loaded` `state.watching` 两个属性;
- 修改了以上Bug相关示例文件;
- 修改了以上 Bug 相关示例文件;
#####v1.1.8
##### v1.1.8
改进功能,具体如下: 改进功能,具体如下:
- 改进 [#27](https://github.com/pandao/editor.md/issues/27); - 改进 [#27](https://github.com/pandao/editor.md/issues/27);
- 新增配置项`matchWordHighlight`,可选值有:`true, false, "onselected"`,默认值为`true`,即开启自动匹配和标示相同单词;
- 新增配置项 `matchWordHighlight` ,可选值有: `true, false, "onselected"` ,默认值为 `true` ,即开启自动匹配和标示相同单词;
- 改进 [#28](https://github.com/pandao/editor.md/issues/28); - 改进 [#28](https://github.com/pandao/editor.md/issues/28);
- 将`jquery.min.js`、`font-awesome.min.css`、`github-markdown.css`移除(这是一个疏忽,它们不是动态加载的依赖模块或者不需要的,避免不必要的硬盘空间占用);
- 将 `jquery.min.js` `font-awesome.min.css` `github-markdown.css` 移除(这是一个疏忽,它们不是动态加载的依赖模块或者不需要的,避免不必要的硬盘空间占用);
- 修改了所有相关的示例文件; - 修改了所有相关的示例文件;
#####v1.1.9
##### v1.1.9
- 修复无法解析heading link的Bug [#29](https://github.com/pandao/editor.md/issues/29);
- 修复无法解析 heading link Bug [#29](https://github.com/pandao/editor.md/issues/29);
- 修改了`editormd.markedRenderer()`方法的内部实现;
- 新增了`editormd.trim()`,用于清除字符串两边的空格;
- 修改了所有相关的示例文件和测试用例`marked-heading-link-test.html`;
- 修改了 `editormd.markedRenderer()` 方法的内部实现;
- 新增了 `editormd.trim()` ,用于清除字符串两边的空格;
- 修改了所有相关的示例文件和测试用例 `marked-heading-link-test.html`
- 修改了`README.md`,添加了`Shields.io`图标;
- 修改了 `README.md` ,添加了 `Shields.io` 图标;
###v1.2
### v1.2
#####v1.2.0
##### v1.2.0
v1.2.0 主要更新: v1.2.0 主要更新:
- 新增代码折叠、搜索替换、自定义样式主题和自定义快捷键等功能; - 新增代码折叠、搜索替换、自定义样式主题和自定义快捷键等功能;
- 新增Emoji表情、@Link、GFM Task Lists支持;
- 新增表格插入、Emoji表情插入、HTML实体字符插入、使用帮助等对话框;
- 新增 Emoji 表情、@Link 、GFM Task Lists 支持;
- 新增表格插入、Emoji 表情插入、HTML 实体字符插入、使用帮助等对话框;
- 新增插件扩展机制; - 新增插件扩展机制;
- 新增手动加载依赖模块方式; - 新增手动加载依赖模块方式;
- 改用`Prefixes.css`作CSS前缀预处理;
- 改用 `Prefixes.css` CSS 前缀预处理;
- 改进和增强工具栏自定义功能,完善事件监听和处理方法; - 改进和增强工具栏自定义功能,完善事件监听和处理方法;
- 部分功能改进(更加方便的预格式文本/代码插入、自动闭合标签等)、新增多个方法、改进Require.js支持和修复多个Bug等等;
- 部分功能改进(更加方便的预格式文本/代码插入、自动闭合标签等)、新增多个方法、改进 Require.js 支持和修复多个 Bug 等等;
**具体更新如下:** **具体更新如下:**
- 新建v1.1.x分支;
- v1.2文件结构变动较大;
- 新建 v1.1.x 分支;
- v1.2 文件结构变动较大;
- 新增代码折叠、自动闭合标签和搜索替换功能; - 新增代码折叠、自动闭合标签和搜索替换功能;
- 搜索快捷键`Ctrl + F / Command + F`;
- 替换快捷键`Ctrl + Shift + F / Command + Option + F`;
- 折叠快捷键`Ctrl + Q / Command + Q`
- 搜索快捷键 `Ctrl + F / Command + F`
- 替换快捷键 `Ctrl + Shift + F / Command + Option + F`
- 折叠快捷键 `Ctrl + Q / Command + Q`
- 新增自定义主题支持; - 新增自定义主题支持;
- 新增3个成员方法`setTheme()`、`setCodeMirrorOption()`和`getCodeMirrorOption()`;
- 新增 3 个成员方法 `setTheme()` `setCodeMirrorOption()` `getCodeMirrorOption()`
- 新增@Link支持;
- 新增 @Link 支持;
- 新增GFM Task Lists支持;
- 新增 GFM Task Lists 支持;
- 新增Emoji表情支持;
- 支持Github emoji`:emoji-name:`、FontAwesome icons(`:fa-xxx:`)、Twitter emoji(twemoji) (`:tw-xxxx:`)、Editor.md logo icons(`:editormd-logo:`)形式的Emoji;
- 新增属性`editormd.emoji`、`editormd.twemoji`、`editormd.urls`和`editormd.regex`;
- 新增 Emoji 表情支持;
- 支持 Github emoji `:emoji-name:` 、FontAwesome icons(`:fa-xxx:`)、Twitter emoji (twemoji) ( `:tw-xxxx:` )、Editor.md logo icons( `:editormd-logo:` )形式的 Emoji;
- 新增属性 `editormd.emoji` `editormd.twemoji` `editormd.urls` `editormd.regex`
- 新增HTML实体字符插入、插入表格和使用帮助对话框;
- 修改了`createDialog()`等方法;
- 新增`mask`成员属性和锁屏方法`editormd.lockScreen()`、`editormd.fn.lockScreen()`;
- 新增 HTML 实体字符插入、插入表格和使用帮助对话框;
- 修改了 `createDialog()` 等方法;
- 新增 `mask` 成员属性和锁屏方法 `editormd.lockScreen()` `editormd.fn.lockScreen()`
- 改进插入预格式文本和代码对话框; - 改进插入预格式文本和代码对话框;
- 将`<textarea>`改为`CodeMirror`,输入更加方便和直观;
- 将 `<textarea>` 改为 `CodeMirror` ,输入更加方便和直观;
- 新增自定义键盘快捷键功能; - 新增自定义键盘快捷键功能;
- 新增2个方法:`addKeyMap()`和`removeKayMap()`;
- 新增 2 个方法: `addKeyMap()` `removeKayMap()`
- 改用`Prefixes.css`作CSS前缀预处理;
- 改用 `Prefixes.css` 作CSS前缀预处理;
- SCSS前缀预处理mixins改用 [Prefixes.scss](https://github.com/pandao/prefixes.scss "Prefixes.scss"); - SCSS前缀预处理mixins改用 [Prefixes.scss](https://github.com/pandao/prefixes.scss "Prefixes.scss");
- 改进和增强工具栏自定义功能; - 改进和增强工具栏自定义功能;
- 新增配置项`toolbarCustomIcons`,用于增加自定义工具栏的功能,可以直接插入HTML标签,不使用默认的元素创建图标;
- 新增工具栏列表预设值属性`editormd.toolbarModes`;
- 移除成员属性`toolbarIconHandlers`;
- 新增配置项 `toolbarCustomIcons` ,用于增加自定义工具栏的功能,可以直接插入 HTML 标签,不使用默认的元素创建图标;
- 新增工具栏列表预设值属性 `editormd.toolbarModes`
- 移除成员属性 `toolbarIconHandlers`
- 完善和新增事件处理方法; - 完善和新增事件处理方法;
- 新增事件回调注册方法`on()`;
- 新增事件回调移除方法`off()`;
- 新增事件回调处理配置项:`onresize`、`onscroll`、`onpreviewscroll`、`onpreviewing`、`onpreviewed`、`onwatch`和`onunwatch`;
- 新增事件回调注册方法 `on()`
- 新增事件回调移除方法 `off()`
- 新增事件回调处理配置项: `onresize` `onscroll` 、`onpreviewscroll` `onpreviewing` `onpreviewed` 、`onwatch` `onunwatch`
- 新增手动加载依赖模块方式,以便可同步使用成员方法; - 新增手动加载依赖模块方式,以便可同步使用成员方法;
- 新增属性`autoLoadModules`,默认值为`true`;
- 新增属性 `autoLoadModules` ,默认值为 `true`
- 新增插件及扩展机制; - 新增插件及扩展机制;
- 新增插件自定义机制,改变整体结构(包括文件结构),以便更加方便地实现插件扩展; - 新增插件自定义机制,改变整体结构(包括文件结构),以便更加方便地实现插件扩展;
- 新增对象扩展方法`extends()`、`set()`;
- 新增对象扩展方法 `extends()` `set()`
- 新增成员方法和属性: - 新增成员方法和属性:
- 新增两个方法:`setValue()`、`getValue()`;
- 新增`config()` 方法,用于加载后重新配置;
- 增加两个属性`cm`,是`codeEditor`的简写,`cmElement`,是`codeMirror`的别名;
- 新增两个方法: `setValue()` 、`getValue()`;
- 新增 `config()` 方法,用于加载后重新配置;
- 增加两个属性 `cm` ,是 `codeEditor` 的简写, `cmElement``codeMirror` 的别名;
- 成员方法的改进: - 成员方法的改进:
- 改进:`showToolbar()`和`hideToolbar()`方法增加一个`callback`函数,用于直接回调操作;
- 改进:修改了`previewCodeHighlight()`方法;
- 更名:`recreateEditor()`更名为`recreate()`;
- 移除`setMarked()`方法;
- 改进: `showToolbar()` `hideToolbar()` 方法增加一个 `callback` 函数,用于直接回调操作;
- 改进:修改了 `previewCodeHighlight()` 方法;
- 更名: `recreateEditor()` 更名为 `recreate()`
- 移除 `setMarked()` 方法;
- 新增HTML标签解析过滤机制;
- 通过设置`settings.htmlDecode = "style,script,iframe"`来实现过滤指定标签的解析;
- 新增 HTML 标签解析过滤机制;
- 通过设置 `settings.htmlDecode = "style,script,iframe"` 来实现过滤指定标签的解析;
- 改进Require.js支持;
- 修复Require.js下CodeMirror编辑器的代码无法高亮的问题;
- 更新`underscore`版本至`1.8.2`;
- 移除`editormd.requirejsInit()`和`editormd.requireModules()`方法;
- 新增`Require.js/AMD`专用版本文件`editormd.amd.js`;
- 新建Gulp任务`amd`;
- 改进 Require.js 支持;
- 修复 Require.js CodeMirror 编辑器的代码无法高亮的问题;
- 更新 `underscore` 版本至 `1.8.2`
- 移除 `editormd.requirejsInit()` `editormd.requireModules()` 方法;
- 新增 `Require.js/AMD` 专用版本文件 `editormd.amd.js`
- 新建 Gulp 任务 `amd`
- 修改和新增以上改进等相关示例; - 修改和新增以上改进等相关示例;
@ -310,43 +310,43 @@ v1.2.0 主要更新:
主要更新: 主要更新:
- 预设键盘快捷键处理(粗体等),插入Markdown更加方便;
- 更新CodeMirror版本为`5.0`;
- 更新Marked版本为`0.3.3`;
- 预设键盘快捷键处理(粗体等),插入 Markdown 更加方便;
- 更新 CodeMirror 版本为 `5.0`
- 更新 Marked 版本为 `0.3.3`
- 新增自动高度和工具栏固定定位功能; - 新增自动高度和工具栏固定定位功能;
- 改进表格插入对话框; - 改进表格插入对话框;
- 工具栏新增三个按钮,分别是将所选文本首字母转成大写、转成小写、转成大写; - 工具栏新增三个按钮,分别是将所选文本首字母转成大写、转成小写、转成大写;
- 修改使用帮助文档; - 修改使用帮助文档;
- 修复多个Bug;
- 修复多个 Bug;
具体更新如下: 具体更新如下:
- 新增常用键盘快捷键预设处理; - 新增常用键盘快捷键预设处理;
- 新增属性`editormd.keyMaps`,预设一些常用操作,例如插入粗体等;
- 新增成员方法`registerKeyMaps()`;
- 退出HTML全屏预览快捷键更改为`Shift + ESC`;
- 新增配置项`disabledKeyMaps`,用于屏蔽一些快捷键操作;
- 更新CodeMirror版本为`5.0`;
- 修改无法输入`/`的问题;
- 更新Marked版本为`0.3.3`;
- 新增属性 `editormd.keyMaps` ,预设一些常用操作,例如插入粗体等;
- 新增成员方法 `registerKeyMaps()`
- 退出HTML全屏预览快捷键更改为 `Shift + ESC`
- 新增配置项 `disabledKeyMaps` ,用于屏蔽一些快捷键操作;
- 更新 CodeMirror 版本为 `5.0`
- 修改无法输入 `/` 的问题;
- 更新 Marked 版本为 `0.3.3`
- 新增自动高度和工具栏固定定位(滚动条拖动时)模式; - 新增自动高度和工具栏固定定位(滚动条拖动时)模式;
- 新增配置项`settings.autoHeight`;
- 新增配置项`settings.toolbarAutoFixed`;
- 新增方法 `setToolbarAutoFixed(true|false)`
- 新增配置项 `settings.autoHeight`
- 新增配置项 `settings.toolbarAutoFixed`
- 新增方法 `setToolbarAutoFixed(true|false)`
- 新增邮箱地址自动添加链接功能; - 新增邮箱地址自动添加链接功能;
- 新增配置项`emailLink`,默认为`true`;
- 新增配置项 `emailLink` ,默认为 `true` ;
- 改进表格插入对话框; - 改进表格插入对话框;
- 工具栏新增三个按钮,分别是将所选文本首字母转成大写、转成小写、转成大写; - 工具栏新增三个按钮,分别是将所选文本首字母转成大写、转成小写、转成大写;
- 新增方法`editormd.ucwords()`,别名`editormd.wordsFirstUpperCase()`;
- 新增方法`editormd.ucfirst()`,别名`editormd.firstUpperCase()`;
- 新增两个成员方法`getSelections()`和`getSelections()`;
- 修复Font awesome 图标 emoji 部分无法解析的Bug,[#39](https://github.com/pandao/editor.md/issues/39)
- 改进@link功能 [#40](https://github.com/pandao/editor.md/issues/40);
- 新增配置项`atLink`,默认为`true`;
- 修复无法输入`/`的问题 [#42](https://github.com/pandao/editor.md/issues/42);
- 新增方法 `editormd.ucwords()` ,别名 `editormd.wordsFirstUpperCase()`
- 新增方法 `editormd.ucfirst()` ,别名 `editormd.firstUpperCase()`
- 新增两个成员方法 `getSelections()` `getSelections()`
- 修复 Font awesome 图标 emoji 部分无法解析的 Bug,[#39](https://github.com/pandao/editor.md/issues/39)
- 改进 @link 功能 [#40](https://github.com/pandao/editor.md/issues/40);
- 新增配置项 `atLink` ,默认为 `true` ;
- 修复无法输入 `/` 的问题 [#42](https://github.com/pandao/editor.md/issues/42);
- 修改使用帮助说明的错误 [#43](https://github.com/pandao/editor.md/issues/43); - 修改使用帮助说明的错误 [#43](https://github.com/pandao/editor.md/issues/43);
- 新增配置项`pluginPath`,默认为空时,等于`settings.path + "../plugins/"`;
- 新增配置项 `pluginPath`,默认为空时,等于 `settings.path + "../plugins/"`
### v1.4 ### v1.4
@ -356,87 +356,87 @@ v1.2.0 主要更新:
- 新增延迟解析机制,预览更即时; - 新增延迟解析机制,预览更即时;
- 新增跳转到指定行的功能和对话框; - 新增跳转到指定行的功能和对话框;
- 新增ToC下拉菜单、自定义ToC容器的功能;
- 新增 ToC 下拉菜单、自定义 ToC 容器的功能;
- 新增跳转到行、搜索的工具栏按钮; - 新增跳转到行、搜索的工具栏按钮;
- 新增支持插入和解析(打印)分页符; - 新增支持插入和解析(打印)分页符;
- 改进快捷键功能和自动高度模式等; - 改进快捷键功能和自动高度模式等;
- 改进:将锚点链接改名为引用链接; - 改进:将锚点链接改名为引用链接;
- 改进编辑器重建和重配置功能; - 改进编辑器重建和重配置功能;
- 修复多个Bug;
- 修复多个 Bug;
具体更新: 具体更新:
- 新增延迟解析预览的机制,解决输入太多太快出现的 “延迟卡顿” 问题; - 新增延迟解析预览的机制,解决输入太多太快出现的 “延迟卡顿” 问题;
- 新增配置项`delay`,默认值为 `300`
- 新增配置项 `delay` ,默认值为 `300`
- 修复当输入速度太快时,解析Flowchart会抛出错误的问题; - 修复当输入速度太快时,解析Flowchart会抛出错误的问题;
- 修改iPad等移动终端的浏览器无法上传图片的问题 [#48](https://github.com/pandao/editor.md/issues/48);
- 修复单独引用`editormd.preview.css`时无法显示Font Awesome和Editor.md logo字体的问题;
- 更新和修改Gulp构建;
- 修改了`Gulpfile.js`,并且`gulp-ruby-sass`升级到最新版本`1.0.0-alpha.3`;
- 编辑SCSS时,不再生成CSS的Source map文件;
- 执行jshint和更正一些JS写法的不规范,精简了代码;
- 新增配置项`appendMarkdown`和`appendMarkdown()`方法,用于(初始化前后)追加Markdown到Textarea;
- 改进部分预设快捷键功能,包括F9(watch)、F10(preview)、F11(fullscreen)等;
- 修改 iPad 等移动终端的浏览器无法上传图片的问题 [#48](https://github.com/pandao/editor.md/issues/48);
- 修复单独引用 `editormd.preview.css` 时无法显示 Font Awesome Editor.md logo 字体的问题;
- 更新和修改 Gulp 构建;
- 修改了 `Gulpfile.js` ,并且 `gulp-ruby-sass` 升级到最新版本 `1.0.0-alpha.3` ;
- 编辑 SCSS 时,不再生成 CSS Source map 文件;
- 执行 jshint 和更正一些 JS 写法的不规范,精简了代码;
- 新增配置项 `appendMarkdown` `appendMarkdown()` 方法,用于(初始化前后)追加 Markdown Textarea
- 改进部分预设快捷键功能,包括 F9 (watch)、F10 (preview)、F11 (fullscreen)等;
- 修复自动高度模式下出现的几个问题; - 修复自动高度模式下出现的几个问题;
- 全屏退出时高度不正确的问题:修改了`fullscreenExit()`方法的内部实现;
- 当解析预览后的HTML内容高度高于Markdown源码编辑器高度时,无法正确预览的问题 [#49](https://github.com/pandao/editor.md/issues/49);
- 修改`onscroll`和`onpreviewscroll`无法访问`this`的问题;
- 修改`init()`方法,可以只设置一个参数;
- 新增插入TeX(KaTeX)公式的快捷键`Ctrl + Shift + K`和插入方法`tex()`;
- 全屏退出时高度不正确的问题:修改了 `fullscreenExit()` 方法的内部实现;
- 当解析预览后的 HTML 内容高度高于 Markdown 源码编辑器高度时,无法正确预览的问题 [#49](https://github.com/pandao/editor.md/issues/49);
- 修改 `onscroll` `onpreviewscroll` 无法访问 `this` 的问题;
- 修改 `init()` 方法,可以只设置一个参数;
- 新增插入 TeX (KaTeX) 公式的快捷键 `Ctrl + Shift + K` 和插入方法 `tex()`
- 将锚点链接改为引用链接,引用的链接改为插入到页尾; - 将锚点链接改为引用链接,引用的链接改为插入到页尾;
- 工具栏的名称`anchor`改为`reference-link`;
- 工具栏的名称`htmlEntities`改名为`html-entities`;
- 工具栏的名称 `anchor` 改为 `reference-link`
- 工具栏的名称 `htmlEntities` 改名为 `html-entities`
- 改进编辑器重建和重配置功能; - 改进编辑器重建和重配置功能;
- 修改了`loadedDisplay()`方法;
- 修改了`config()`和`recreate()`方法;
- 修改了 `loadedDisplay()` 方法;
- 修改了 `config()` `recreate()` 方法;
- 新增跳转到指定行的功能; - 新增跳转到指定行的功能;
- 新增方法`gotoLine()`;
- 新增跳转到行对话框插件`goto-line-dialog`;
- 新增快捷键`Ctrl + Alt + G`;
- 改进`executePlugin()`方法;
- 修改了`help-dialog/help.md`;
- 新增方法 `gotoLine()`
- 新增跳转到行对话框插件 `goto-line-dialog`
- 新增快捷键 `Ctrl + Alt + G`
- 改进 `executePlugin()` 方法;
- 修改了 `help-dialog/help.md`
- 新增搜索工具栏按钮; - 新增搜索工具栏按钮;
- 新增方法`search()`、`searchReplace()`和`searchReplaceAll()`;
- 原全屏预览HTML按钮的图标改为`fa-desktop`;
- 新增方法 `search()` 、`searchReplace()` `searchReplaceAll()`
- 原全屏预览 HTML 按钮的图标改为 `fa-desktop`
- 改为默认开启搜索替换功能; - 改为默认开启搜索替换功能;
- 更换了关于Editor.md的标语(slogan);
- 标题按钮`h`改为大写的`H`;
- `saveToTextareas()`方法更名为`save()`;
- 新增ToC下拉菜单、自定义ToC容器的功能;
- 新增Markdown扩展语法`[TOCM]`,自动生成ToC下拉菜单;
- 新增配置项`tocm`,默认为`true`,即可以使用`[TOCM]`;
- 新增配置项`tocDropdown`和`tocTitle`;
- 新增方法`editormd.tocDropdownMenu()`;
- 新增配置项`tocContainer`,值为jQuery选择器,默认为空;
- 修改了配置项`placeholder`的默认值;
- 改进对IE8的兼容支持;
- 修复Firefox下因为`Object.watch()`而出现的问题;
- 更换了关于 Editor.md 的标语( slogan );
- 标题按钮 `h` 改为大写的 `H`
- `saveToTextareas()` 方法更名为 `save()`
- 新增 ToC 下拉菜单、自定义 ToC 容器的功能;
- 新增 Markdown 扩展语法 `[TOCM]` ,自动生成 ToC 下拉菜单;
- 新增配置项 `tocm` ,默认为 `true`,即可以使用 `[TOCM]`
- 新增配置项 `tocDropdown` `tocTitle`
- 新增方法 `editormd.tocDropdownMenu()`
- 新增配置项 `tocContainer` ,值为 jQuery 选择器,默认为空;
- 修改了配置项 `placeholder` 的默认值;
- 改进对 IE8 的兼容支持;
- 修复 Firefox 下因为 `Object.watch()` 而出现的问题;
- 新增支持插入和解析(打印)分页符; - 新增支持插入和解析(打印)分页符;
- 新增配置项`pageBreak`,默认值为`true`;
- 新增语法`[========]`,即括号内至少8个等号;
- 新增插入分页符的工具栏图标和方法`pagebreak()`;
- 新增插入分页符的快捷键`Shift + Alt + P`;
- 修复一些Bug,包括 [#51](https://github.com/pandao/editor.md/issues/51)等;
- 新增配置项 `pageBreak` ,默认值为 `true`
- 新增语法 `[========]` ,即括号内至少 8 个等号;
- 新增插入分页符的工具栏图标和方法 `pagebreak()`
- 新增插入分页符的快捷键 `Shift + Alt + P`
- 修复一些 Bug,包括 [#51](https://github.com/pandao/editor.md/issues/51) 等;
- 新增和修改以上更新的相关示例; - 新增和修改以上更新的相关示例;
####v1.4.1
#### v1.4.1
- 新增配置项`syncScrolling`,即是否开启同步滚动预览,默认值为`false`;
- 修复Bug [#64](https://github.com/pandao/editor.md/issues/64);
- 更新`editormd.katexURL`资源地址的默认值,即更新版本为`0.3.0`;
- 新增配置项 `syncScrolling`,即是否开启同步滚动预览,默认值为 `false`
- 修复 Bug [#64](https://github.com/pandao/editor.md/issues/64);
- 更新 `editormd.katexURL` 资源地址的默认值,即更新版本为 `0.3.0`
- 新增测试用例`tests/katex-tests.html`; - 新增测试用例`tests/katex-tests.html`;
- 修改示例文件`examples/katex.html`; - 修改示例文件`examples/katex.html`;
- 修复Bug [#66](https://github.com/pandao/editor.md/issues/66);
- 修复编辑器工具栏按钮`:hover` CSS3 transition无效的问题;
- 修复 Bug [#66](https://github.com/pandao/editor.md/issues/66);
- 修复编辑器工具栏按钮 `:hover` CSS3 transition 无效的问题;
- 修改了 `README.md` - 修改了 `README.md`
####v1.4.2
#### v1.4.2
- 改进和增强自定义工具栏功能,支持图标按钮右对齐 [#69](https://github.com/pandao/editor.md/issues/69); - 改进和增强自定义工具栏功能,支持图标按钮右对齐 [#69](https://github.com/pandao/editor.md/issues/69);
- 改进和增强HTML标签的解析过滤功能,支持过滤指定的属性等 [#70](https://github.com/pandao/editor.md/issues/70);
- 改进和增强 HTML 标签的解析过滤功能,支持过滤指定的属性等 [#70](https://github.com/pandao/editor.md/issues/70);
- 删除分支 `mathjax-version``v1.1.9` - 删除分支 `mathjax-version``v1.1.9`
####v1.4.3
#### v1.4.3
- 改进:可配置是否自动聚焦编辑器 [#74](https://github.com/pandao/editor.md/issues/74); - 改进:可配置是否自动聚焦编辑器 [#74](https://github.com/pandao/editor.md/issues/74);
- 新增配置项 `autoFocus`,默认值为 `true`; - 新增配置项 `autoFocus`,默认值为 `true`;
@ -449,8 +449,21 @@ v1.2.0 主要更新:
- 改进:修改 CSS `font-family`,改进跨平台中英文字体显示; - 改进:修改 CSS `font-family`,改进跨平台中英文字体显示;
- 修改了 `README.md` - 修改了 `README.md`
####v1.4.4
#### v1.4.4
- 修复 Bug [#81](https://github.com/pandao/editor.md/issues/81),即不支持 `:+1:` 的问题; - 修复 Bug [#81](https://github.com/pandao/editor.md/issues/81),即不支持 `:+1:` 的问题;
- 修复 Bug [#85](https://github.com/pandao/editor.md/issues/85),即图片上传返回结果不支持 `Content-Type=application/json` 的问题; - 修复 Bug [#85](https://github.com/pandao/editor.md/issues/85),即图片上传返回结果不支持 `Content-Type=application/json` 的问题;
- 修复图片上传无法显示 loading 的问题;
- 修复图片上传无法显示 loading 的问题;
#### v1.4.5
- 规范项目的中英文混排;
- 新增配置项 `name`,用于指定 Markdown textarea 的 `name="xxxx"` 属性;
- 修复 Bug,即无法正确解析公式的 `<``>` 的问题 [#87](https://github.com/pandao/editor.md/issues/87);
- 修复 Bug,即 `getHTML()` 无效的问题 [#95](https://github.com/pandao/editor.md/issues/95);
- 修复 Bug,即火狐上传图片后无法返回值的问题 [#96](https://github.com/pandao/editor.md/issues/96);
- 修改了图片上传插件;
- 修改 PHP 上传类及示例;
- 方法更名:`extends()` 更名为 `extend()`,与兼容 IE8;
- 修复 IE8 下 Emoji 正则表达式字符集越界的问题;
- 更新了 `README.md``CHANGE.md` 等相关文档文件;

42
README.md

@ -51,7 +51,7 @@
Bower install : Bower install :
```shell ```shell
bower install editor.md
bower install editor.md
``` ```
#### Usages #### Usages
@ -59,10 +59,10 @@ Bower install :
HTML: HTML:
```html ```html
<link rel="stylesheet" href="editormd.min.css" />
<div id="editormd">
<textarea style="display:none;">### Hello world!</textarea>
</div>
<link rel="stylesheet" href="editormd.min.css" />
<div id="editormd">
<textarea style="display:none;">### Hello Editor.md !</textarea>
</div>
``` ```
> Tip: Editor.md can auto append `<textarea>` tag; > Tip: Editor.md can auto append `<textarea>` tag;
@ -70,23 +70,23 @@ HTML:
javascript: javascript:
```html ```html
<script src="jquery.min.js"></script>
<script src="editormd.min.js"></script>
<script type="text/javascript">
$(function() {
var editor = editormd("editormd", {
path : "../lib/" // Autoload modules mode, codemirror, marked... dependents libs path
});
/*
// or
var editor = editormd({
id : "editormd",
path : "../lib/"
});
*/
<script src="jquery.min.js"></script>
<script src="editormd.min.js"></script>
<script type="text/javascript">
$(function() {
var editor = editormd("editormd", {
path : "../lib/" // Autoload modules mode, codemirror, marked... dependents libs path
}); });
</script>
/*
// or
var editor = editormd({
id : "editormd",
path : "../lib/"
});
*/
});
</script>
``` ```
Using modular script loader : Using modular script loader :

2
bower.json

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

4
css/editormd.css

@ -2,12 +2,12 @@
* Editor.md * Editor.md
* *
* @file editormd.css * @file editormd.css
* @version v1.4.4
* @version v1.4.5
* @description Open source online markdown editor. * @description Open source online markdown editor.
* @license MIT License * @license MIT License
* @author Pandao * @author Pandao
* {@link https://github.com/pandao/editor.md} * {@link https://github.com/pandao/editor.md}
* @updateTime 2015-05-09
* @updateTime 2015-06-02
*/ */
@charset "UTF-8"; @charset "UTF-8";

4
css/editormd.logo.css

@ -2,12 +2,12 @@
* Editor.md * Editor.md
* *
* @file editormd.logo.css * @file editormd.logo.css
* @version v1.4.4
* @version v1.4.5
* @description Open source online markdown editor. * @description Open source online markdown editor.
* @license MIT License * @license MIT License
* @author Pandao * @author Pandao
* {@link https://github.com/pandao/editor.md} * {@link https://github.com/pandao/editor.md}
* @updateTime 2015-05-09
* @updateTime 2015-06-02
*/ */
/*! prefixes.scss v0.1.0 | Author: Pandao | https://github.com/pandao/prefixes.scss | MIT license | Copyright (c) 2015 */ /*! 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.4 | editormd.logo.min.css | Open source online markdown editor. | MIT License | By: Pandao | https://github.com/pandao/editor.md | 2015-05-09 */
/*! Editor.md v1.4.5 | editormd.logo.min.css | Open source online markdown editor. | MIT License | By: Pandao | https://github.com/pandao/editor.md | 2015-06-02 */
/*! 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} /*! 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}

2
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 * Editor.md
* *
* @file editormd.preview.css * @file editormd.preview.css
* @version v1.4.4
* @version v1.4.5
* @description Open source online markdown editor. * @description Open source online markdown editor.
* @license MIT License * @license MIT License
* @author Pandao * @author Pandao
* {@link https://github.com/pandao/editor.md} * {@link https://github.com/pandao/editor.md}
* @updateTime 2015-05-09
* @updateTime 2015-06-02
*/ */
@charset "UTF-8"; @charset "UTF-8";

2
css/editormd.preview.min.css

@ -1,4 +1,4 @@
/*! Editor.md v1.4.4 | editormd.preview.min.css | Open source online markdown editor. | MIT License | By: Pandao | https://github.com/pandao/editor.md | 2015-05-09 */
/*! Editor.md v1.4.5 | editormd.preview.min.css | Open source online markdown editor. | MIT License | By: Pandao | https://github.com/pandao/editor.md | 2015-06-02 */
@charset "UTF-8";/*! prefixes.scss v0.1.0 | Author: Pandao | https://github.com/pandao/prefixes.scss | MIT license | Copyright (c) 2015 *//*! @charset "UTF-8";/*! 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 * Font Awesome 4.3.0 by @davegandy - http://fontawesome.io - @fontawesome
* License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)

32
editormd.amd.js

@ -2,12 +2,12 @@
* Editor.md * Editor.md
* *
* @file editormd.amd.js * @file editormd.amd.js
* @version v1.4.4
* @version v1.4.5
* @description Open source online markdown editor. * @description Open source online markdown editor.
* @license MIT License * @license MIT License
* @author Pandao * @author Pandao
* {@link https://github.com/pandao/editor.md} * {@link https://github.com/pandao/editor.md}
* @updateTime 2015-05-09
* @updateTime 2015-06-02
*/ */
;(function(factory) { ;(function(factory) {
@ -129,7 +129,7 @@
}; };
editormd.title = editormd.$name = "Editor.md"; editormd.title = editormd.$name = "Editor.md";
editormd.version = "1.4.4";
editormd.version = "1.4.5";
editormd.homePage = "https://pandao.github.io/editor.md/"; editormd.homePage = "https://pandao.github.io/editor.md/";
editormd.classPrefix = "editormd-"; editormd.classPrefix = "editormd-";
@ -161,6 +161,7 @@
editormd.defaults = { editormd.defaults = {
mode : "gfm", //gfm or markdown mode : "gfm", //gfm or markdown
theme : "default", theme : "default",
name : "",
value : "", // value for CodeMirror, if mode not gfm/markdown value : "", // value for CodeMirror, if mode not gfm/markdown
markdown : "", markdown : "",
appendMarkdown : "", // if in init textarea value not empty, append markdown to textarea appendMarkdown : "", // if in init textarea value not empty, append markdown to textarea
@ -452,7 +453,7 @@
this.state.watching = (settings.watch) ? true : false; this.state.watching = (settings.watch) ? true : false;
if (!editor.hasClass("editormd")) {
if ( !editor.hasClass("editormd") ) {
editor.addClass("editormd"); editor.addClass("editormd");
} }
@ -474,7 +475,12 @@
markdownTextarea = this.markdownTextarea = editor.children("textarea"); markdownTextarea = this.markdownTextarea = editor.children("textarea");
} }
markdownTextarea.addClass(classNames.textarea.markdown).attr("name", id + "-markdown-doc").attr("placeholder", settings.placeholder);
markdownTextarea.addClass(classNames.textarea.markdown).attr("placeholder", settings.placeholder);
if (typeof markdownTextarea.attr("name") === "undefined" || markdownTextarea.attr("name") === "")
{
markdownTextarea.attr("name", (settings.name !== "") ? settings.name : id + "-markdown-doc");
}
var appendElements = [ var appendElements = [
(!settings.readOnly) ? "<a href=\"javascript:;\" class=\"fa fa-close " + classPrefix + "preview-close-btn\"></a>" : "", (!settings.readOnly) ? "<a href=\"javascript:;\" class=\"fa fa-close " + classPrefix + "preview-close-btn\"></a>" : "",
@ -882,7 +888,7 @@
* @returns {editormd} this(editormd instance object.) * @returns {editormd} this(editormd instance object.)
*/ */
extends : function() {
extend : function() {
if (typeof arguments[1] !== "undefined") if (typeof arguments[1] !== "undefined")
{ {
if (typeof arguments[1] === "function") if (typeof arguments[1] === "function")
@ -1961,13 +1967,15 @@
var newMarkdownDoc = editormd.$marked(cmValue, markedOptions); var newMarkdownDoc = editormd.$marked(cmValue, markedOptions);
this.markdownTextarea.val(cmValue);
//console.log("cmValue", cmValue, this.markdownTextarea, this.htmlTextarea);
this.markdownTextarea.text(cmValue);
cm.save(); cm.save();
if (settings.saveHTMLToTextarea) if (settings.saveHTMLToTextarea)
{ {
this.htmlTextarea.val(newMarkdownDoc);
this.htmlTextarea.text(newMarkdownDoc);
} }
if(settings.watch || (!settings.watch && state.preview)) if(settings.watch || (!settings.watch && state.preview))
@ -2182,7 +2190,7 @@
* @returns {editormd} 返回editormd的实例对象 * @returns {editormd} 返回editormd的实例对象
*/ */
setMarkdown : function(md) {
setMarkdown : function(md) {
this.cm.setValue(md || this.settings.markdown); this.cm.setValue(md || this.settings.markdown);
return this; return this;
@ -2252,7 +2260,7 @@
return false; return false;
} }
return this.htmlTextarea.html();
return this.htmlTextarea.val();
}, },
/** /**
@ -3216,7 +3224,7 @@
atLink : /@(\w+)/g, atLink : /@(\w+)/g,
email : /(\w+)@(\w+)\.(\w+)\.?(\w+)?/g, email : /(\w+)@(\w+)\.(\w+)\.?(\w+)?/g,
emailLink : /(mailto:)?([\w\.\_]+)@(\w+)\.(\w+)\.?(\w+)?/g, emailLink : /(mailto:)?([\w\.\_]+)@(\w+)\.(\w+)\.?(\w+)?/g,
emoji : /:([\+-\w]+):/g,
emoji : /:([\w\+-]+):/g,
emojiDatetime : /(\d{2}:\d{2}:\d{2})/g, emojiDatetime : /(\d{2}:\d{2}:\d{2})/g,
twemoji : /:(tw-([\w]+)-?(\w+)?):/g, twemoji : /:(tw-([\w]+)-?(\w+)?):/g,
fontAwesome : /:(fa-([\w]+)(-(\w+)){0,}):/g, fontAwesome : /:(fa-([\w]+)(-(\w+)){0,}):/g,
@ -3848,7 +3856,7 @@
var katexHandle = function() { var katexHandle = function() {
div.find("." + editormd.classNames.tex).each(function(){ div.find("." + editormd.classNames.tex).each(function(){
var tex = $(this); var tex = $(this);
katex.render(tex.html(), tex[0]);
katex.render(tex.html().replace(/&lt;/g, "<").replace(/&gt;/g, ">"), tex[0]);
}); });
}; };

7
editormd.amd.min.js

File diff suppressed because one or more lines are too long

1818
editormd.js

File diff suppressed because it is too large

7
editormd.min.js

File diff suppressed because one or more lines are too long

2
examples/@links.html

@ -34,7 +34,7 @@ $(function() {
}); });
``` ```
###@links
### @links
[TOC] [TOC]

6
examples/code-fold.html

@ -2,7 +2,7 @@
<html lang="zh"> <html lang="zh">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title>Code fold - Editor.md examples</title>
<title>Code folding - Editor.md examples</title>
<link rel="stylesheet" href="css/style.css" /> <link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="../css/editormd.css" /> <link rel="stylesheet" href="../css/editormd.css" />
<link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" />
@ -10,8 +10,8 @@
<body> <body>
<div id="layout"> <div id="layout">
<header> <header>
<h1>Code fold</h1>
<p>Switch code fold : Press Ctrl + Q / Command + Q</p>
<h1>Code folding</h1>
<p>Switch code folding : Press Ctrl + Q / Command + Q</p>
</header> </header>
<div id="test-editormd"> <div id="test-editormd">
<textarea style="display:none;"></textarea> <textarea style="display:none;"></textarea>

2
examples/custom-keyboard-shortcuts.html

@ -18,7 +18,7 @@
> If Editor.md code editor is on focus, you can use keyboard shortcuts. > If Editor.md code editor is on focus, you can use keyboard shortcuts.
> Editor.md have the default keyboard shortcuts handle. Plaese open the help dialog, can see all default keyboard shortcuts. > Editor.md have the default keyboard shortcuts handle. Plaese open the help dialog, can see all default keyboard shortcuts.
####Example
#### Example
```javascript ```javascript
var testEditor = editormd("test-editormd", { var testEditor = editormd("test-editormd", {

10
examples/define-plugin.html

@ -15,16 +15,16 @@
<div id="test-editormd"> <div id="test-editormd">
<textarea style="display:none;">[TOC] <textarea style="display:none;">[TOC]
###Define plugin
### Define plugin
####Plugin directory
#### Plugin directory
editor.md/ editor.md/
plugins/ plugins/
plugin-name/ plugin-name/
.... ....
####Example
#### Example
```javascript ```javascript
(function() { (function() {
@ -82,9 +82,7 @@
})(); })();
``` ```
####Usage plugin
The first method:
#### Usage plugin
```html ```html
&lt;script src="../plugins/you-plugin-name/you-plugin-name.js"&gt;&lt;/script&gt; &lt;script src="../plugins/you-plugin-name/you-plugin-name.js"&gt;&lt;/script&gt;

8
examples/dynamic-create-editormd.html

@ -2,7 +2,7 @@
<html lang="zh"> <html lang="zh">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title>动态创建Editor.md - Editor.md examples</title>
<title>动态创建 Editor.md - Editor.md examples</title>
<link rel="stylesheet" href="css/style.css" /> <link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="../css/editormd.css" /> <link rel="stylesheet" href="../css/editormd.css" />
<link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" />
@ -10,12 +10,12 @@
<body> <body>
<div id="layout"> <div id="layout">
<header> <header>
<h1>动态创建Editor.md</h1>
<h1>动态创建 Editor.md</h1>
<p>Dynamic create Editor.md</p> <p>Dynamic create Editor.md</p>
<br/> <br/>
<div class="btns" style="margin:0;"> <div class="btns" style="margin:0;">
<button id="create-btn">动态创建一个Editor.md</button>
<button id="remove-btn">移除Editor.md</button>
<button id="create-btn">动态创建一个 Editor.md</button>
<button id="remove-btn">移除 Editor.md</button>
</div> </div>
</header> </header>
</div> </div>

20
examples/emoji.html

@ -12,7 +12,7 @@
<body> <body>
<div id="layout"> <div id="layout">
<header> <header>
<h1>Emoji表情</h1>
<h1>Emoji 表情</h1>
<p>Supports:</p> <p>Supports:</p>
<ul style="margin: 10px 0 0 18px;"> <ul style="margin: 10px 0 0 18px;">
<li>Github emoji : <a href="http://www.emoji-cheat-sheet.com/" target="_blank">http://www.emoji-cheat-sheet.com/</a></li> <li>Github emoji : <a href="http://www.emoji-cheat-sheet.com/" target="_blank">http://www.emoji-cheat-sheet.com/</a></li>
@ -22,11 +22,11 @@
</ul> </ul>
</header> </header>
<div id="test-editormd"> <div id="test-editormd">
<textarea style="display:none;">###Emoji表情 :smiley:
<textarea style="display:none;">### Emoji 表情 :smiley:
[TOC] [TOC]
###Emoji
### Emoji
Emoji cheat sheet for Campfire and GitHub. Emoji cheat sheet for Campfire and GitHub.
@ -40,7 +40,7 @@ Emoji cheat sheet for Campfire and GitHub.
:heart: :smiley: :+1: :-1: :black_large_square: :heart: :smiley: :+1: :-1: :black_large_square:
###Twitter Emoji (Twemoji)
### Twitter Emoji (Twemoji)
**Usage:** **Usage:**
@ -52,7 +52,7 @@ Emoji cheat sheet for Campfire and GitHub.
[http://twitter.github.io/twemoji/preview.html](http://twitter.github.io/twemoji/preview.html) [http://twitter.github.io/twemoji/preview.html](http://twitter.github.io/twemoji/preview.html)
###Fortawesome icons
### Fortawesome icons
[http://fortawesome.github.io/Font-Awesome/icons/](http://fortawesome.github.io/Font-Awesome/icons/) [http://fortawesome.github.io/Font-Awesome/icons/](http://fortawesome.github.io/Font-Awesome/icons/)
@ -64,7 +64,7 @@ Emoji cheat sheet for Campfire and GitHub.
:fa-wifi: :fa-twitter: :fa-google-plus: :fa-git-square: :fa-github-alt: :fa-external-link-square: :fa-wifi: :fa-twitter: :fa-google-plus: :fa-git-square: :fa-github-alt: :fa-external-link-square:
###Editor.md logos
### Editor.md logos
**Usage:** **Usage:**
@ -77,7 +77,7 @@ Emoji cheat sheet for Campfire and GitHub.
: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: :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:
###Mixed tests
### Mixed tests
&gt; Blockquotes :star: &gt; Blockquotes :star:
@ -124,14 +124,14 @@ ___Emphasis :fa-gear: Italic:smiley:___ __Emphasis:smiley:__
2015-03-12 02:21:47 2015-03-12 02:21:47
###Table
### In table
|:100: First Header | Second:smiley: Header:smiley: | |:100: First Header | Second:smiley: Header:smiley: |
| ------------- | ------------- | | ------------- | ------------- |
| Content:fa-truck: Cell | :smiley:Content Cell :smiley: | | Content:fa-truck: Cell | :smiley:Content Cell :smiley: |
| Con:fa-truck:tent Cell:bangbang: | Content Cell dfsdfsdf :fa-star: :dfdf :fa-truck: | | Con:fa-truck:tent Cell:bangbang: | Content Cell dfsdfsdf :fa-star: :dfdf :fa-truck: |
###Editor.md logo emoji
### Editor.md logo emoji
:fa-heart:fasdfsdfsfddffd:editormd-logo: :editormd-logo: :editormd-logo-4x: :fa-heart:fasdfsdfsfddffd:editormd-logo: :editormd-logo: :editormd-logo-4x:
@ -143,7 +143,7 @@ This is an H1 :editormd-logo-4x: @pandao
@pandao This :fa-save:: :fa-truck:is an H2 :100: @pandao This :fa-save:: :fa-truck:is an H2 :100:
------------- -------------
###GFM task lists :editormd-logo-5x:
### GFM task lists :editormd-logo-5x:
- [x] :smiley: @mentions, :smiley: #refs, [links](), **formatting**, and <del>tags</del> supported :editormd-logo:; - [x] :smiley: @mentions, :smiley: #refs, [links](), **formatting**, and <del>tags</del> supported :editormd-logo:;
- [x] list syntax required (any unordered or ordered list supported) :editormd-logo-3x:; - [x] list syntax required (any unordered or ordered list supported) :editormd-logo-3x:;

22
examples/extends.html

@ -14,30 +14,30 @@
<p>Expanded of member methods and properties</p> <p>Expanded of member methods and properties</p>
</header> </header>
<div id="test-editormd"> <div id="test-editormd">
<textarea style="display:none;">###Expanded Editor.md
<textarea style="display:none;">### Expanded Editor.md
```javascript ```javascript
var testEditor; var testEditor;
function EditormdExtend() { function EditormdExtend() {
this.extends("methodC", function() {
this.extend("methodC", function() {
console.log("methodC"); console.log("methodC");
}); });
// or // or
testEditor.extends("methodA", function() {
testEditor.extend("methodA", function() {
console.log("methodA"); console.log("methodA");
}); });
// one by one setting // one by one setting
this.set("propertyA", "propertyA"); this.set("propertyA", "propertyA");
this.set("methodE", function(){
this.set("methodE", function() {
console.log("mothodE", this); console.log("mothodE", this);
}); });
// mutil // mutil
this.extends({
this.extend({
propertyA : "propertyAAAA", // override, you can override other default method. propertyA : "propertyAAAA", // override, you can override other default method.
propertyB : "propertyB", propertyB : "propertyB",
methodD : function() { methodD : function() {
@ -90,23 +90,23 @@ $(function() {
function EditormdExtend() { function EditormdExtend() {
this.extends("methodC", function() {
this.extend("methodC", function() {
console.log("methodC"); console.log("methodC");
}); });
// or // or
testEditor.extends("methodA", function() {
testEditor.extend("methodA", function() {
console.log("methodA"); console.log("methodA");
}); });
// one by one setting // one by one setting
this.set("propertyA", "propertyA"); this.set("propertyA", "propertyA");
this.set("methodE", function(){
this.set("methodE", function() {
console.log("mothodE", this); console.log("mothodE", this);
}); });
// mutil // mutil
this.extends({
this.extend({
propertyA : "propertyAAAA", // override, you can override other default method. propertyA : "propertyAAAA", // override, you can override other default method.
propertyB : "propertyB", propertyB : "propertyB",
methodD : function() { methodD : function() {
@ -127,12 +127,12 @@ $(function() {
console.log(this, this.propertyA); console.log(this, this.propertyA);
} }
editormd.fn.customMethod = function(){
editormd.fn.customMethod = function() {
console.log("customMethod", this); console.log("customMethod", this);
}; };
$(function() { $(function() {
editormd.methodOne = function(){
editormd.methodOne = function() {
console.log("editormd.methodOne"); console.log("editormd.methodOne");
}; };

2
examples/external-use.html

@ -26,7 +26,7 @@
<div id="test-editormd"> <div id="test-editormd">
<textarea style="display:none;">[TOC] <textarea style="display:none;">[TOC]
###External use of toolbar handlers / modal dialog
### External use of toolbar handlers / modal dialog
```javascript ```javascript
testEditor = editormd("test-editormd", { testEditor = editormd("test-editormd", {

19
examples/form-get-value.html

@ -15,15 +15,16 @@
</header> </header>
<form method="post" action="http://editormd.ipandao.com/php/post.php"> <form method="post" action="http://editormd.ipandao.com/php/post.php">
<div id="test-editormd"> <div id="test-editormd">
<!-- Custom textarea name attribute <textarea style="display:none;" name="test-textarea-name"> -->
<textarea style="display:none;">#### Get value <textarea style="display:none;">#### Get value
每个Editor.md的ID元素下都包含两个Textarea,一个保存Markdown源码,一个保存HTML源码,可以按需要获取相应的值,如下:
每个 Editor.md 的 ID 元素下都有一个保存 Markdown 源码的 Textarea,你也可以通过设置开启另一个保存 HTML 源码的 Textarea,可以按需要获取相应的值,如下:
```html ```html
&lt;div class="editormd" id="$id"&gt; &lt;div class="editormd" id="$id"&gt;
&lt;textarea class="editormd-markdown-textarea" name="$id-markdown-doc"&gt;&lt;/textarea&gt; &lt;textarea class="editormd-markdown-textarea" name="$id-markdown-doc"&gt;&lt;/textarea&gt;
&lt;!-- html textarea需要开启配置项 saveHTMLToTextarea == true --&gt;
&lt;!-- html textarea 需要开启配置项 saveHTMLToTextarea == true --&gt;
&lt;textarea class="editormd-html-textarea" name="$id-html-code"&gt;&lt;/textarea&gt; &lt;textarea class="editormd-html-textarea" name="$id-html-code"&gt;&lt;/textarea&gt;
&lt;/div&gt; &lt;/div&gt;
``` ```
@ -38,14 +39,14 @@ var testEditor = editormd("test-editormd", {
saveHTMLToTextarea : true saveHTMLToTextarea : true
}); });
testEditor.getMarkdown(); // 获取Markdown源码
testEditor.getHTML(); // 获取Textarea保存的HTML源码
testEditor.getPreviewedHTML(); // 获取预览窗口里的HTML,在开启watch且没有开启saveHTMLToTextarea时使用
testEditor.getMarkdown(); // 获取 Markdown 源码
testEditor.getHTML(); // 获取 Textarea 保存的 HTML 源码
testEditor.getPreviewedHTML(); // 获取预览窗口里的 HTML,在开启 watch 且没有开启 saveHTMLToTextarea 时使用
``` ```
#### Backend get form value #### Backend get form value
假设编辑器ID为`test-editormd`,以PHP为例:
假设编辑器 ID `test-editormd`,以 PHP 为例:
```php ```php
<?php <?php
@ -82,9 +83,9 @@ testEditor.getPreviewedHTML(); // 获取预览窗口里的HTML,在开启watch
}); });
}); });
//testEditor.getMarkdown(); // 获取Markdown源码
//testEditor.getHTML(); // 获取Textarea保存的HTML源码
//testEditor.getPreviewedHTML(); // 获取预览窗口里的HTML,在开启watch且没有开启saveHTMLToTextarea时使用
//testEditor.getMarkdown(); // 获取 Markdown 源码
//testEditor.getHTML(); // 获取 Textarea 保存的 HTML 源码
//testEditor.getPreviewedHTML(); // 获取预览窗口里的 HTML,在开启 watch 且没有开启 saveHTMLToTextarea 时使用
}); });
</script> </script>
</body> </body>

8
examples/full.html

@ -2,7 +2,7 @@
<html lang="zh"> <html lang="zh">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title>完整示例 Full example - Editor.md examples</title>
<title>Full example - Editor.md examples</title>
<link rel="stylesheet" href="css/style.css" /> <link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="../css/editormd.css" /> <link rel="stylesheet" href="../css/editormd.css" />
<link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" />
@ -51,12 +51,12 @@
markdown : md, markdown : md,
codeFold : true, codeFold : true,
//syncScrolling : false, //syncScrolling : false,
saveHTMLToTextarea : true, // 保存HTML到Textarea
saveHTMLToTextarea : true, // 保存 HTML Textarea
searchReplace : true, searchReplace : true,
//watch : false, // 关闭实时预览 //watch : false, // 关闭实时预览
htmlDecode : "style,script,iframe", // 开启HTML标签解析,为了安全性,默认不开启
htmlDecode : "style,script,iframe|on*", // 开启 HTML 标签解析,为了安全性,默认不开启
//toolbar : false, //关闭工具栏 //toolbar : false, //关闭工具栏
//previewCodeHighlight : false, // 关闭预览HTML的代码块高亮,默认开启
//previewCodeHighlight : false, // 关闭预览 HTML 的代码块高亮,默认开启
emoji : true, emoji : true,
taskList : true, taskList : true,
tocm : true, // Using [TOCM] tocm : true, // Using [TOCM]

22
examples/html-preview-markdown-to-html.html

@ -36,6 +36,8 @@ $$\(\sqrt{3x-1}+(1+x)^2\)$$
$$\sin(\alpha)^{\theta}=\sum_{i=0}^{n}(x^i + \cos(f))$$ $$\sin(\alpha)^{\theta}=\sum_{i=0}^{n}(x^i + \cos(f))$$
$$X^2 > Y$$
#####上标和下标 #####上标和下标
上标:X&lt;sup&gt;2&lt;/sup&gt; 上标:X&lt;sup&gt;2&lt;/sup&gt;
@ -79,13 +81,13 @@ alert("script");
<script src="../editormd.js"></script> <script src="../editormd.js"></script>
<script type="text/javascript"> <script type="text/javascript">
var testEditormdView, testEditormdView2;
$(function() { $(function() {
var testEditormdView, testEditormdView2;
$.get("test.md", function(markdown) { $.get("test.md", function(markdown) {
testEditormdView = editormd.markdownToHTML("test-editormd-view", { testEditormdView = editormd.markdownToHTML("test-editormd-view", {
markdown : markdown + "\r\n" + $("#append-test").val(),
//htmlDecode : true, // 开启HTML标签解析,为了安全性,默认不开启
markdown : markdown ,//+ "\r\n" + $("#append-test").text(),
//htmlDecode : true, // 开启 HTML 标签解析,为了安全性,默认不开启
htmlDecode : "style,script,iframe", // you can filter tags decode htmlDecode : "style,script,iframe", // you can filter tags decode
//toc : false, //toc : false,
tocm : true, // Using [TOCM] tocm : true, // Using [TOCM]
@ -93,15 +95,15 @@ alert("script");
//tocDropdown : true, //tocDropdown : true,
emoji : true, emoji : true,
taskList : true, taskList : true,
tex : true, // 默认不解析
flowChart : true, // 默认不解析
tex : true, // 默认不解析
flowChart : true, // 默认不解析
sequenceDiagram : true, // 默认不解析 sequenceDiagram : true, // 默认不解析
}); });
//console.log("返回一个jQuery实例 =>", testEditormdView);
//console.log("返回一个 jQuery 实例 =>", testEditormdView);
// 获取Markdown源码 // 获取Markdown源码
console.log(testEditormdView.getMarkdown());
//console.log(testEditormdView.getMarkdown());
//alert(testEditormdView.getMarkdown()); //alert(testEditormdView.getMarkdown());
}); });
@ -110,8 +112,8 @@ alert("script");
htmlDecode : "style,script,iframe", // you can filter tags decode htmlDecode : "style,script,iframe", // you can filter tags decode
emoji : true, emoji : true,
taskList : true, taskList : true,
tex : true, // 默认不解析
flowChart : true, // 默认不解析
tex : true, // 默认不解析
flowChart : true, // 默认不解析
sequenceDiagram : true, // 默认不解析 sequenceDiagram : true, // 默认不解析
}); });
}); });

22
examples/html-tags-decode.html

@ -2,7 +2,7 @@
<html lang="zh"> <html lang="zh">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title>识别和解析HTML标签 - Editor.md examples</title>
<title>识别和解析 HTML 标签 - Editor.md examples</title>
<link rel="stylesheet" href="css/style.css" /> <link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="../css/editormd.css" /> <link rel="stylesheet" href="../css/editormd.css" />
<link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" />
@ -12,8 +12,8 @@
<header> <header>
<h1>识别和解析HTML标签</h1> <h1>识别和解析HTML标签</h1>
<p>HTML tags (filter) decode, You can increase safety by filtering the danger label.</p> <p>HTML tags (filter) decode, You can increase safety by filtering the danger label.</p>
<p>注:虽然此功能能极大地扩展Markdown语法,但也面临着安全上的风险,所以默认是不开启的。</p>
<p>Update: 可以通过设置`settings.htmlDecode = "style,script,iframe"`来实现过滤指定标签的解析,提高安全性;</p>
<p>注:虽然此功能能极大地扩展 Markdown 语法,但也面临着安全上的风险,所以默认是不开启的。</p>
<p>Update: 可以通过设置 `settings.htmlDecode = "style,script,iframe|on*"`来实现过滤指定标签及属性的解析,提高安全性;</p>
</header> </header>
<div class="btns"> <div class="btns">
<button class="filter-btn" exp="true">Unfilter</button> <button class="filter-btn" exp="true">Unfilter</button>
@ -22,7 +22,7 @@
<button class="filter-btn" exp="style,script,iframe|onclick,title,onmouseover,onmouseout,style">Filter style,script,iframe|onclick,title,onmouseover,onmouseout,style</button> <button class="filter-btn" exp="style,script,iframe|onclick,title,onmouseover,onmouseout,style">Filter style,script,iframe|onclick,title,onmouseover,onmouseout,style</button>
</div> </div>
<div id="test-editormd"> <div id="test-editormd">
<textarea style="display:none;">####开启识别和解析HTML标签
<textarea style="display:none;">#### 开启识别和解析 HTML 标签
配置项: 配置项:
@ -34,15 +34,15 @@
//htmlDecode : "style,script,iframe,sub,sup,embed|onclick,title,onmouseover,onmouseout,style" // Filter tags, and your custom attributes //htmlDecode : "style,script,iframe,sub,sup,embed|onclick,title,onmouseover,onmouseout,style" // Filter tags, and your custom attributes
} }
####示例
#### 示例
#####上标和下标
##### 上标和下标
上标:X&lt;sup&gt;2&lt;/sup&gt; 上标:X&lt;sup&gt;2&lt;/sup&gt;
下标:O&lt;sub&gt;2&lt;/sub&gt; 下标:O&lt;sub&gt;2&lt;/sub&gt;
#####Style
##### Style
&lt;style&gt; &lt;style&gt;
body{background:red;} body{background:red;}
@ -52,7 +52,7 @@ body{background:red;}
body{background:red;} body{background:red;}
&lt;/style&gt; &lt;/style&gt;
#####Script
##### Script
&lt;script&gt; &lt;script&gt;
alert("script"); alert("script");
@ -62,16 +62,16 @@ alert("script");
alert("script"); alert("script");
&lt;/script&gt; &lt;/script&gt;
#####Events
##### Events
&lt;div style="color:green;" onclick="alert(1233);" title="div xxxxx"&gt;Events&lt;/div&gt; &lt;div style="color:green;" onclick="alert(1233);" title="div xxxxx"&gt;Events&lt;/div&gt;
&lt;div style="color:red;" contenteditable onclick="alert(1233);" onmouseover="alert(1233);" onmouseout="alert(1233);" title="div xxxxx"&gt;Events&lt;/div&gt; &lt;div style="color:red;" contenteditable onclick="alert(1233);" onmouseover="alert(1233);" onmouseout="alert(1233);" title="div xxxxx"&gt;Events&lt;/div&gt;
#####插入Flash
##### 插入Flash
&lt;embed src="http://player.youku.com/player.php/sid/XMzA0MzIwMDgw/v.swf" allowFullScreen="true" quality="high" width="480" height="400" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash"&gt;&lt;/embed&gt; &lt;embed src="http://player.youku.com/player.php/sid/XMzA0MzIwMDgw/v.swf" allowFullScreen="true" quality="high" width="480" height="400" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;
#####插入视频
##### 插入视频
李健《最好不相见》 李健《最好不相见》

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

@ -28,9 +28,9 @@
#### 跨域上传原理 #### 跨域上传原理
利用iframe来实现,A站POST到B站,B站处理上传后再跳转回到A站的callback页面,callback页面此时在iframe内(即同域下),再通过window.parent就可以操作父页面的任意元素了。
利用 iframe 来实现,A POST B 站,B 站处理上传后再跳转回到 A 站的 callback 页面,callback 页面此时在 iframe 内(即同域下),再通过 window.parent 就可以操作父页面的任意元素了。
#### 跨域上传示例PHP版
#### 跨域上传示例 PHP
当前域名:blog.xxx.com/post.php 当前域名:blog.xxx.com/post.php
@ -46,6 +46,8 @@
```php ```php
&lt;?php &lt;?php
header("Access-Control-Allow-Origin: *"); // Setting allow domian name
$file = 'uploads/' . $_FILES['file']['name']; $file = 'uploads/' . $_FILES['file']['name'];
// 详细过程略 // 详细过程略
move_uploaded_file($_FILES['file']['tmp_name'], $file); move_uploaded_file($_FILES['file']['tmp_name'], $file);
@ -92,9 +94,9 @@ exit;
uploadCallbackURL : "http://localhost/editor.md/examples/php/upload_callback.html?test=dfdf" uploadCallbackURL : "http://localhost/editor.md/examples/php/upload_callback.html?test=dfdf"
/* /*
跨域时,上传的图片服务器后台只需要返回一个跳转URL并跳转到原页面同域下的callback页面,结构如下:
跨域时,上传的图片服务器后台只需要返回一个跳转 URL 并跳转到原页面同域下的 callback 页面,结构如下:
{ {
success : 0 | 1, // 0表示上传失败,1表示上传成功
success : 0 | 1, // 0 表示上传失败,1 表示上传成功
message : "提示的信息,上传成功或上传失败及错误信息等。", message : "提示的信息,上传成功或上传失败及错误信息等。",
dialog_id : $_GET['dialog_id'], dialog_id : $_GET['dialog_id'],
url : "远程图片地址" // 上传成功时才返回 url : "远程图片地址" // 上传成功时才返回

12
examples/image-upload.html

@ -44,17 +44,17 @@
height: 640, height: 640,
markdown : "", markdown : "",
path : '../lib/', path : '../lib/',
//dialogLockScreen : false, // 设置弹出层对话框不锁屏,全局通用,默认为true
//dialogShowMask : false, // 设置弹出层对话框显示透明遮罩层,全局通用,默认为true
//dialogDraggable : false, // 设置弹出层对话框不可拖动,全局通用,默认为true
//dialogMaskOpacity : 0.4, // 设置透明遮罩层的透明度,全局通用,默认值为0.1
//dialogMaskBgColor : "#000", // 设置透明遮罩层的背景颜色,全局通用,默认为#fff
//dialogLockScreen : false, // 设置弹出层对话框不锁屏,全局通用,默认为 true
//dialogShowMask : false, // 设置弹出层对话框显示透明遮罩层,全局通用,默认为 true
//dialogDraggable : false, // 设置弹出层对话框不可拖动,全局通用,默认为 true
//dialogMaskOpacity : 0.4, // 设置透明遮罩层的透明度,全局通用,默认值为 0.1
//dialogMaskBgColor : "#000", // 设置透明遮罩层的背景颜色,全局通用,默认为 #fff
imageUpload : true, imageUpload : true,
imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp"], imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp"],
imageUploadURL : "./php/upload.php?test=dfdf", imageUploadURL : "./php/upload.php?test=dfdf",
/* /*
上传的后台只需要返回一个JSON数据,结构如下:
上传的后台只需要返回一个 JSON 数据,结构如下:
{ {
success : 0 | 1, // 0 表示上传失败,1 表示上传成功 success : 0 | 1, // 0 表示上传失败,1 表示上传成功
message : "提示的信息,上传成功或上传失败及错误信息等。", message : "提示的信息,上传成功或上传失败及错误信息等。",

26
examples/index.html

@ -146,19 +146,19 @@
<a href="./full.html">完整示例 <span>Full example</span></a> <a href="./full.html">完整示例 <span>Full example</span></a>
</li> </li>
<li> <li>
<a href="./use-requirejs.html">使用Require.js <span>Using Require.js</span></a>
<a href="./use-requirejs.html">使用 Require.js <span>Using Require.js</span></a>
</li> </li>
<li> <li>
<a href="./use-seajs.html">使用Sea.js <span>Using Seajs</span></a>
<a href="./use-seajs.html">使用 Sea.js <span>Using Seajs</span></a>
</li> </li>
<li> <li>
<a href="./use-zepto.html">使用Zepto.js <span>Using Zepto.js</span></a>
<a href="./use-zepto.html">使用 Zepto.js <span>Using Zepto.js</span></a>
</li> </li>
<li> <li>
<a href="./form-get-value.html">表单取值 <span>Get textarea value in form</span></a> <a href="./form-get-value.html">表单取值 <span>Get textarea value in form</span></a>
</li> </li>
<li> <li>
<a href="./html-preview-markdown-to-html.html">非编辑时Markdown转HTML的显示处理 <span>Markdown to HTML for preview</span></a>
<a href="./html-preview-markdown-to-html.html">非编辑时 Markdown HTML 的显示处理 <span>Markdown to HTML for preview</span></a>
</li> </li>
</ul> </ul>
<h1 class="category"> <h1 class="category">
@ -179,22 +179,22 @@
<a href="./toolbar-auto-fixed.html">工具栏自动固定定位的开启与禁用 <span>Enable / disable toolbar auto fixed position.</span></a> <a href="./toolbar-auto-fixed.html">工具栏自动固定定位的开启与禁用 <span>Enable / disable toolbar auto fixed position.</span></a>
</li> </li>
<li> <li>
<a href="./dynamic-create-editormd.html">动态创建Editor.md <span>Dynamic create Editor.md</span></a>
<a href="./dynamic-create-editormd.html">动态创建 Editor.md <span>Dynamic create Editor.md</span></a>
</li> </li>
<li> <li>
<a href="./delay-renderer-preview.html">延迟解析和预览 <span>Delay Rerender & Preview</span></a> <a href="./delay-renderer-preview.html">延迟解析和预览 <span>Delay Rerender & Preview</span></a>
</li> </li>
<li> <li>
<a href="./multi-editormd.html">多个Editor.md并存 <span>Multi Editor.md</span></a>
<a href="./multi-editormd.html">多个 Editor.md 并存 <span>Multi Editor.md</span></a>
</li> </li>
<li> <li>
<a href="./goto-line.html">跳转到指定的行 <span>Jump/goto line</span></a>
<a href="./goto-line.html">跳转到指定的行 <span>Goto line</span></a>
</li> </li>
<li> <li>
<a href="./readonly.html">只读模式 <span>Read only mode</span></a> <a href="./readonly.html">只读模式 <span>Read only mode</span></a>
</li> </li>
<li> <li>
<a href="./themes.html">自定义编辑器样式主题 <span>Setting/change editor style theme</span></a>
<a href="./themes.html">自定义编辑器样式主题 <span>Setting / change editor style theme</span></a>
</li> </li>
<li> <li>
<a href="./search-replace.html">搜索替换功能 <span>Search / Replace</span></a> <a href="./search-replace.html">搜索替换功能 <span>Search / Replace</span></a>
@ -221,7 +221,7 @@
<a href="./change-mode.html">变身为代码编辑器 <span>Change mode become to the code editor</span></a> <a href="./change-mode.html">变身为代码编辑器 <span>Change mode become to the code editor</span></a>
</li> </li>
<li> <li>
<a href="./set-get-replace-selection.html">插入字符/设置和获取光标位置/设置、获取和替换选中的文本 <span>Insert value & Set/Get cursor & Set/Get/Replace selection</span></a>
<a href="./set-get-replace-selection.html">插入字符 / 设置和获取光标位置 / 设置、获取和替换选中的文本 <span>Insert value & Set / Get cursor & Set / Get / Replace selection</span></a>
</li> </li>
<li> <li>
<a href="./extends.html">扩展成员方法和属性 <span>Expanded of member methods and properties</span></a> <a href="./extends.html">扩展成员方法和属性 <span>Expanded of member methods and properties</span></a>
@ -233,10 +233,10 @@
</h1> </h1>
<ul> <ul>
<li> <li>
<a href="./html-tags-decode.html">识别和(过滤)解析HTML标签 <span>HTML tags (fliter) decode</span></a>
<a href="./html-tags-decode.html">识别和(过滤)解析 HTML 标签 <span>HTML tags (fliter) decode</span></a>
</li> </li>
<li> <li>
<a href="./toc.html">自动生成目录(下拉菜单) ToC/ToCM <span>Table of Contents (ToC)</span></a>
<a href="./toc.html">自动生成目录(下拉菜单) ToC / ToCM <span>Table of Contents (ToC)</span></a>
</li> </li>
<li> <li>
<a href="./task-lists.html">GFM 任务列表 <span>Github Flavored Markdown (GFM) Task Lists</span></a> <a href="./task-lists.html">GFM 任务列表 <span>Github Flavored Markdown (GFM) Task Lists</span></a>
@ -248,13 +248,13 @@
<a href="./emoji.html">Emoji / Twemoji 表情 / Font Awesome 图标 <span>Emoji / Twemoji / Font Awesome icons</span></a> <a href="./emoji.html">Emoji / Twemoji 表情 / Font Awesome 图标 <span>Emoji / Twemoji / Font Awesome icons</span></a>
</li> </li>
<li> <li>
<a href="./katex.html">科学公式 TeX <span>TeX/LaTeX (Based on KaTeX)</span> </a>
<a href="./katex.html">科学公式 TeX <span>TeX / LaTeX (Based on KaTeX)</span> </a>
</li> </li>
<li> <li>
<a href="./flowchart.html">流程图 <span>FlowChart example</span></a> <a href="./flowchart.html">流程图 <span>FlowChart example</span></a>
</li> </li>
<li> <li>
<a href="./sequence-diagram.html">时序/序列图 <span>Sequence Diagram example</span></a>
<a href="./sequence-diagram.html">时序/ 序列图 <span>Sequence Diagram example</span></a>
</li> </li>
<li> <li>
<a href="./page-break.html">分页符 <span>Page break</span></a> <a href="./page-break.html">分页符 <span>Page break</span></a>

19
examples/katex.html

@ -2,7 +2,7 @@
<html lang="zh"> <html lang="zh">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title>Tex科学公式语言 (TeX/LaTeX) - Editor.md examples</title>
<title>Tex 科学公式语言 (TeX/LaTeX) - Editor.md examples</title>
<link rel="stylesheet" href="css/style.css" /> <link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="../css/editormd.css" /> <link rel="stylesheet" href="../css/editormd.css" />
<link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" />
@ -10,22 +10,22 @@
<body> <body>
<div id="layout"> <div id="layout">
<header> <header>
<h1>Tex科学公式语言 (TeX/LaTeX)</h1>
<h1>Tex 科学公式语言 (TeX/LaTeX)</h1>
<p>Based on KaTeX.js:<a href="http://khan.github.io/KaTeX/" target="_blank">http://khan.github.io/KaTeX/</a></p> <p>Based on KaTeX.js:<a href="http://khan.github.io/KaTeX/" target="_blank">http://khan.github.io/KaTeX/</a></p>
<p>P.S. Default using CloudFlare KaTeX's CDN. (注:默认使用CloudFlare的CDN,有时加载速度会比较慢,可自定义加载地址。)</p>
<p>P.S. Default using CloudFlare KaTeX's CDN. (注:默认使用 CloudFlare CDN,有时加载速度会比较慢,可自定义加载地址。)</p>
<br/> <br/>
<p><a href="https://jsperf.com/katex-vs-mathjax" target="_blank">KaTeX vs MathJax</a></p> <p><a href="https://jsperf.com/katex-vs-mathjax" target="_blank">KaTeX vs MathJax</a></p>
</header> </header>
<div id="test-editormd"> <div id="test-editormd">
<textarea style="display:none;">[TOC] <textarea style="display:none;">[TOC]
####Setting
#### Setting
{ {
tex : true tex : true
} }
####Custom KaTeX source URL
#### Custom KaTeX source URL
```javascript ```javascript
// Default using CloudFlare KaTeX's CDN // Default using CloudFlare KaTeX's CDN
@ -36,15 +36,15 @@ editormd.katexURL = {
}; };
``` ```
####Examples
#### Examples
$$E=mc^2$$ $$E=mc^2$$
Inline 行内的公式$$E=mc^2$$行内的公式,行内的$$E=mc^2$$公式。
Inline 行内的公式 $$E=mc^2$$ 行内的公式,行内的$$E=mc^2$$公式。
$$c = \\pm\\sqrt{a^2 + b^2}$$ $$c = \\pm\\sqrt{a^2 + b^2}$$
$$x > y$$
$$x &gt; y$$
$$f(x) = x^2$$ $$f(x) = x^2$$
@ -124,11 +124,10 @@ $$\int_C x^3\, dx + 4y^2\, dy$$
$${}_1^2\!\Omega_3^4$$ $${}_1^2\!\Omega_3^4$$
$$x', y'', f', f''$$
#### KaTeX vs MathJax #### KaTeX vs MathJax
[https://jsperf.com/katex-vs-mathjax](https://jsperf.com/katex-vs-mathjax "KaTeX vs MathJax") [https://jsperf.com/katex-vs-mathjax](https://jsperf.com/katex-vs-mathjax "KaTeX vs MathJax")
</textarea> </textarea>
</div> </div>
</div> </div>

5
examples/manually-load-modules.html

@ -2,14 +2,15 @@
<html lang="zh"> <html lang="zh">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title>Manually load-modules - Editor.md examples</title>
<title>Manually load modules - Editor.md examples</title>
<link rel="stylesheet" href="css/style.css" /> <link rel="stylesheet" href="css/style.css" />
<link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" />
</head> </head>
<body> <body>
<div id="layout"> <div id="layout">
<header> <header>
<h1>Manually load-modules</h1>
<h1>手动加载模式 Manually load modules</h1>
<p>在这种模式下,可以同步使用 Editor.md 实例的成员方法。</p>
</header> </header>
<div id="test-editormd"> <div id="test-editormd">
<textarea style="display:none;">#### Manually load modules exmaple <textarea style="display:none;">#### Manually load modules exmaple

19
examples/multi-editormd.html

@ -2,7 +2,7 @@
<html lang="zh"> <html lang="zh">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title>多个Editor.md并存 - Editor.md examples</title>
<title>Multi Editor.md - Editor.md examples</title>
<link rel="stylesheet" href="css/style.css" /> <link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="../css/editormd.css" /> <link rel="stylesheet" href="../css/editormd.css" />
<link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" />
@ -20,14 +20,16 @@
<body> <body>
<div id="layout"> <div id="layout">
<header> <header>
<h1>多个Editor.md并存</h1>
<p>Multi Editor.md</p>
<h1>Multi Editor.md</h1>
<p>多个 Editor.md 并存</p>
<br/> <br/>
</header> </header>
<h3>Editor.md A</h3> <h3>Editor.md A</h3>
<div id="test-editormd"></div> <div id="test-editormd"></div>
<h3>Editor.md B</h3> <h3>Editor.md B</h3>
<div id="test-editormd2"></div> <div id="test-editormd2"></div>
<h3>Editor.md C</h3>
<div id="test-editormd3"></div>
</div> </div>
<script src="js/jquery.min.js"></script> <script src="js/jquery.min.js"></script>
@ -39,14 +41,21 @@
testEditormd = editormd("test-editormd", { testEditormd = editormd("test-editormd", {
width: "90%", width: "90%",
height: 480, height: 480,
markdown : "####Editor.md A",
markdown : "#### Editor.md A",
path : '../lib/' path : '../lib/'
}); });
testEditormd2 = editormd("test-editormd2", { testEditormd2 = editormd("test-editormd2", {
width: "90%", width: "90%",
height: 480, height: 480,
markdown : "####Editor.md B",
markdown : "#### Editor.md B",
path : '../lib/'
});
testEditormd3 = editormd("test-editormd3", {
width: "90%",
height: 480,
markdown : "#### Editor.md C",
path : '../lib/' path : '../lib/'
}); });
}); });

14
examples/php/cross-domain-upload.php

@ -23,16 +23,12 @@
$savePath = realpath($path . '../uploads/') . DIRECTORY_SEPARATOR; $savePath = realpath($path . '../uploads/') . DIRECTORY_SEPARATOR;
$saveURL = '//'. $_SERVER['SERVER_NAME'] . $url . '../uploads/'; // 本例是演示跨域上传所以加上$_SERVER['SERVER_NAME'] $saveURL = '//'. $_SERVER['SERVER_NAME'] . $url . '../uploads/'; // 本例是演示跨域上传所以加上$_SERVER['SERVER_NAME']
/*echo "<pre>";
print_r($_SERVER);
echo $saveURL;
echo "</pre>";*/
$formats = array( $formats = array(
'image' => array('gif', 'jpg', 'jpeg', 'png', 'bmp', 'webp') 'image' => array('gif', 'jpg', 'jpeg', 'png', 'bmp', 'webp')
); );
$name = 'editormd-image-file'; // file input name
$name = 'editormd-image-file'; // file input name
$callbackUrl = $_GET['callback'];
if (isset($_FILES[$name])) if (isset($_FILES[$name]))
{ {
@ -44,11 +40,15 @@
)); ));
$imageUploader->redirect = true; $imageUploader->redirect = true;
$imageUploader->redirectURL = $_GET['callback'] . '?dialog_id=' . $_GET['dialog_id'] . '&temp=' . date('ymdhis');
$imageUploader->redirectURL = $callbackUrl . (empty(parse_url($callbackUrl)['query']) ? '?' : '&') . 'dialog_id=' . $_GET['dialog_id'] . '&temp=' . date('ymdhis');
if ($imageUploader->upload($name)) if ($imageUploader->upload($name))
{ {
$imageUploader->message('上传成功!', 1); $imageUploader->message('上传成功!', 1);
} }
else
{
$imageUploader->message('上传失败!', 0);
}
} }
?> ?>

24
examples/php/editormd.uploader.class.php

@ -8,7 +8,7 @@
* @Auther: Pandao * @Auther: Pandao
* @E-mail: pandao@vip.qq.com * @E-mail: pandao@vip.qq.com
* @CreateTime: 2015-02-13 23:31:32 * @CreateTime: 2015-02-13 23:31:32
* @UpdateTime: 2015-02-15 20:49:52
* @UpdateTime: 2015-06-02 15:36:23
* Copyright@2015 Editor.md all right reserved. * Copyright@2015 Editor.md all right reserved.
*/ */
@ -91,18 +91,24 @@
if(empty($_FILES[$name]['name'])) //上传文件为空时 if(empty($_FILES[$name]['name'])) //上传文件为空时
{ {
$this->message($this->errors['empty']); $this->message($this->errors['empty']);
return false;
} }
$this->files = $_FILES[$name]; $this->files = $_FILES[$name];
if(!file_exists($this->savePath)) //目录不存在 if(!file_exists($this->savePath)) //目录不存在
{ {
$this->message($this->errors['not_exist']);
$this->message($this->errors['not_exist']);
return false;
} }
if(!is_writable($this->savePath)) //目录不可写 if(!is_writable($this->savePath)) //目录不可写
{ {
$this->message($this->errors['unwritable']);
$this->message($this->errors['unwritable']);
return false;
} }
$this->fileExt = $this->getFileExt($this->files["name"]); //取得扩展名 $this->fileExt = $this->getFileExt($this->files["name"]); //取得扩展名
@ -128,19 +134,25 @@
$formats = implode(',', $this->formats); $formats = implode(',', $this->formats);
$message = "您上传的文件" . $files["name"] . "是" . $this->fileExt . "格式的,系统不允许上传,您只能上传" . $formats . "格式的文件。"; $message = "您上传的文件" . $files["name"] . "是" . $this->fileExt . "格式的,系统不允许上传,您只能上传" . $formats . "格式的文件。";
$this->message($message); $this->message($message);
return false;
} }
if ($files["size"] / 1024 > $this->maxSize) if ($files["size"] / 1024 > $this->maxSize)
{ {
$message = "您上传的 " . $files["name"] . ",文件大小超出了系统限定值" . $this->maxSize . " KB,不能上传。"; $message = "您上传的 " . $files["name"] . ",文件大小超出了系统限定值" . $this->maxSize . " KB,不能上传。";
$this->message($message); $this->message($message);
return false;
} }
if (!$this->cover) //当不能覆盖时 if (!$this->cover) //当不能覆盖时
{ {
if(file_exists($this->savePath.$this->saveName)) //有相同的文件存在 if(file_exists($this->savePath.$this->saveName)) //有相同的文件存在
{ {
$this->message($this->saveName . $this->errors['same_file']);
$this->message($this->saveName . $this->errors['same_file']);
return false;
} }
} }
@ -187,6 +199,8 @@
} }
$this->message($message); $this->message($message);
return false;
} }
@unlink($files["tmp_name"]); //删除临时文件 @unlink($files["tmp_name"]); //删除临时文件
@ -323,7 +337,5 @@
echo json_encode($array); echo json_encode($array);
} }
exit;
} }
} }

7
examples/php/upload.php

@ -11,7 +11,8 @@
* Copyright@2015 Editor.md all right reserved. * Copyright@2015 Editor.md all right reserved.
*/ */
header("Content-Type:application/json; charset=utf-8");
//header("Content-Type:application/json; charset=utf-8"); // Unsupport IE
header("Content-Type:text/html; charset=utf-8");
header("Access-Control-Allow-Origin: *"); header("Access-Control-Allow-Origin: *");
require("editormd.uploader.class.php"); require("editormd.uploader.class.php");
@ -42,5 +43,9 @@
{ {
$imageUploader->message('上传成功!', 1); $imageUploader->message('上传成功!', 1);
} }
else
{
$imageUploader->message('上传失败!', 0);
}
} }
?> ?>

3
examples/php/upload_callback.html

@ -19,9 +19,8 @@
} }
var imageDialog = window.parent.document.getElementById(query['dialog_id']); var imageDialog = window.parent.document.getElementById(query['dialog_id']);
//console.log(imageDialog, window.parent.document, window.parent, query);
if (query['success'] === '1')
if (parseInt(query['success']) === 1)
{ {
imageDialog.querySelector("[data-url]").value = query['url']; imageDialog.querySelector("[data-url]").value = query['url'];
} }

4
examples/resettings.html

@ -44,7 +44,7 @@ this.config({
toolbar : true toolbar : true
}); });
this.config("onresize", function(){
this.config("onresize", function() {
console.log("onresize =&gt;", this); console.log("onresize =&gt;", this);
}); });
```</textarea></div> ```</textarea></div>
@ -90,7 +90,7 @@ this.config("onresize", function(){
dialogMaskBgColor : "#000" dialogMaskBgColor : "#000"
}); });
this.config("onresize", function(){
this.config("onresize", function() {
console.log("onresize =>", this); console.log("onresize =>", this);
}); });

4
examples/sequence-diagram.html

@ -14,9 +14,7 @@
<p>Based on SequenceDiagram.js:<a href="http://bramp.github.io/js-sequence-diagrams/" target="_blank">http://bramp.github.io/js-sequence-diagrams/</a></p> <p>Based on SequenceDiagram.js:<a href="http://bramp.github.io/js-sequence-diagrams/" target="_blank">http://bramp.github.io/js-sequence-diagrams/</a></p>
</header> </header>
<div id="test-editormd"> <div id="test-editormd">
<textarea style="display:none;">####Using SequenceDiagram
setting:
<textarea style="display:none;">#### Setting
{ {
sequenceDiagram : true sequenceDiagram : true

18
examples/set-get-replace-selection.html

@ -2,7 +2,7 @@
<html lang="zh"> <html lang="zh">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title>插入字符/设置和获取光标位置/设置、获取和替换选中的文本 - Editor.md examples</title>
<title>插入字符 / 设置和获取光标位置 / 设置、获取和替换选中的文本 - Editor.md examples</title>
<link rel="stylesheet" href="css/style.css" /> <link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="../css/editormd.css" /> <link rel="stylesheet" href="../css/editormd.css" />
<link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" />
@ -10,20 +10,22 @@
<body> <body>
<div id="layout"> <div id="layout">
<header> <header>
<h1>插入字符/设置和获取光标位置/设置、获取和替换选中的文本</h1>
<p>Insert value & Set/Get cursor & Set/Get/Replace selection</p>
<h1>插入字符 / 设置和获取光标位置 / 设置、获取和替换选中的文本</h1>
<p>Insert value & Set / Get cursor & Set / Get / Replace selection</p>
<br/> <br/>
<div class="btns" style="margin:0"> <div class="btns" style="margin:0">
<button id="btn1">设置光标位置(line:1, ch:2)</button>
<button id="btn1">设置光标位置 (line:1, ch:2)</button>
<button id="btn2">获取光标位置</button> <button id="btn2">获取光标位置</button>
<button id="btn3">设置选中文本({line:1, ch:0}, {line:5, ch:100})</button>
<button id="btn3">设置选中文本 ({line:1, ch:0}, {line:5, ch:100})</button>
<button id="btn4">获取选中文本</button> <button id="btn4">获取选中文本</button>
<button id="btn5">替换选中文本为"$$$$$$$$$"</button>
<button id="btn6">在光标处插入"????"</button>
<button id="btn5">替换选中文本为 "$$$$$$$$$"</button>
<button id="btn6">在光标处插入 "????"</button>
</div> </div>
</header> </header>
<div id="test-editormd"> <div id="test-editormd">
<textarea style="display:none;">```javascript
<textarea style="display:none;">### Examples
```javascript
var testEditormd; var testEditormd;
$(function() { $(function() {

14
examples/task-lists.html

@ -13,13 +13,19 @@
<h1>Github Flavored Markdown task lists</h1> <h1>Github Flavored Markdown task lists</h1>
</header> </header>
<div id="test-editormd"> <div id="test-editormd">
<textarea style="display:none;">###GFM task lists
<textarea style="display:none;">### Setting
{
taskList : true
}
### Examples
- [x] @mentions, #refs, [links](), **formatting**, and <del>tags</del> supported; - [x] @mentions, #refs, [links](), **formatting**, and <del>tags</del> supported;
- [x] list syntax required (any unordered or ordered list supported); - [x] list syntax required (any unordered or ordered list supported);
- [x] [ ] this is a complete item;
- [ ] []this is an incomplete item [test link](#);
- [ ] [ ]this is an incomplete item;
- [x] this is a complete item;
- [ ] this is an incomplete item [test link](#);
- [ ] this is an incomplete item;
- [ ] this is an incomplete item [test link](#); - [ ] this is an incomplete item [test link](#);
- [ ] this is an incomplete item [test link](#); - [ ] this is an incomplete item [test link](#);

2
examples/test.md

@ -291,6 +291,8 @@ $$E=mc^2$$
行内的公式$$E=mc^2$$行内的公式,行内的$$E=mc^2$$公式。 行内的公式$$E=mc^2$$行内的公式,行内的$$E=mc^2$$公式。
$$x > y$$
$$\(\sqrt{3x-1}+(1+x)^2\)$$ $$\(\sqrt{3x-1}+(1+x)^2\)$$
$$\sin(\alpha)^{\theta}=\sum_{i=0}^{n}(x^i + \cos(f))$$ $$\sin(\alpha)^{\theta}=\sum_{i=0}^{n}(x^i + \cos(f))$$

10
examples/themes.html

@ -18,9 +18,9 @@
</p> </p>
</header> </header>
<div id="test-editormd"> <div id="test-editormd">
<textarea style="display:none;">###Themes
<textarea style="display:none;">### Themes
####Setting
#### Setting
```javascript ```javascript
testEditor = editormd("test-editormd", { testEditor = editormd("test-editormd", {
@ -29,11 +29,11 @@ testEditor = editormd("test-editormd", {
}); });
``` ```
####Default theme
#### Default theme
- default - default
####Recommends
#### Recommends
- ambiance - ambiance
- eclipse - eclipse
@ -43,7 +43,7 @@ testEditor = editormd("test-editormd", {
- neat - neat
- pastel-on-dark - pastel-on-dark
####Optional
#### Optionals
- default - default
- 3024-day - 3024-day

49
examples/toc.html

@ -6,8 +6,7 @@
<link rel="stylesheet" href="css/style.css" /> <link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="../css/editormd.css" /> <link rel="stylesheet" href="../css/editormd.css" />
<link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" />
<style>
<style>
#custom-toc-container { #custom-toc-container {
border: 1px solid #ddd; border: 1px solid #ddd;
width: 87%; width: 87%;
@ -23,7 +22,7 @@
<body> <body>
<div id="layout"> <div id="layout">
<header> <header>
<h1>TOC(Table of Contents) example</h1>
<h1>TOC (Table of Contents) example</h1>
</header> </header>
<div class="btns"> <div class="btns">
<button id="insert-btn">ToC insert to custom container</button> <button id="insert-btn">ToC insert to custom container</button>
@ -34,7 +33,7 @@
</div> </div>
<div class="markdown-body editormd-preview-container" id="custom-toc-container">#custom-toc-container</div> <div class="markdown-body editormd-preview-container" id="custom-toc-container">#custom-toc-container</div>
<div id="test-editormd"> <div id="test-editormd">
<textarea style="display:none;">#支撑起整个互联网时代的 7 款开源软件
<textarea style="display:none;"># 支撑起整个互联网时代的 7 款开源软件
[TOCM] [TOCM]
@ -42,11 +41,11 @@
开源软件现在成为整个互联网时代的支撑技术,你可能已经无法离开由开源软件构建起来的网络世界了。下面我们就来看看一些最重要的开源技术。 开源软件现在成为整个互联网时代的支撑技术,你可能已经无法离开由开源软件构建起来的网络世界了。下面我们就来看看一些最重要的开源技术。
###为互联网而生的操作系统linux
### 为互联网而生的操作系统linux
Linux是一款免费的操作系统,诞生于1991年,用户可以通过网络或其他途径免费获得,并可以任意修改其源代码。 Linux是一款免费的操作系统,诞生于1991年,用户可以通过网络或其他途径免费获得,并可以任意修改其源代码。
####linux A
#### linux A
它能运行主要的UNIX工具软件、应用程序和网络协议。它支持32位和64位硬件。Linux继承了Unix以网络为核心的设计思想,是一个性能稳 定的多用户网络操作系统。这个系统是由全世界各地的成千上万的程序员设计和实现的。其目的是建立不受任何商品化软件的版权制约的、全世界都能自由使用的 Unix兼容产品。 它能运行主要的UNIX工具软件、应用程序和网络协议。它支持32位和64位硬件。Linux继承了Unix以网络为核心的设计思想,是一个性能稳 定的多用户网络操作系统。这个系统是由全世界各地的成千上万的程序员设计和实现的。其目的是建立不受任何商品化软件的版权制约的、全世界都能自由使用的 Unix兼容产品。
@ -54,17 +53,17 @@ Linux是一款免费的操作系统,诞生于1991年,用户可以通过网
#### Test link heading [linux B](https://github.com/pandao/editor.md) Test link heading [linux B](https://github.com/pandao/editor.md) Test link heading, Test link heading, [linux B](https://github.com/pandao/editor.md) Test link heading #### Test link heading [linux B](https://github.com/pandao/editor.md) Test link heading [linux B](https://github.com/pandao/editor.md) Test link heading, Test link heading, [linux B](https://github.com/pandao/editor.md) Test link heading
#####linux B-1
##### linux B-1
######linux B-1-1
###### linux B-1-1
######linux B-1-2
###### linux B-1-2
#####linux B-2
##### linux B-2
######linux B-2-1
###### linux B-2-1
######linux B-2-2
###### linux B-2-2
#支撑起整个互联网时代的 7 款开源软件-2 #支撑起整个互联网时代的 7 款开源软件-2
@ -78,7 +77,7 @@ OpenSSL是套开放源代码的软件库包,实现了SSL与TLS协议。OpenSSL
去年OpenSSL爆出安全漏洞,因为其应用如此之广,该漏洞爆出让整个互联网都为之震颤。 去年OpenSSL爆出安全漏洞,因为其应用如此之广,该漏洞爆出让整个互联网都为之震颤。
###互联网的记忆——MySQL
### 互联网的记忆——MySQL
MySQL是一个开源的小型的数据库管理系统,原开发者为瑞典的MySQL AB公司,该公司于2008年被Sun公司收购。2009年,甲骨文公司(Oracle)收购Sun公司,MySQL成为Oracle旗下产品。 MySQL是一个开源的小型的数据库管理系统,原开发者为瑞典的MySQL AB公司,该公司于2008年被Sun公司收购。2009年,甲骨文公司(Oracle)收购Sun公司,MySQL成为Oracle旗下产品。
@ -86,7 +85,7 @@ MySQL是一个开源的小型的数据库管理系统,原开发者为瑞典的
Mysql最初为小型应用而开发,但现在的Mysql已经不是一个小型数据库了。基本上所有的互联网公司都会使用这个数据库系统,一些金融交易也会 采用Mysql作为数据库引擎。Mysql通过相应的调优既可以支撑大规模的访问,又可以保证数据安全性,已经成为威胁传统商业数据库系统的重要力量。 Mysql最初为小型应用而开发,但现在的Mysql已经不是一个小型数据库了。基本上所有的互联网公司都会使用这个数据库系统,一些金融交易也会 采用Mysql作为数据库引擎。Mysql通过相应的调优既可以支撑大规模的访问,又可以保证数据安全性,已经成为威胁传统商业数据库系统的重要力量。
###万能开发工具Eclipse
### 万能开发工具Eclipse
Eclipse 是一个开放源代码的、基于Java的可扩展开发平台。Eclipse最初由OTI和IBM两家公司的IDE产品开发组创建,起始于1999年4月。目前由 IBM牵头,围绕着Eclipse项目已经发展成为了一个庞大的Eclipse联盟,有150多家软件公司参与到Eclipse项目中,其中包括 Borland、Rational Software、Red Hat及Sybase等。 Eclipse 是一个开放源代码的、基于Java的可扩展开发平台。Eclipse最初由OTI和IBM两家公司的IDE产品开发组创建,起始于1999年4月。目前由 IBM牵头,围绕着Eclipse项目已经发展成为了一个庞大的Eclipse联盟,有150多家软件公司参与到Eclipse项目中,其中包括 Borland、Rational Software、Red Hat及Sybase等。
@ -94,7 +93,7 @@ Eclipse 是一个开放源代码的、基于Java的可扩展开发平台。Eclip
Eclipse并不是一个直接服务于消费者的产品,它更像一个工匠手中万用工具,用Eclipse开发者可以打造出各种充满创造性的服务来满足最终用户的需求。 Eclipse并不是一个直接服务于消费者的产品,它更像一个工匠手中万用工具,用Eclipse开发者可以打造出各种充满创造性的服务来满足最终用户的需求。
###互联网的门卫Apache
### 互联网的门卫Apache
Apache HTTP Server(简称Apache)是Apache软件基金会的一个开放源码的网页服务器,可以在大多数计算机操作系统中运行,由于其多平台和安全性被广泛 使用,也是最流行的Web服务器端软件之一,市场占有率达60%左右。它快速、可靠并且可通过简单的API扩展,它可以和各种解释器配合使用,包括 PHP/Perl/Python等。 Apache HTTP Server(简称Apache)是Apache软件基金会的一个开放源码的网页服务器,可以在大多数计算机操作系统中运行,由于其多平台和安全性被广泛 使用,也是最流行的Web服务器端软件之一,市场占有率达60%左右。它快速、可靠并且可通过简单的API扩展,它可以和各种解释器配合使用,包括 PHP/Perl/Python等。
@ -111,27 +110,27 @@ Hadoop 是一个能够对大量数据进行分布式处理的软件框架,由A
#### Test link heading [linux B](https://github.com/pandao/editor.md) Test link heading [linux B](https://github.com/pandao/editor.md) Test link heading, Test link heading, [linux B](https://github.com/pandao/editor.md) Test link heading #### Test link heading [linux B](https://github.com/pandao/editor.md) Test link heading [linux B](https://github.com/pandao/editor.md) Test link heading, Test link heading, [linux B](https://github.com/pandao/editor.md) Test link heading
#####linux B-1
##### linux B-1
######linux B-1-1
###### linux B-1-1
######linux B-1-2
###### linux B-1-2
#####linux B-2
##### linux B-2
######linux B-2-1
###### linux B-2-1
######linux B-2-2
###### linux B-2-2
###互联网的“排版引擎”WebKit
### 互联网的“排版引擎”WebKit
说是浏览器内核,其实“排版引擎”更容易理解一些。通过服务器传输给浏览器的信息只是一串乱糟糟的文本。要看到我们平时看到精美的网友,需要浏览器内核对这些文本进行解析,将枯燥的描述“画”成美丽的浏览界面。 说是浏览器内核,其实“排版引擎”更容易理解一些。通过服务器传输给浏览器的信息只是一串乱糟糟的文本。要看到我们平时看到精美的网友,需要浏览器内核对这些文本进行解析,将枯燥的描述“画”成美丽的浏览界面。
WebKit 是一个开源的浏览器引擎,与之相应的引擎有Gecko(Mozilla Firefox 等使用的排版引擎)和Trident(也称为MSHTML,IE 使用的排版引擎)。根据StatCounter的浏览器市场份额调查,于2012年11月,Webkit市占超过了40%,它已经成为拥有最大市场份额的 排版引擎,超越了Internet Explorer所使用的Trident及Firefox所使用的Gecko引擎,并且WebKit份额正在逐年增加。
WebKit 是一个开源的浏览器引擎,与之相应的引擎有 Gecko(Mozilla Firefox 等使用的排版引擎)和 Trident(也称为 MSHTML,IE 使用的排版引擎)。根据 StatCounter 的浏览器市场份额调查,于2012年11月,Webkit 市占超过了 40%,它已经成为拥有最大市场份额的 排版引擎,超越了 Internet Explorer 所使用的Trident Firefox 所使用的 Gecko 引擎,并且 WebKit 份额正在逐年增加。
目前几乎所有网站和网银已经逐渐支持WebKit。WebKit 内核在手机上的应用也十分广泛,例如苹果的Safari、谷歌的Chrome浏览器都是基于这个框架来开发的。
目前几乎所有网站和网银已经逐渐支持 WebKit 。WebKit 内核在手机上的应用也十分广泛,例如苹果的 Safari 、谷歌的 Chrome 浏览器都是基于这个框架来开发的。
###小结
### 小结
很多人可能尚未意识到,我们使用的电脑中运行有开源软件,手机中运行有开源软件,家里的电视也运行有开源软件,甚至小小的数码产品中也运行有开源软件,尤其是互联网服务器端软件,几乎全部是开源软件。毫不夸张地说,开源软件已经渗透到了我们日常生活的方方面面。 很多人可能尚未意识到,我们使用的电脑中运行有开源软件,手机中运行有开源软件,家里的电视也运行有开源软件,甚至小小的数码产品中也运行有开源软件,尤其是互联网服务器端软件,几乎全部是开源软件。毫不夸张地说,开源软件已经渗透到了我们日常生活的方方面面。

4
examples/toolbar-auto-fixed.html

@ -2,7 +2,7 @@
<html lang="zh"> <html lang="zh">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title>Simple - Editor.md examples</title>
<title>Toolbar auto fixed - Editor.md examples</title>
<link rel="stylesheet" href="css/style.css" /> <link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="../css/editormd.css" /> <link rel="stylesheet" href="../css/editormd.css" />
<link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" />
@ -18,7 +18,7 @@
<button id="disable-btn">Disable</button> <button id="disable-btn">Disable</button>
</div> </div>
<div id="test-editormd"> <div id="test-editormd">
<textarea style="display:none;">###Hello world!
<textarea style="display:none;">### Hello world!
codemirror codemirror
In-browser code editor In-browser code editor

6
examples/use-requirejs.html

@ -2,7 +2,7 @@
<html lang="zh"> <html lang="zh">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title>Use require.js - Editor.md examples</title>
<title>Using require.js - Editor.md examples</title>
<link rel="stylesheet" href="css/style.css" /> <link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="../lib/codemirror/codemirror.min.css" /> <link rel="stylesheet" href="../lib/codemirror/codemirror.min.css" />
<!-- <link rel="stylesheet" href="../lib/codemirror/addon/fold/foldgutter.css" /> --> <!-- <link rel="stylesheet" href="../lib/codemirror/addon/fold/foldgutter.css" /> -->
@ -12,7 +12,7 @@
<body> <body>
<div id="layout"> <div id="layout">
<header> <header>
<h1>Use require.js</h1>
<h1>Using require.js</h1>
<ul style="margin: 10px 0 0 18px;"> <ul style="margin: 10px 0 0 18px;">
<li>Enable HTML tags decode</li> <li>Enable HTML tags decode</li>
<li>Enable TeX, Flowchart, Sequence Diagram, Emoji, FontAwesome, Task lists</li> <li>Enable TeX, Flowchart, Sequence Diagram, Emoji, FontAwesome, Task lists</li>
@ -87,7 +87,7 @@
codeFold : true, codeFold : true,
searchReplace : true, searchReplace : true,
saveHTMLToTextarea : true, // 保存HTML到Textarea saveHTMLToTextarea : true, // 保存HTML到Textarea
htmlDecode : "style,script,iframe", // 开启HTML标签解析,为了安全性,默认不开启
htmlDecode : "style,script,iframe|on*", // 开启HTML标签解析,为了安全性,默认不开启
emoji : true, emoji : true,
taskList : true, taskList : true,
tex : true, tex : true,

28
examples/use-seajs.html

@ -2,7 +2,7 @@
<html lang="zh"> <html lang="zh">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title>Use sea.js - Editor.md examples</title>
<title>Using sea.js - Editor.md examples</title>
<link rel="stylesheet" href="css/style.css" /> <link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="../css/editormd.min.css" /> <link rel="stylesheet" href="../css/editormd.min.css" />
<link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" />
@ -20,7 +20,7 @@
<body> <body>
<div id="layout"> <div id="layout">
<header> <header>
<h1>Use sea.js</h1>
<h1>Using sea.js</h1>
<p>说明:</p> <p>说明:</p>
<p>1、由于Editor.md是依赖jQuery的,所以在使用Sea.js加载Editor.md时,要在jQuery.js文件尾部加上 <code>if(typeof define === "function") { define(function () { return $.noConflict(); }); }</code>,使jQuery支持Sea.js;</p> <p>1、由于Editor.md是依赖jQuery的,所以在使用Sea.js加载Editor.md时,要在jQuery.js文件尾部加上 <code>if(typeof define === "function") { define(function () { return $.noConflict(); }); }</code>,使jQuery支持Sea.js;</p>
<p>2、flowChart(流程图)和sequenceDiagram(时序图)基于Raphael.js,由于疑似Sea.js与Raphael.js有冲突,所以必须先加载Raphael.js再加载Sea.js,Editor.md才能在Sea.js下正常进行;</p> <p>2、flowChart(流程图)和sequenceDiagram(时序图)基于Raphael.js,由于疑似Sea.js与Raphael.js有冲突,所以必须先加载Raphael.js再加载Sea.js,Editor.md才能在Sea.js下正常进行;</p>
@ -86,23 +86,23 @@
height: 640, height: 640,
path : '../lib/', path : '../lib/',
markdown : md, markdown : md,
//toolbar : false, //关闭工具栏
//toolbar : false, // 关闭工具栏
codeFold : true, codeFold : true,
searchReplace : true, searchReplace : true,
saveHTMLToTextarea : true, // 保存HTML到Textarea
htmlDecode : "style,script,iframe", // 开启HTML标签解析,为了安全性,默认不开启
saveHTMLToTextarea : true, // 保存 HTML Textarea
htmlDecode : "style,script,iframe|on*", // 开启 HTML 标签解析,为了安全性,默认不开启
emoji : true, emoji : true,
taskList : true, taskList : true,
tocm : true, // Using [TOCM]
tex : true, // 开启科学公式TeX语言支持,默认关闭
tocm : true, // Using [TOCM]
tex : true, // 开启科学公式 TeX 语言支持,默认关闭
//previewCodeHighlight : false, // 关闭预览窗口的代码高亮,默认开启 //previewCodeHighlight : false, // 关闭预览窗口的代码高亮,默认开启
flowChart : true, // 疑似Sea.js与Raphael.js有冲突,必须先加载Raphael.js,Editor.md才能在Sea.js下正常进行;
sequenceDiagram : true, // 同上
//dialogLockScreen : false, // 设置弹出层对话框不锁屏,全局通用,默认为true
//dialogShowMask : false, // 设置弹出层对话框显示透明遮罩层,全局通用,默认为true
//dialogDraggable : false, // 设置弹出层对话框不可拖动,全局通用,默认为true
//dialogMaskOpacity : 0.4, // 设置透明遮罩层的透明度,全局通用,默认值为0.1
//dialogMaskBgColor : "#000", // 设置透明遮罩层的背景颜色,全局通用,默认为#fff
flowChart : true, // 疑似 Sea.js与 Raphael.js 有冲突,必须先加载 Raphael.js ,Editor.md 才能在 Sea.js 下正常进行;
sequenceDiagram : true, // 同上
//dialogLockScreen : false, // 设置弹出层对话框不锁屏,全局通用,默认为 true
//dialogShowMask : false, // 设置弹出层对话框显示透明遮罩层,全局通用,默认为 true
//dialogDraggable : false, // 设置弹出层对话框不可拖动,全局通用,默认为 true
//dialogMaskOpacity : 0.4, // 设置透明遮罩层的透明度,全局通用,默认值为 0.1
//dialogMaskBgColor : "#000", // 设置透明遮罩层的背景颜色,全局通用,默认为 #fff
imageUpload : true, imageUpload : true,
imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp"], imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp"],
imageUploadURL : "./php/upload.php", imageUploadURL : "./php/upload.php",

16
examples/use-zepto.html

@ -2,7 +2,7 @@
<html lang="zh"> <html lang="zh">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title>Use Zepto.js - Editor.md examples</title>
<title>Using Zepto.js - Editor.md examples</title>
<link rel="stylesheet" href="css/style.css" /> <link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="../css/editormd.css" /> <link rel="stylesheet" href="../css/editormd.css" />
<link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" />
@ -10,7 +10,7 @@
<body> <body>
<div id="layout"> <div id="layout">
<header> <header>
<h1>Use Zepto.js</h1>
<h1>Using Zepto.js</h1>
<ul style="margin: 10px 0 0 18px;"> <ul style="margin: 10px 0 0 18px;">
<li>Enable HTML tags decode</li> <li>Enable HTML tags decode</li>
<li>Enable TeX, Flowchart, Sequence Diagram, Emoji, FontAwesome, Task lists</li> <li>Enable TeX, Flowchart, Sequence Diagram, Emoji, FontAwesome, Task lists</li>
@ -34,7 +34,7 @@
</div> </div>
<form action="http://editormd.ipandao.com/php/post.php" method="post"> <form action="http://editormd.ipandao.com/php/post.php" method="post">
<div class="editormd" id="test-editormd"> <div class="editormd" id="test-editormd">
<textarea>###Hello world!</textarea>
<textarea>### Hello world!</textarea>
</div> </div>
<br/><input type="submit" name="submit" value="Submit" class="btn" style="margin-left: 5%;" /> <br/><input type="submit" name="submit" value="Submit" class="btn" style="margin-left: 5%;" />
</form> </form>
@ -43,7 +43,7 @@
<script src="../editormd.js"></script> <script src="../editormd.js"></script>
<script type="text/javascript"> <script type="text/javascript">
var testEditor; var testEditor;
var jQuery = Zepto; // 为了避免修改flowChart.js和sequence-diagram.js的源码,所以想支持flowChart/sequenceDiagram就得加上这一句
var jQuery = Zepto; // 为了避免修改 flowChart.js sequence-diagram.js 的源码,所以想支持 flowChart / sequenceDiagram 就得加上这一句
$(function() { $(function() {
$.get("./test.md", function(md){ $.get("./test.md", function(md){
@ -54,16 +54,16 @@
markdown : md, markdown : md,
codeFold : true, codeFold : true,
searchReplace : true, searchReplace : true,
saveHTMLToTextarea : true, // 保存HTML到Textarea
saveHTMLToTextarea : true, // 保存 HTML Textarea
//watch : false, //watch : false,
htmlDecode : "style,script,iframe", // 开启HTML标签解析,为了安全性,默认不开启
htmlDecode : "style,script,iframe|on*", // 开启 HTML 标签解析,为了安全性,默认不开启
emoji : true, emoji : true,
taskList : true, taskList : true,
tocm : true, // Using [TOCM] tocm : true, // Using [TOCM]
tex : true, // 开启科学公式TeX语言支持,默认关闭
tex : true, // 开启科学公式 TeX 语言支持,默认关闭
//previewCodeHighlight : false, // 关闭预览窗口的代码高亮,默认开启 //previewCodeHighlight : false, // 关闭预览窗口的代码高亮,默认开启
flowChart : true, flowChart : true,
sequenceDiagram : true, // 同上
sequenceDiagram : true, // 同上
onload : function() { onload : function() {
console.log("onload =>", this, this.id, this.settings); console.log("onload =>", this, this.id, this.settings);
} }

2
lib/codemirror/addons.min.js

File diff suppressed because one or more lines are too long

10779
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", "name": "editor.md",
"version": "1.4.4",
"version": "1.4.5",
"description": "Open source online markdown editor.", "description": "Open source online markdown editor.",
"directories": { "directories": {
"doc": "docs", "doc": "docs",

60
plugins/image-dialog/image-dialog.js

@ -3,8 +3,8 @@
* *
* @file image-dialog.js * @file image-dialog.js
* @author pandao * @author pandao
* @version 1.3.2
* @updateTime 2015-05-09
* @version 1.3.3
* @updateTime 2015-06-02
* {@link https://github.com/pandao/editor.md} * {@link https://github.com/pandao/editor.md}
* @license MIT * @license MIT
*/ */
@ -134,48 +134,46 @@
if (fileName === "") if (fileName === "")
{ {
alert(imageLang.uploadFileEmpty); alert(imageLang.uploadFileEmpty);
return false;
} }
else if (!isImage.test(fileName))
if (!isImage.test(fileName))
{ {
alert(imageLang.formatNotAllowed + settings.imageFormats.join(", ")); alert(imageLang.formatNotAllowed + settings.imageFormats.join(", "));
return false;
} }
else
{
loading(true);
var submitHandler = function() {
loading(true);
var uploadIframe = document.getElementById(iframeName);
var submitHandler = function() {
uploadIframe.onload = function() {
loading(false);
var uploadIframe = document.getElementById(iframeName);
var json = "";
if (uploadIframe.contentWindow) {
json = uploadIframe.contentWindow.document.body ? uploadIframe.contentWindow.document.body.innerHTML : null;
} else if (uploadIframe.contentDocument) {
json = uploadIframe.contentDocument.document.body ? uploadIframe.contentDocument.document.body.innerHTML : null;
}
json = (typeof JSON.parse !== "undefined") ? JSON.parse(json) : eval("(" + json + ")");
uploadIframe.onload = function() {
loading(false);
if (json.success === 1)
{
dialog.find("[data-url]").val(json.url);
}
else
{
alert(json.message);
}
var body = (uploadIframe.contentWindow ? uploadIframe.contentWindow : uploadIframe.contentDocument).document.body;
var json = (body.innerText) ? body.innerText : ( (body.textContent) ? body.textContent : null);
return false;
};
};
json = (typeof JSON.parse !== "undefined") ? JSON.parse(json) : eval("(" + json + ")");
dialog.find("[type=\"submit\"]").bind("click", submitHandler).trigger("click");
if (json.success === 1)
{
dialog.find("[data-url]").val(json.url);
}
else
{
alert(json.message);
}
}
return false;
};
};
return false;
dialog.find("[type=\"submit\"]").bind("click", submitHandler).trigger("click");
}); });
} }

28
src/editormd.js

@ -47,7 +47,7 @@
}; };
editormd.title = editormd.$name = "Editor.md"; editormd.title = editormd.$name = "Editor.md";
editormd.version = "1.4.4";
editormd.version = "1.4.5";
editormd.homePage = "https://pandao.github.io/editor.md/"; editormd.homePage = "https://pandao.github.io/editor.md/";
editormd.classPrefix = "editormd-"; editormd.classPrefix = "editormd-";
@ -79,6 +79,7 @@
editormd.defaults = { editormd.defaults = {
mode : "gfm", //gfm or markdown mode : "gfm", //gfm or markdown
theme : "default", theme : "default",
name : "",
value : "", // value for CodeMirror, if mode not gfm/markdown value : "", // value for CodeMirror, if mode not gfm/markdown
markdown : "", markdown : "",
appendMarkdown : "", // if in init textarea value not empty, append markdown to textarea appendMarkdown : "", // if in init textarea value not empty, append markdown to textarea
@ -370,7 +371,7 @@
this.state.watching = (settings.watch) ? true : false; this.state.watching = (settings.watch) ? true : false;
if (!editor.hasClass("editormd")) {
if ( !editor.hasClass("editormd") ) {
editor.addClass("editormd"); editor.addClass("editormd");
} }
@ -392,7 +393,12 @@
markdownTextarea = this.markdownTextarea = editor.children("textarea"); markdownTextarea = this.markdownTextarea = editor.children("textarea");
} }
markdownTextarea.addClass(classNames.textarea.markdown).attr("name", id + "-markdown-doc").attr("placeholder", settings.placeholder);
markdownTextarea.addClass(classNames.textarea.markdown).attr("placeholder", settings.placeholder);
if (typeof markdownTextarea.attr("name") === "undefined" || markdownTextarea.attr("name") === "")
{
markdownTextarea.attr("name", (settings.name !== "") ? settings.name : id + "-markdown-doc");
}
var appendElements = [ var appendElements = [
(!settings.readOnly) ? "<a href=\"javascript:;\" class=\"fa fa-close " + classPrefix + "preview-close-btn\"></a>" : "", (!settings.readOnly) ? "<a href=\"javascript:;\" class=\"fa fa-close " + classPrefix + "preview-close-btn\"></a>" : "",
@ -800,7 +806,7 @@
* @returns {editormd} this(editormd instance object.) * @returns {editormd} this(editormd instance object.)
*/ */
extends : function() {
extend : function() {
if (typeof arguments[1] !== "undefined") if (typeof arguments[1] !== "undefined")
{ {
if (typeof arguments[1] === "function") if (typeof arguments[1] === "function")
@ -1879,13 +1885,15 @@
var newMarkdownDoc = editormd.$marked(cmValue, markedOptions); var newMarkdownDoc = editormd.$marked(cmValue, markedOptions);
this.markdownTextarea.val(cmValue);
//console.log("cmValue", cmValue, this.markdownTextarea, this.htmlTextarea);
this.markdownTextarea.text(cmValue);
cm.save(); cm.save();
if (settings.saveHTMLToTextarea) if (settings.saveHTMLToTextarea)
{ {
this.htmlTextarea.val(newMarkdownDoc);
this.htmlTextarea.text(newMarkdownDoc);
} }
if(settings.watch || (!settings.watch && state.preview)) if(settings.watch || (!settings.watch && state.preview))
@ -2100,7 +2108,7 @@
* @returns {editormd} 返回editormd的实例对象 * @returns {editormd} 返回editormd的实例对象
*/ */
setMarkdown : function(md) {
setMarkdown : function(md) {
this.cm.setValue(md || this.settings.markdown); this.cm.setValue(md || this.settings.markdown);
return this; return this;
@ -2170,7 +2178,7 @@
return false; return false;
} }
return this.htmlTextarea.html();
return this.htmlTextarea.val();
}, },
/** /**
@ -3134,7 +3142,7 @@
atLink : /@(\w+)/g, atLink : /@(\w+)/g,
email : /(\w+)@(\w+)\.(\w+)\.?(\w+)?/g, email : /(\w+)@(\w+)\.(\w+)\.?(\w+)?/g,
emailLink : /(mailto:)?([\w\.\_]+)@(\w+)\.(\w+)\.?(\w+)?/g, emailLink : /(mailto:)?([\w\.\_]+)@(\w+)\.(\w+)\.?(\w+)?/g,
emoji : /:([\+-\w]+):/g,
emoji : /:([\w\+-]+):/g,
emojiDatetime : /(\d{2}:\d{2}:\d{2})/g, emojiDatetime : /(\d{2}:\d{2}:\d{2})/g,
twemoji : /:(tw-([\w]+)-?(\w+)?):/g, twemoji : /:(tw-([\w]+)-?(\w+)?):/g,
fontAwesome : /:(fa-([\w]+)(-(\w+)){0,}):/g, fontAwesome : /:(fa-([\w]+)(-(\w+)){0,}):/g,
@ -3766,7 +3774,7 @@
var katexHandle = function() { var katexHandle = function() {
div.find("." + editormd.classNames.tex).each(function(){ div.find("." + editormd.classNames.tex).each(function(){
var tex = $(this); var tex = $(this);
katex.render(tex.html(), tex[0]);
katex.render(tex.html().replace(/&lt;/g, "<").replace(/&gt;/g, ">"), tex[0]);
}); });
}; };

Loading…
Cancel
Save