nhn / tui.editor

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

Please add the upper and lower subscripts. #3178

Open kimyk5527 opened 1 year ago

kimyk5527 commented 1 year 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 1 year 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 1 year 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 1 year 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 1 year 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 1 year 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

artsooter commented 2 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.

https://github.com/nhn/tui.editor/issues/2083#issuecomment-989610546 maybe this way can help you

kimyk5527 commented 2 months ago

@artsooter Thank you for your help. But I'm saving it using getHTML(). When I run getHTML(), the sub tag and sup tag disappear. When I write originalText <sub>subText</sub> <sup>supText</sup>, it changes to originalText subText supText.