Giter Site home page Giter Site logo

code-farmer-i / vue-markdown-editor Goto Github PK

View Code? Open in Web Editor NEW
1.0K 1.0K 106.0 22.4 MB

A markdown editor built on Vue

Home Page: https://code-farmer-i.github.io/vue-markdown-editor/

License: MIT License

JavaScript 62.81% Vue 20.50% HTML 0.75% CSS 15.16% SCSS 0.78%
editor markdown vue vue3

vue-markdown-editor's People

Contributors

artur-borys avatar bricklou avatar changjoo-park avatar code-farmer-i avatar dependabot[bot] avatar matheusbozetti avatar mbozetti avatar patrickblackjr avatar robertfausk avatar seguce92 avatar songyipan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

vue-markdown-editor's Issues

图片上传按示例代码拿不到files

图片上传按示例代码拿不到files,怎么解决啊?

handleUploadImage(event, insertImage, files) {
      // 拿到 files 之后上传到文件服务器,然后向编辑框中插入对应的内容
      console.log(files)

      // 此处只做示例
      insertImage({
        url:
          'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1269952892,3525182336&fm=26&gp=0.jpg',
        desc: '七龙珠'
      })
    }

console.log(files)打印的是undefined

内置的 codemirror 能不能支持 vim 模式

我想要用 vue-markdown-editor 写一个自己用的笔记软件, 其它还好,但是发现 codemirror 的配置对象不支持 vim 的 keymap . 好像是因为 Ediver.vue 中没有引入 'codemirror/keymap/vim.js' 导致的, 能不能更新一下。还有初始化编辑器的时候,没有默认全屏的配置项,能不能也一起加上呢,谢谢 ^_^

加粗样式未定义

使用 xxx 对应预览是 文字只是被strong包裹 为定义对应的加粗样式
这导致在使用了reset.css的页面中无法正常显示加粗效果

null

想找一个设置文字颜色的功能,没找到

Vuepress主题引用php语言包报错

问题

其它语言包正常,安装php语言包时就报错了。是否是语言包的问题。新手,感谢回答。

浏览器控制台信息

vue.runtime.esm.js?2b0e:619 [Vue warn]: Error in callback for watcher "text": "TypeError: Cannot read property 'tokenizePlaceholders' of undefined"

found in

---> <VMdPreview> at src/preview.vue
       <Scrollbar> at src/components/scrollbar/index.vue
         <VMdContainer> at src/components/container.vue
           <VMdEditor> at src/base-editor.vue
             <EditArticle> at src/components/mainbody_components/cms/edit_article.vue
               <Cms> at src/components/mainbody_components/cms/cms.vue
                 <Mainbody> at src/views/mainbody.vue
                   <App> at src/App.vue
                     <Root>

TypeError: Cannot read property 'tokenizePlaceholders' of undefined
    at eval (prism-php.js?f652:127)
    at Object.run (vuepress.js?02c6:1)
    at Object.highlight (vuepress.js?02c6:1)
    at highlight (vuepress.js?02c6:1)
    at Object.eval [as highlight] (vuepress.js?02c6:1)
    at a.fence (vuepress.js?02c6:1)
    at eval (vuepress.js?02c6:1)
    at eval (vuepress.js?02c6:1)
    at Object.md.renderer.rules.fence (lineNumbers.js?1f9e:7)
    at i.render (vuepress.js?02c6:1)

包版本

{
  "dependencies": {
    "@kangc/v-md-editor": "^1.4.2",
    "core-js": "^3.6.5",
    "markdown-it": "^11.0.0",
    "vue": "^2.6.11",
    "vue-router": "^3.2.0",
  }
}

vue3.0 中报错啊

火狐:

Uncaught TypeError: d.a is undefined
    <anonymous> base-editor.js:1
    n base-editor.js:1
    <anonymous> base-editor.js:1
    <anonymous> base-editor.js:1
    <anonymous> base-editor.js:1
    <anonymous> base-editor.js:1
    node_modules chunk-vendors.js:10
    __webpack_require__ app.js:849
    fn app.js:151
    <anonymous> main.js:12
    js app.js:1009
    __webpack_require__ app.js:849
    fn app.js:151
    1 app.js:1022
    __webpack_require__ app.js:849
    checkDeferredModules app.js:46
    <anonymous> app.js:925
    <anonymous> app.js:928
