pinnwand icon indicating copy to clipboard operation
pinnwand copied to clipboard

Feature suggestion: syntax highlighting

Open airone506 opened this issue 2 years ago • 4 comments

Hello, first of all I would like to thank you for such a useful software and running the great bpa.st.

Now I would like to politely suggest a feature. Please make it possible to enable/change the syntax highlighting also in View paste mode.

airone506 avatar May 04 '23 14:05 airone506

Do you mean selecting a different lexer, or to disable it?

supakeen avatar May 23 '23 08:05 supakeen

I mean to enable any lexer for the existing paste(s). It happens quite often that uploader forgets to select the lexer and this affects the readability of the code for those who are viewing it. Current workaround is to re-paste the code with the correct lexer enabled or copy-paste to your desktop editor, but one click (or two clicks literally) on the "view paste" webpage would be more convenient. This is more like the UX enhancement.

airone506 avatar May 26 '23 11:05 airone506

While I do like the idea the issue is mostly that we save the syntax highlighted output directly into the database to prevent having to re-syntax every time a paste is viewed.

Currently you can indeed directly repaste the paste with the repaste button and then change the syntax. I'll leave it open because if more people find this important I'm willing to add something to handle this.

supakeen avatar Jun 05 '23 09:06 supakeen

A possible solution would be to change the current default Text only highlighter to a blank one with some descriptive placeholder text. See the attached mock-up.

upl-bpast1

The dropdown has a bright color to attract the user's attention. The Paste! button is disabled with dimmed color and re-styled cursor. With the button disabled, the user will not be able to submit the paste. As soon as any syntax highlight is selected by the user, the drop-down changes color to the default one and the properties of the submit button change to: default color, enabled, default cursor.

airone506 avatar Jun 05 '23 21:06 airone506