Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issue with indentation in HAML-"rest of document was indented using 2 spaces"

I would have posted this in a Github Gist or using Tinkerbin, but the indentation appears WAY off when I copy and paste my HAML.

The error message is: Inconsistent indentation: "\t\t " was used for indentation, but the rest of the document was indented using 2 spaces.

I posted an imgur to show you where the error is happening, the browser is telling me line 8, as you can see in the photo.

Bear with me, this is probably an easy fix but I am very new to HAML.

haml indentaion issue

like image 576
Nubtacular Avatar asked Dec 06 '22 14:12

Nubtacular


2 Answers

If you're using SublimeText, add the following to Packages/User/Preferences.sublime-settings

"tab_size": 2,
"translate_tabs_to_spaces": true

... then re-paste the code and all tabs will be changed to spaces.

like image 50
Chris Lewis Avatar answered Feb 14 '23 23:02

Chris Lewis


I think you should use either space or tab, or you can select all and convert into spaces once finish your code, SUBLIME text editor is best for it

like image 20
Chandrakant Avatar answered Feb 14 '23 21:02

Chandrakant