richthegeek / phpsass

A compiler for SASS/SCSS written in PHP, brought up to date (approx 3.2) from a fork of PHamlP: http://code.google.com/p/phamlp/
http://phpsass.com/
382 stars 83 forks source link

sass source map line number not calculated correctly #75

Open ZiggyQubert opened 11 years ago

ZiggyQubert commented 11 years ago

Two issues I have found -

  1. the line number that is written is not in a format compatible with chromes sass source map, it is expecting something like \0000310 instead of just the line number

I fixed this on my system by changing line 115 of SassCompactRender to - $debug .= 'line{' . self::DEBUG_INFO_PROPERTY . ":\00003{$node->line};}";

this works with chrome and the chrome sass properties extension I also changed line 114 to $debug .= 'filename{' . self::DEBUG_INFO_PROPERTY . ':' . preg_replace('/([^-\w])/', '\\1', "file://{$node->filename}") . '}';

to remove an exteranious semicollon from the end of the file name

  1. Line comments (// comments no /* */ comments) included in the source sass file do not incriment the line number for debug information, so it winds up being inacurate