base-editor.js:1
    <anonymous> base-editor.js:1
    n base-editor.js:1
    <anonymous> base-editor.js:1
    <anonymous> base-editor.js:1
    <anonymous> base-editor.js:1
    <anonymous> base-editor.js:1
    js chunk-vendors.js:10
    __webpack_require__ app.js:849
    fn app.js:151
    <anonymous> main.js:12
    js app.js:1009
    __webpack_require__ app.js:849
    fn app.js:151
    1 app.js:1022
    __webpack_require__ app.js:849
    checkDeferredModules app.js:46
    <anonymous> app.js:925
    <anonymous> app.js:928

谷歌:

Uncaught TypeError: Cannot read property 'config' of undefined
    at Module.eval (base-editor.js?ee2d:1)
    at n (base-editor.js?ee2d:1)
    at eval (base-editor.js?ee2d:1)
    at eval (base-editor.js?ee2d:1)
    at eval (base-editor.js?ee2d:1)
    at eval (base-editor.js?ee2d:1)
    at Object../node_modules/@kangc/v-md-editor/lib/base-editor.js (chunk-vendors.js:10)
    at __webpack_require__ (app.js:849)
    at fn (app.js:151)
    at eval (main.js:12)

vue3.0里面能用吗?

快捷复制代码

找了好久的基于vue的编辑器就这个比较满意,使用方便,文档详细。
感谢作者


快捷复制代码有问题
编辑组件点击
会在当前地址拼接参数?file
预览组件点击没有反应
所有都不能复制不上

import VMdEditor from '@kangc/v-md-editor/lib/codemirror-editor'
import '@kangc/v-md-editor/lib/style/codemirror-editor.css'
import vuepressTheme from '@kangc/v-md-editor/lib/theme/vuepress.js' // 主题
VMdEditor.use(vuepressTheme)

import createCopyCodePlugin from '@kangc/v-md-editor/lib/plugins/copy-code/index'
VMdEditor.use(createCopyCodePlugin())

有没有什么方法可以一次导入所有代码高亮的语言包

Mac下粘贴部分类型文件导致报错

目前发现svg、csv会导致报错

https://github.com/code-farmer-i/vue-markdown-editor/blob/dev/src/utils/file.js

// Modified from https://github.com/ElemeFE/element/blob/dev/packages/upload/src/upload-dragger.vue
export function filesFilter(files, config) {
  const { accept } = config;

  const filesKeys = Object.keys(files).filter((key) => {
    const file = files[key]; 
    const { type, name } = file; // 这边file是null,导致解构报错
    const extension = name.indexOf('.') > -1 ? `.${name.split('.').pop()}` : '';
    const baseType = type.replace(/\/.*$/, '');

    return accept
      .split(',')
      .map((type) => type.trim())
      .filter((type) => type)
      .some((acceptedType) => {
        if (/\..+$/.test(acceptedType)) {
          return extension === acceptedType;
        }

        if (/\/\*$/.test(acceptedType)) {
          return baseType === acceptedType.replace(/\/\*$/, '');
        }

        // eslint-disable-next-line no-useless-escape
        // eslint-disable-next-line no-useless-escape
        if (/^[^\/]+\/[^\/]+$/.test(acceptedType)) {
          return type === acceptedType;
        }

        return false;
      });
  });

  return filesKeys.map((key) => files[key]);
}

export function getFilesFromClipboardData(clipboardData) {
  return Object.keys(clipboardData.items)
    .filter((key) => clipboardData.items[key].kind === 'file')
    .map((key) => clipboardData.items[key].getAsFile()); // 这里getAsFile()返回null,导致上面报错
}

npm下载问题

都四天了
npm下载的还是1.4.7版本
最新版本还是下载不下来
image
image

English Version

This is awesome. Could you provide an English version of the documentation?

提几个小建议

  • 1、编辑器现在看到的效果是全屏时 半编辑变预览无 可全部预览(只显示预览页)无 可全部编辑(只显示编辑页),虽然是可以通过mode去动态控制,对体验来说还是有些问题
  • 2、提示信息:提示信息中会存在这个提示、警告、注意的字体,希望能去掉
    image
  • 3、上传图片后无法点击图片单独预览,要是图片截屏大的情况下,那么就无法具体查看图片内容(重点)

预览组件样式解析问题

  1. 分割线会使上一行的字体加粗,如果加一行空行就不会,但是在预览组件上不解析空行 。

  2. “-”手敲的无序列表在预览组件上不显示

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.