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

Custom Plugins don't work in vue viewer while they work in vue editor #1039

Closed
zifnab87 opened this issue Jun 9, 2020 · 1 comment
Closed
Labels

Comments

@zifnab87
Copy link

zifnab87 commented Jun 9, 2020

Describe the bug

custom Plugins (e.g youtubePlugin example) don't work in viewer while they work in editor. Imported chart plugin works fine in both editor and viewer

To Reproduce

https://codesandbox.io/s/damp-glitter-wiims

Expected behavior

Viewer should show youtube video as well as chart - it only shows chart and not custom plugin youtube

Screenshots

viewer:

image

editor:
image

@zifnab87 zifnab87 added the Bug label Jun 9, 2020
@zifnab87
Copy link
Author

zifnab87 commented Jun 9, 2020

fixed by using this setup from #899 (comment) :

working:

youTubePlugin(editor) {
      const { codeBlockManager } = Object.getPrototypeOf(editor).constructor
      codeBlockManager.setReplacer("youtube", youtubeId => {
         [...]
        return `<div id="${wrapperId}"></div>`;
      });
    }

not working:

import TuiEditor from '@toast-ui/editor'
youTubePlugin() {
    TuiEditor.codeBlockManager.setReplacer('youtube', (youtubeId) => {
        [...]
        return `<div id="${wrapperId}"></div>`
    })
},

Please update your documentation! Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant