Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strikethrough by design or issue? #1003

Closed
iisfaq opened this issue Jan 31, 2023 · 9 comments
Closed

Strikethrough by design or issue? #1003

iisfaq opened this issue Jan 31, 2023 · 9 comments
Assignees

Comments

@iisfaq
Copy link

iisfaq commented Jan 31, 2023

I am not sure if this is a bug or by design.

~~
line 1
line 2
~~

But if I select two lines and I want to strike through them both the strike though is not rendered in the preview (this may be by design since it does not render here either (see above). Also renders above as two lines, but the preview in MM is 1 line.

~~
Run the file
docker run --name linuxdockeridlcompiler -it linuxdockeridlcompiler:Dockerfile
~~

Rendered as

image

A strike-through on a single line or part of a line works fine.

~~Run the file~~

image

Maybe if this is by design, you could add the strikethrough to each line in the selected area automatically?

~~line 1~~
~~line 2~~

line 1
line 2

Version 2.8

@RickStrahl RickStrahl self-assigned this Jan 31, 2023
@RickStrahl
Copy link
Owner

Strikethrough - along with bold, italic, underline, etc. - are all inline elements, so they don't work across lines. This is due to the way HTML handles those markup elements.

I do like the idea of automatically marking up multiple lines...

This would really apply to all inline elements...

@RickStrahl RickStrahl added Approved Enhancement Enhancement that's been approved for implementation and removed enhancement labels Jan 31, 2023
@RickStrahl
Copy link
Owner

I sat down to implement this but just realized that doing multiline as suggested doesn't make any sense because logistically multiple lines that are single lines (without a line break character) are still treated as a single paragraph.

Here's what I mean:

image

Seems too confusing to figure out what works and what doesn't if selectively applying multiline options. What would that apply to?

@RickStrahl RickStrahl added enhancement feature discussion and removed Approved Enhancement Enhancement that's been approved for implementation enhancement labels Feb 1, 2023
@RickStrahl
Copy link
Owner

Ok so more experiments. I added support for multi-line inlines and I suppose it works, even though I suspect this will raise more questions than it answers.

MultiLineInlineMarkup

Note that the markup doesn't create breaking lines, it only puts the inline markup on every line. It doesn't automagically (and shouldn't) turn the lines into breaking lines. But this works now. You can also do multiple lines that are seperated by a blank line (a para break) and that works correctly as well.

I think I can live with this... Perhaps one more thing might be an option to enable this? Editor.MultLlineInlineMarkup=true perhaps?

@iisfaq
Copy link
Author

iisfaq commented Feb 1, 2023

Wow I was happy with your initial comments on this, you do work fast.

Cheers

@RickStrahl
Copy link
Owner

Any comments if this addresses your concerns?

I guess the main issue I have is that making mutliple lines that are essentially a single paragraph marked up is sub-optimal but it's simple that catches both the scenario of true multi-paragraph and single parargraph markup at least functionally.

@RickStrahl
Copy link
Owner

Please take a look at v2.8.2+ which includes these changes.

@iisfaq
Copy link
Author

iisfaq commented Feb 1, 2023 via email

@iisfaq
Copy link
Author

iisfaq commented Feb 1, 2023

I spotted one thing - if you have a soft return embedded in the block to be formatted it gets lost.

MarkdownMonster

Chris

@RickStrahl
Copy link
Owner

Yes found this one yesterday and fixed. You should now be able to format a block of text for soft returns and then mark up each line with the italic inside of the soft returns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants