nhn / tui.editor

🍞📝 Markdown WYSIWYG Editor. GFM Standard + Chart & UML Extensible.
http://ui.toast.com/tui-editor
MIT License
16.91k stars 1.72k forks source link

Please add the upper and lower subscripts. #3178

Open kimyk5527 opened 9 months ago

kimyk5527 commented 9 months ago

Version

latest

Development Environment

chrome

Current Behavior

If I write using the upper subscript (< sup >) and the lower subscript (< sub >), and save using getHTML, that tag disappears.

// Write example code

Expected Behavior

Please do not let < sup > and < sub > tags disappear or add the upper and lower subscripts to the markdown grammar.

ahamelers commented 9 months ago

I've made a plugin for adding this, and for adding buttons for super and subscript. I could share it, so it can be used as a plugin if it's not desired to modify the main package. The plugin is not in TypeScript, so it would need some work to add it to the main package.

https://github.com/ahamelers/tui.editor.subsup_plugin

kimyk5527 commented 9 months ago

@ahamelers First of all, thank you for your help. I'm using toast ui editor using javascript, can I use the plugin you made in javascript? Can you tell me how to use it?

ahamelers commented 9 months ago

@kimyk5527 Yes, you can use it. I have not published it on npm, but if you are using node, you can add it to your package.json as a dependency directly as a git package.

"dependencies": {
   "@toast-ui/subsup-plugin": "https://github.com/ahamelers/tui.editor.subsup_plugin.git",
}

If more people want the plugin, and the maintainers do not want to take it and add it to the main project, I'll consider publishing it.

You can use it as any other plugin: https://github.com/nhn/tui.editor/blob/master/docs/en/plugin.md

kimyk5527 commented 9 months ago

@ahamelers Can you show me how to use it in code on vanillaJS? I tried to use it, but it didn't work out.

ahamelers commented 9 months ago

Sorry, it is a node package with imports etc. I think it would need to be built and exported for use in plain JS