Widget - undefined 'rule' error in viewer
digitalfuel opened this issue · comments
Describe the bug
Adding a widget to the editor works fine. But when viewing this from the Viewer I get TypeError: Cannot read properties of undefined (reading 'rule'). Likely because the rules are missing. I tried add the same widgetRules to the viewer options using widgetRules:... but did not work.
Widget markdown example $$widget0 @Firstname Lastname$$
Other markdown works but if widget is included then it breaks the Viewer and nothing is rendered.
To Reproduce
Steps to reproduce the behavior:
- Create widget
- View it in Viewer.
##Error
TypeError: Cannot read properties of undefined (reading 'rule') in the customInline: function()
Expected behavior
Viewer should display the widget like the editor does.
Desktop (please complete the following information):
- OS: Window 10
- Browser Chrome,
- Version latest
- @toast-ui/vue-editor v3.1.7
Viewer
only uses ToastMark. So, it can't get widget rules. But, If you put the widget rule in the viewer, it is no longer a lightweight module.
So what is the correct way to display widget in viewer?
Same here. I'm trying to use the input from the user on the Editor and display it somewhere else. But I can't support any customization I added to the markdown because the viewer can't support it. Would love a "readOnly" prop to the editor. So if "weight" is not an issue I can still show a readOnly preview.
I'm also having this same issue. There's no way to display a widget in viewer.