Jump to content

Webclipper doesn't preserve indentation of code examples


Recommended Posts

When clipping from stackoverflow, I noticed that indentation is lost, making code-examples hard to read.

In the case of python or explanatory ascii art graphs, the result is outright broken, since indentation is significant there.

E.g. when trying to clip https://stackoverflow.com/questions/47792846/what-is-ours-and-their-while-doing-git-rebase/61339092#61339092:

bug.thumb.png.5e59f4aec11b3ce010977b90d5dd9751.png

The browser reports the indented lines as "<span> content</span>"  with a single space in front. Adding more spaces would cause correct indentation, so it isn't a pure CSS issue. However, I cannot judge whether the stored note contains incorrect indentation, or whether the representation sent to rendering component contains an incorrect simplification.

 

  • Like 2
Link to comment
  • 2 months later...
  • 1 month later...

The same issue of indentation/space character removal applies when just pasting regular text into a code block. Spaces indicate syntax and without the spaces preserved, it's either time consuming and error prone to add them in afterwards, or makes pasted text unusable in that form. Preserving spaces/indetation is important for writing YAML (https://en.wikipedia.org/wiki/YAML) files and is used by QA Engineers to edit CircleCI or Github .yml files.

Ex.:

on: 
  pull_request:
    paths-ignore:
    - 'README.md'

results in:

on: 
pull_request:
paths-ignore:
- 'README.md'

The resulting yaml will fail when ran.

It's weird and a little ironic that this support website with an arguably more basic text editor allows adding codeblocks that preserve pasting indentation/whitespace/spaces.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...