notes icon indicating copy to clipboard operation
notes copied to clipboard

make code-blocks nicer

Open newhinton opened this issue 3 years ago • 8 comments

Signed-off-by: Felix Nüsse [email protected]

Old Style: grafik

New Style: grafik

newhinton avatar Aug 06 '22 08:08 newhinton

Nice!

  1. How does the singular line block play out when there is more text in the line?
  2. Is the leading Space in the "new" sample intented? Where does it come from? Or has it wrongly been stripped in the "old" sample?

stefan-niedermann avatar Aug 06 '22 09:08 stefan-niedermann

  1. How does the singular line block play out when there is more text in the line?

Oh yeah, it breaks in a funny way. I will have to see if this can be fixed easily.

  1. Is the leading Space in the "new" sample intented? Where does it come from? Or has it wrongly been stripped in the "old" sample?

That is a bug. I guess it is due to the padding applied to give the content a bit more space, but it seems it is only applied to the first line.

newhinton avatar Aug 06 '22 09:08 newhinton

That is a bug. I guess it is due to the padding applied to give the content a bit more space, but it seems it is only applied to the first line.

Without having a look into it, the behaviour hints for a CSS text-indent property. Maybe there is one which needs to be overridden :shrug:

stefan-niedermann avatar Aug 06 '22 09:08 stefan-niedermann

grafik

newhinton avatar Aug 06 '22 10:08 newhinton

Looks good :) Just for clarification: This is only for code blocks (three backticks), and not for inline code (one backtick), right?

stefan-niedermann avatar Aug 06 '22 10:08 stefan-niedermann

Both! Block 1&2 in the screenshot are single ticks, 3 is block.

But now that you say it, let me check how well that behaves inside a larger text. Maybe i need to not apply a padding there

newhinton avatar Aug 06 '22 10:08 newhinton

grafik

I fixed the issue for textblocks with quotes, but multiline-singleline-blocks look a bit worse than before. I dont think that is fixable, but maybe that is a tradeoff

newhinton avatar Aug 06 '22 10:08 newhinton

@newhinton Thanks for your PR, this looks good! And thanks @stefan-niedermann for the review!

@newhinton What's the state of this PR? Are all issues fixed? Is this ready for final review? Could you please update the screenshots?

korelstar avatar Aug 14 '22 09:08 korelstar

@korelstar Yes this is ready!

image

newhinton avatar Oct 03 '22 09:10 newhinton

Looks very nice! Will add this to the 4.6.0 release, after the pre-wrap is fixed :tada:

korelstar avatar Oct 03 '22 15:10 korelstar