Trix: Support for subscript and superscript

Created on 8 Feb 2017  路  7Comments  路  Source: basecamp/trix

Can we support subscript and superscript formatting options?

Most helpful comment

You can add your own attributes and toolbar buttons for those. It's especially straightforward since they map directly to an HTML tag. Example: https://jsfiddle.net/javan/z66gzbcp/

All 7 comments

<abbr> would be really nice to have, too.

You can add your own attributes and toolbar buttons for those. It's especially straightforward since they map directly to an HTML tag. Example: https://jsfiddle.net/javan/z66gzbcp/

Thanks so much. I've implemented this. Just have one problem. Subscript and superscript are mutually exclusive. How does one implement that?

Jesus. Thanks so much, man!

@javan Thank you for basically doing my job for me.

I'm now running into an issue where, in Chrome 71.0.3578.98, when a user edits content that has sub/sup tags, those tags don't exist in the editor (i.e. the user has to re-sup/sub the text). This is nto the case in Firefox 60.5.0esr; the tags still exist in the editor and the user is not required to re-sup/sub the text.

I basically copy-pasta'd the code you had in your fiddle.

@KurtRMueller checkout this comment if you're still having issues. Might point you in the right direction.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

adamdebono picture adamdebono  路  3Comments

lcsqlpete picture lcsqlpete  路  3Comments

atuttle picture atuttle  路  4Comments

benzkji picture benzkji  路  3Comments

souporserious picture souporserious  路  4Comments