Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request]直接使用el初始化编辑器 #203

Closed
j4587698 opened this issue Apr 27, 2022 · 1 comment
Closed

[Feature request]直接使用el初始化编辑器 #203

j4587698 opened this issue Apr 27, 2022 · 1 comment
Labels
🚀enhancement New feature or request

Comments

@j4587698
Copy link

Is your feature request related to a problem? Please describe.
在动态生成的div中加载markdown编辑器。不太好固定设置一个id,可以拿到节点的其他选择器。

** What does the proposed API look like**

new Cherry({
      el: document.querySelector('#markdown-container'), //类似的选择器或者其他`ref`
      value: '# welcome to cherry editor!',
    });

Additional context

@lyngai lyngai added the 🚀enhancement New feature or request label Apr 27, 2022
@sunsonliu
Copy link
Collaborator

done~

Morris-G added a commit to Morris-G/cherry-markdown that referenced this issue May 16, 2022
* fix(insert): file type wrong

* chore(release): 0.6.1

* fix(suggester):  adapt empty regex in safari

* chore(actions): run github actions on dev branch events

* fix(lookbehind): fix `replaceStringByBuffer` returns empty string when nothing to replace

* fix(*): fix usage of lookbehind support

* fix: 0xA0 need to be treated as space

Fixed Tencent#83

* fix: use 0xa0 unicode instead

Tencent#84 (comment)
Tencent#84

* fix(suggester): suggester lookbehind regex support & fix list test case

* fix(suggester): extract replacer from toHtml to avoid regex error in safari

* fix(suggester): add leadingChars

* fix: mathjax script duplicate with multiple cherry instances

Fixed Tencent#73

* style(*): eslint fix

* fix: type error in mathjax

* fix: delay backslash tranform time

* chore(release): 0.6.2

