cherry-markdown icon indicating copy to clipboard operation
cherry-markdown copied to clipboard

[Bug Report] The Copy button on the toolbar is not working

Open taowang1993 opened this issue 1 year ago • 1 comments

Prerequisites

Describe the Bug

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cherry-markdown.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/cherry-markdown.min.css">

<div id="@@AUTOID@@"></div>

<script>
new Cherry({
  id: '@@AUTOID@@',
  locale: 'en_US', // default langauge
  editor: {
    height: '100vh',
    defaultModel: 'editOnly', // Split screen mode
    autoSave2Textarea: true, // Auto-saves content
    convertWhenPaste: true, // Converts pasted content to Markdown
    writingStyle: 'normal', // Can change to 'focus' for less distraction
    showSuggestList: true, // Provides auto-suggestions
  },
  toolbars: {
    toolbar: [
      'header',
      'list',
      'panel',
      'detail',
      {
        insert: [
          'image',
          'audio',
          'video',
          'link',
          'hr',
          'br',
          'code',
          'formula',
          'toc',
          'table',
          'line-table',
          'bar-table',
          'pdf',
          'word',
        ],
      },
      'graph',
      'settings',
      'changeLocale', // language switcher
      'theme',
    ],

    bubble: ['bold', 'italic', 'underline', 'strikethrough', 'sub', 'sup', 'quote', '|', 'size', 'color'], // array or false

    config: {
      changeLocale: [
        {
          locale: 'en_US',
          name: 'English'
        },
        {
          locale: 'zh_CN',
          name: '中文'
        },
        {
          locale: 'ru_RU',
          name: 'Русский'
        }
      ]
    }
  },
  
  engine: {
    syntax: {
      codeBlock: {
        wrap: true,
        lineNumber: true,
        copyCode: true,
        editCode: true,
      },
      mathBlock: {
        engine: 'MathJax',
        plugins: true,
      },
      table: {
        enableChart: true,
      },
      toc: {
        allowMultiToc: true,
        showAutoNumber: true,
      },
      header: {
        anchorStyle: 'autonumber',
      },
      list: {
        listNested: true,
      }
    }
  },

  fileTypeLimitMap: {
    video: 'video/*',
    audio: 'audio/*',
    image: 'image/*',
    word: '.doc,.docx',
    pdf: '.pdf',
  },
  multipleFileSelection: {
    image: true, // Upload multiple images at once
    video: true, // Upload multiple videos
    audio: true, // Upload multiple audio files
  },
  previewer: {
    enablePreviewerBubble: true, // Allows editing in preview mode
    lazyLoadImg: {
      noLoadImgNum: 5, // First 5 images load immediately
      autoLoadImgNum: 5, // Next 5 load automatically
    },
  },

});
</script>


Reproduction Steps

No response

System Information

No response

Contributing

None

taowang1993 avatar Oct 06 '24 23:10 taowang1993

It looks like you haven't enabled copy image

RSS1102 avatar Nov 23 '24 07:11 RSS1102