wjgoarxiv / obsidian-supsub

::SupSub enables wrapping selected text with `<sup>` or `<sub>` tags::
MIT License
9 stars 0 forks source link

Asking for an Improvement #4

Open lpokt opened 3 weeks ago

lpokt commented 3 weeks ago

Hi!
This is a fantastic plugin. It performs exactly as needed, and that's great. However, there's one improvement I'd love to see: Hiding the tags upon insertion and only showing them when hovering over the text formated with sub & sup tags .

To clarify, here’s how the plugin currently works:

  1. I format the selected text with sub & sup tags.
  2. It displays the tags like this: <sub>selected text</sub>.
  3. Only if I click elsewhere on the page does it show the text as subscript.

What I'd like it to do:

  1. I format the selected text with sub & sup tags.
  2. It instantly shows the selected text as subscript without displaying the tags.
  3. The tags should only appear if I click on the subscripted text.
wjgoarxiv commented 1 week ago

Dear @lpokt,

Thank you for your patience and for sharing your insightful feedback on the plugin. I apologize for the delayed response.

I’ve carefully reviewed your suggestion regarding the immediate rendering of <sub> and <sup> tags upon insertion, with the tags themselves hidden and only revealed upon hovering over the formatted text. While this feature would indeed enhance the user experience, implementing it presents certain challenges within the current capabilities of Obsidian’s editor.

Obsidian’s editor, particularly in Live Preview mode, is designed to display Markdown and HTML tags as they are typed, rendering them only after the user moves the cursor away from the current line. This behavior ensures that users can see and edit the raw Markdown or HTML code directly.

To achieve the functionality you’re describing—where the tags are hidden immediately upon insertion and the formatted text is displayed instantly—would require altering the core behavior of Obsidian’s editor. Such modifications are beyond the scope of a plugin, as they would necessitate changes to the editor’s fundamental rendering process.

However, with the current version of the SupSub plugin, you can achieve the desired formatting by following these steps:

I appreciate your understanding and am grateful for your valuable input. If you have any further suggestions or questions, please feel free to share them.

Best regards, @wjgoarxiv

lpokt commented 5 days ago

Thank you for your detailed and thoughtful response to my suggestion. I truly appreciate the time and effort you’ve put into explaining the challenges and providing a workaround.

I’d like to share an observation that might offer a potential solution that worth exploring.

The Typing Assistant plugin in Obsidian provides functionality that resembles what I’m suggesting. When activing the Select Option and using its bold option, the selected text is instantly displayed as bold without showing the ** Markdown syntax. The ** only becomes visible when I click on the formatted text.

I hope that it might be technically possible to achieve similar behavior for <sub> and <sup> tags in the SupSub plugin. While I understand that adapting such functionality could involve unique challenges, I believe exploring this approach might yield a more seamless experience for users.

I hope this example proves helpful, and I look forward to seeing how the plugin evolves. Please let me know if there’s anything further I can do to support or clarify this suggestion.

wjgoarxiv commented 2 days ago

Hi @lpokt,

Thank you for your valuable suggestion! I'm excited to inform you that version 1.0.3 now includes pop-up buttons for generating <sup> and <sub> tags, inspired by your feedback. This should provide a smoother and more seamless experience like the Typing Assistant plugin. If you have further ideas or feedback on this update, please let me know.

Best regards,
@wjgoarxiv

lpokt commented 1 day ago

Thank you so much for your efforts in improving this plugin.

I wanted to clarify my request regarding the and tags. Specifically, I’m hoping the tags won’t appear immediately after insertion when using the pop-up buttons.

To make my point clearer, here’s a video demonstrating what I mean.

In the video, you’ll notice {in the Using plugin section} how the Typing Assistant plugin handles the insertion of bold syntax. When I use its buttons to apply bold formatting, the ** Markdown syntax is instantly hidden, and the bold text is displayed right away—without requiring me to click elsewhere on the page.

I believe achieving a similar functionality for and tags in the SupSub plugin would greatly enhance its usability and make the user experience smoother.

Thank you once again for considering this suggestion and for your dedication to enhancing this project.

wjgoarxiv commented 10 hours ago

Dear @lpokt

I've updated the new version (v1.0.4)! So please download it, and check whether the instant formatting feature (not visualizing either <sup></sup> or <sub></sub> tags) is running smoothly in your environment.

If there aren't any troubles, I'll close this issue. So please let me know:)