SupSub is an Obsidian plugin that allows you to easily format selected text with <sup> and <sub> tags, enabling quick superscript and subscript formatting in your notes.
Superscript:
Option + Command + '=' on macOS or Ctrl + Alt + '=' on Windows.<sup> tags.Subscript:
Option + Command + '-' on macOS or Ctrl + Alt + '-' on Windows.<sub> tags.Remove Formatting:
<sup> or <sub> tags from the selected text.Toggling:
<sup> or <sub>, using the respective button or hotkey will remove the tags.Popup Modifier Key:
Add Superscript/Subscript:
Remove Superscript/Subscript:
<sup> or <sub> tags.Remove Formatting with Hidden Tags:
Contributions are welcome! If you encounter any issues or have suggestions for improvements, please open a new issue or submit a pull request in the GitHub repository.
This plugin is licensed under the MIT License.
Bug Fixes:
RangeSetBuilder with Decoration.set(ranges, true) to eliminate "Ranges must be added sorted" console errors on edge cases.requestAnimationFrame to ensure stable positioning after decoration reflow.<sup><sup>2</sup></sup>. The plugin detects overlapping tags and unwraps instead of double-wrapping.Improvements:
Bug Fixes:
Decoration.mark() with display: none to Decoration.replace() for hiding <sup>/<sub> tags. This eliminates cursor position mismatches that caused letters to disappear when typing near formatted text.display: inline-block and position: relative CSS properties from superscript/subscript elements that were causing text to shift positions during editing.New Features:
Bug Fixes:
TypeError related to invalid selection points. The plugin now correctly validates selection ranges to prevent errors.Improved Stability:
<sup> tags.<sub> tags.<sup> or <sub> tags from the selected text.<sup> or <sub>, only the Normal (n) button is displayed to allow easy removal of the tags.