slim icon indicating copy to clipboard operation
slim copied to clipboard

Feature request: Allow white space around pipe text

Open donv opened this issue 2 years ago • 1 comments

Hi!

Thank you for this excellent templating engine! It makes my every day better 😄 .

It would be nice to allow putting white space before a pipe text like so:

|< Some text with white space before

Similarly white space after text would be nice, although that is possible with apostrophe. I would like it for consistency.

|> Some text with white space after
' Some text with white space after

Using two spaces after the pipe is possible, but it is a maintenance nightmare since it is easily removed by source code formatters or unaware developers or even just by accident since double space is not very visible.

|  Some text with white space before
| Some text without white space before

And of course white space before and after would also be useful:

|<> Some text with white space before and after.

A very common case for us is a conditional text which is appended to another text, and we want white space before the text only when the text is present:

| Start
- if some_condition
  |< Some text with white space before

Would this be possible, or does it break some other syntax?

donv avatar Apr 07 '22 08:04 donv

I would still love to have this feature. Would you like me to submit a pull request?

donv avatar Aug 16 '22 11:08 donv

@donv If there is interest, I would appreciate a PR which implements this feature and updates the documentation. As you argue, this would improve consistency.

minad avatar Jan 22 '23 14:01 minad

I will have a look.

UweKubosch avatar Jan 30 '23 13:01 UweKubosch

We will submit a PR for this.

UweKubosch avatar Feb 02 '23 13:02 UweKubosch

I am starting on this now. I will ask for help to find my way around the code if needed.

UweKubosch avatar Feb 23 '23 09:02 UweKubosch