madskristensen / MarkdownEditor2022

A Visual Studio extension
Apache License 2.0
168 stars 37 forks source link

Strikethrough should not be in editor #78

Open LexaGV opened 1 year ago

LexaGV commented 1 year ago

In MD text it's nice to see "quick preview" of some formatting (like italic between stars), but strikethrough formatting should not do it - it disturbs me to read text. Strikethrough should be only on preview side.

sean-bloch commented 1 year ago

@LexaGV , I can see how it would be distracting in some cases. I'd argue instead, it would be a good feature to have this behavior configurable in the MarkDown Settings. Conversely to your case, I also find that when used with task lists and not always using side-by-side preview, it is nice to have the strikethrough rendered in the composition window.

It might be a nice update alongside adding a keyboard shortcut command to MakeStrikethrough

LexaGV commented 1 year ago

If you don't have 'preview', it's not a reason to show strikethrough. MD is not WYSIWYG. Italic and bold are just lucky exceptions, while MD "source" should be clear from formatting (like you work w HTML). I agree, some settings "ShowStrikethrough" could be useful, but primary behaviour should be NOT to show it.

LexaGV commented 1 year ago

Any progress there? Just in case somebody didn't catch the problem: when you type \~\~some text\~\~, it should be rendered as striked-through text, but in editor this text should be untouched! ATM even in editor this text is also with cross-line, what DISTURBS when you read it. Just see how it looks in editor:

\~\~some text\~\~

Not the best for reading, huh? :-1:

sean-bloch commented 1 year ago

Hi @LexaGV ,

I understand the issue and was only initially intending to add to a discussion of a tool that i have come to enjoy... In my opinion, for example, the "should"ness of formatting in the editor in a full featured IDE like Visual Studio could be as troublesome to debate as spaces vs tabs...

I was able to test a quick POC and could put together a pull request later, but the option you are looking for if you want to pull the source and recompile is MarkdownStrikethroughFormatDefinition in /src/Editor/ClassificationTypes.cs. If you remove the TextDecorations property set, the editor will no longer strikethrough.

When I added in AdvancedOptions setting to control this, I could not figure out how to get the behavior to change without restarting VisualStudio however.... I'm not sure if this has anything to do with compiling in debug mode as I have not worked with extension projects before..

However, if it is causing you issue, then hopefully this can help in the meantime.