* feat: api:setValue() 更新内容时支持保持光标位置 (Tencent#106)

* fix(list): avoid string collect error while building tree

* Support poster in video (Tencent#94)

* feat: support poster in video

Fixed Tencent#93

* docs: support poster in video

Tencent#93

* feat: add force append

* fix(Image): encode poster url

* chore(release): 0.6.3

* build(deps): bump mermaid from 8.11.1 to 8.13.8

Bumps [mermaid](https://github.com/knsv/mermaid) from 8.11.1 to 8.13.8.
- [Release notes](https://github.com/knsv/mermaid/releases)
- [Changelog](https://github.com/mermaid-js/mermaid/blob/develop/docs/CHANGELOG.md)
- [Commits](mermaid-js/mermaid@8.11.1...8.13.8)

---
updated-dependencies:
- dependency-name: mermaid
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore(release): 0.6.4

* fix(list): adapt list cases to avoid array out of boundary

* feat: optimize error output

* perf(image): fix poor performance when referencing data-url images

* style(*): lint

* fix(list): adapt list cases to avoid array out of boundary

* feat: optimize error output

* fix(ts file): fix ts file couldn't submit

* chore(release): 0.6.5

* build(deps): bump node-fetch from 2.6.6 to 2.6.7

Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 2.6.6 to 2.6.7.
- [Release notes](https://github.com/node-fetch/node-fetch/releases)
- [Changelog](https://github.com/node-fetch/node-fetch/blob/main/docs/CHANGELOG.md)
- [Commits](node-fetch/node-fetch@v2.6.6...v2.6.7)

---
updated-dependencies:
- dependency-name: node-fetch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

* build(deps): bump node-fetch from 2.6.6 to 2.6.7 in /client

Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 2.6.6 to 2.6.7.
- [Release notes](https://github.com/node-fetch/node-fetch/releases)
- [Changelog](https://github.com/node-fetch/node-fetch/blob/main/docs/CHANGELOG.md)
- [Commits](node-fetch/node-fetch@v2.6.6...v2.6.7)

---
updated-dependencies:
- dependency-name: node-fetch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

* fix: fix README content of engine mode.

* fix Tencent#132 (Tencent#139)

* add pre  增加pre语法(四个空格变成代码块) (Tencent#137)

* add pre  增加pre语法(四个空格变成代码块)

* 优化缩进代码块的逻辑,兼容高亮代码块和行内代码块互相嵌套的场景

* fix 缩进语法内嵌列表失效的问题,fix 缩进语法行号没有正确计算的问题

* add header anchorStyle  Fixed:Tencent#134 (Tencent#138)

* add header anchorStyle  Fixed:Tencent#134

* 优化paste功能:1、优化样式;2、增加粘贴时将HTML转成md的开关 (Tencent#141)

* chore(release): 0.6.6

* fix: refresh codemirror while toggling fullscreen

* fix: add no-escape regex in math

* feat: add code tag in indent code block

* feat: 增加拖拽上传功能; Fixed:Tencent#36 (Tencent#146)

* feat: 增加拖拽上传功能; Fixed:Tencent#36

* feat: 增加拖拽上传文件的功能,包括:批量拖拽上传、拖拽文本直接回显、拖拽图片回显图片、拖拽文件回显超链接

* build(deps): bump prismjs from 1.25.0 to 1.27.0 in /client

Bumps [prismjs](https://github.com/PrismJS/prism) from 1.25.0 to 1.27.0.
- [Release notes](https://github.com/PrismJS/prism/releases)
- [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md)
- [Commits](PrismJS/prism@v1.25.0...v1.27.0)

---
updated-dependencies:
- dependency-name: prismjs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

* fix: 修复代码块内嵌套缩进时出现占位字符的情况

* fix(editor): fix the compatibility issue of cjk ime (Tencent#150)

Fixed Tencent#82

* Fix/url cache miss (Tencent#151)

* fix(editor): fix the compatibility issue of cjk ime

Fixed Tencent#82

* fix(url-cache): fix url cache string not working correctly

* fix(Cherry.js): fix cherry resize and refresh codemirror context (Tencent#142)

* chore(release): 0.6.7

* chore(test): fix jest dependencies

* chore(test): add complete test for engine

* feat: add commonmark test suites

* feat: add commonmark test suites

* feat: add commonmark test suites

* chore(test): add complete test for engine

* chore(test): add complete test for engine

* feat: improve content cache for paragraph

* fix: eslint fix & list test case fix

* chore(release): 0.6.8

* Fix/suggester compatible node (Tencent#157)

* fix(suggester): fix sugggester hook compatible for node env

* docs: optimize docs about node env usage

Co-authored-by: humyfred <[email protected]>

* fix(table-head): fix th content not rendering

* improve readme file

* chore(release): 0.6.9

* fix:(suggester): fix keydown up down or enter which does not work

* chore(release): 0.6.10

* fix: replace lookbehind in math regex

* chore(release): 0.6.11

* fix(list): use list start number

* chore(release): 0.6.12

* build(deps-dev): bump electron from 16.0.3 to 16.0.6 in /client

Bumps [electron](https://github.com/electron/electron) from 16.0.3 to 16.0.6.
- [Release notes](https://github.com/electron/electron/releases)
- [Changelog](https://github.com/electron/electron/blob/main/docs/breaking-changes.md)
- [Commits](electron/electron@v16.0.3...v16.0.6)

---
updated-dependencies:
- dependency-name: electron
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>

* fix(link): add bracket match check

* fix(code-block): fix language matching regex

Fixed Tencent#90

* build: add cherry engine esm output

* chore(jsdom): upgrade jsdom to 19.0.0

* Feat: add table wysiwyg v1.0 (Tencent#189)

* fix: 列表嵌套段落语法时,行号计算错误

* feat: 完善表格所见即所得**基本**编辑功能

* feat: 增加预览区域编辑功能的开关配置

* feat: change codemirror mode to 'gfm'

* feat: update unit test (Tencent#188)

* feat: 增加表格编辑文档

* update readme

* fix(suggester): fix keydown 'enter' affect the default logic of newlineAndIndentContinueMarkdownList (Tencent#190)

LGTM

* build(deps-dev): bump node-sass from 6.0.1 to 7.0.0

Bumps [node-sass](https://github.com/sass/node-sass) from 6.0.1 to 7.0.0.
- [Release notes](https://github.com/sass/node-sass/releases)
- [Changelog](https://github.com/sass/node-sass/blob/master/CHANGELOG.md)
- [Commits](sass/node-sass@v6.0.1...v7.0.0)

---
updated-dependencies:
- dependency-name: node-sass
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>

* Feat preview scroll animation (Tencent#193)

* feat: add previewer scroll animation

* chore(release): 0.7.0

* build(deps): bump minimist from 1.2.5 to 1.2.6 in /client

Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

* build(deps): bump ansi-regex from 3.0.0 to 3.0.1 in /client

Bumps [ansi-regex](https://github.com/chalk/ansi-regex) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/chalk/ansi-regex/releases)
- [Commits](chalk/ansi-regex@v3.0.0...v3.0.1)

---
updated-dependencies:
- dependency-name: ansi-regex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

* fix: update list type regex to avoid content lost (Tencent#196)

Fixed Tencent#194

* Feat table support codeblock (Tencent#198)

* feat: add previewer scroll animation

* fix: save the last move

* feat: 表格编辑兼容代码块的场景,修复纯预览模式下可以所见即所得编辑的问题

* fix(checklist): illegal inline checklist (Tencent#200)

* fix(checklist): illegal inline checklist

* chore(.gitignore): ignore package-lock.json

* chore: restore lock files

* fix(checklist): fix reg exp

* fix: update blockquote regex to split list

Fixed Tencent#165

* feat(toolbar): add quote hook & optimize quote level implementation

* fix(comment-reference): fix npe problem when there is a comment reference at the beginning of the document

* fix: 最小高度调整 Tencent#207

* fix(code-block): fix Tencent#166 parse hr and indent code (Tencent#205)

* fix(code-block): fix Tencent#166 parse hr and indent code

* fix(code-block): remove lookbehind assertion and prepend line feed

Co-authored-by: jaredjywang <[email protected]>

* fix: 修复批量拖拽上传文件没回调就插入内容的bug

* fix: 通过工具栏插入内容时,默认选中被插入的内容 Tencent#206

* fix: 修复缩进代码块行号计算不准的问题

* fix: 增加使用el初始化编辑器的能力 Tencent#203

* feat: 插入有序列表的时候,序号自增 Tencent#160

* docs(*): update multiple instance demo

* docs(*): update custom menu docs

* docs(config): improve docs about cherry default config

* docs(toolbar): add custom toolbar guide

Fixed Tencent#202

* chore(release): 0.7.1

* bump to 0.7.1

Co-authored-by: humyfred <[email protected]>
Co-authored-by: jiawei686 <[email protected]>
Co-authored-by: ivorwei <[email protected]>
Co-authored-by: 韩野 <[email protected]>
Co-authored-by: barryhu <[email protected]>
Co-authored-by: sunsonliu <[email protected]>
Co-authored-by: hanye9895 <[email protected]>
Co-authored-by: sunsonliu <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: jrainliu <[email protected]>
Co-authored-by: lyngai <[email protected]>
Co-authored-by: humyfred <[email protected]>
Co-authored-by: Jared Wang <[email protected]>
Co-authored-by: jaredjywang <[email protected]>
wty92911 pushed a commit to wty92911/cherry-markdown that referenced this issue May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants