GitHub onebox wrongly removes identation inside the curly braces

An example of the wrong rendering:

https://github.com/magento/magento2/blob/958164/lib/internal/Magento/Framework/EntityManager/EntityHydratorInterface.php#L12-L30

The right rendering (you can see it directly on GitHub using the link above):

2 Likes

Seems correct to me, I do not want to see out of context indentation for snippets anyway. What if it was indented 50 spaces because it is a deeply nested routine?

It is IN-context identation, because the context is set by the curly braces.

2 Likes

Another example (JavaScript code):

https://github.com/magento/magento2/blob/958164/app/code/Magento/Shipping/view/adminhtml/templates/create/items.phtml#L147-L166

The contents of the window.submitShipment function is idented in the original code (you can see it on GitHub using the link above), but the onebox removes this identation for a some reason.

3 Likes

Fixed via:

https://github.com/discourse/onebox/commit/13af35fcc321ebdfac557ee3caaaf257800fdd69


Example:

https://github.com/magento/magento2/blob/958164/lib/internal/Magento/Framework/EntityManager/EntityHydratorInterface.php#L12-L30

5 Likes