emmetio / emmet-atom

Emmet support for Atom
MIT License
764 stars 179 forks source link

Uncaught ParseError: CSS parsing error at line 3, char 9: Unrecognized character ' '   ba... #434

Open Meligy opened 8 years ago

Meligy commented 8 years ago

[Enter steps to reproduce below:

  1. Open Atom
  2. Change language mode to SCSS
  3. Paste some CSS code
  4. Try to press TAB to intend code

Atom Version: 1.8.0-beta3 System: Mac OS X 10.11.5 Thrown From: emmet package, v2.4.3

Stack Trace

Uncaught ParseError: CSS parsing error at line 3, char 9: Unrecognized character ' '   background-color: #379e0f ; --------^

At /Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:833

ParseError: CSS parsing error at line 3, char 9: Unrecognized character ' '
          background-color: #379e0f  ;
--------^
    at raiseError (/Users/Meligy/.atom/packages/emmet/node_modules/emmet/lib/parser/css.js:111:16)
    at tokenize (/Users/Meligy/.atom/packages/emmet/node_modules/emmet/lib/parser/css.js:369:3)
    at Object.lex (/Users/Meligy/.atom/packages/emmet/node_modules/emmet/lib/parser/css.js:387:6)
    at Object.parse (/Users/Meligy/.atom/packages/emmet/node_modules/emmet/lib/parser/css.js:405:22)
    at extractPropertiesFromSource (/Users/Meligy/.atom/packages/emmet/node_modules/emmet/lib/editTree/css.js:246:26)
    at consumeProperties (/Users/Meligy/.atom/packages/emmet/node_modules/emmet/lib/editTree/css.js:217:14)
    at [object Object].editTree.EditContainer.extend.initialize (/Users/Meligy/.atom/packages/emmet/node_modules/emmet/lib/editTree/css.js:316:4)
    at [object Object].EditContainer (/Users/Meligy/.atom/packages/emmet/node_modules/emmet/lib/editTree/base.js:66:19)
    at new child (/Users/Meligy/.atom/packages/emmet/node_modules/emmet/lib/vendor/klass.js:35:12)
    at Object.parse (/Users/Meligy/.atom/packages/emmet/node_modules/emmet/lib/editTree/css.js:550:11)
    at Object.parseFromPosition (/Users/Meligy/.atom/packages/emmet/node_modules/emmet/lib/editTree/css.js:566:16)
    at Object.propertyFromPosition (/Users/Meligy/.atom/packages/emmet/node_modules/emmet/lib/editTree/css.js:580:49)
    at Object.module.exports.gradientsFromCSSProperty (/Users/Meligy/.atom/packages/emmet/node_modules/emmet/lib/resolver/cssGradient.js:335:30)
    at Object.module.exports.expandAbbreviationHandler (/Users/Meligy/.atom/packages/emmet/node_modules/emmet/lib/resolver/cssGradient.js:365:25)
    at /Users/Meligy/.atom/packages/emmet/node_modules/emmet/lib/assets/handlerList.js:93:19
    at /Users/Meligy/.atom/packages/emmet/node_modules/emmet/lib/utils/common.js:600:10
    at Array.some (native)
    at Object.find (/Users/Meligy/.atom/packages/emmet/node_modules/emmet/lib/utils/common.js:599:9)
    at Object.HandlerList.exec (/Users/Meligy/.atom/packages/emmet/node_modules/emmet/lib/assets/handlerList.js:92:10)
    at Object.expandAbbreviationAction (/Users/Meligy/.atom/packages/emmet/node_modules/emmet/lib/action/expandAbbreviation.js:110:20)
    at Object.expandAbbreviationWithTabAction (/Users/Meligy/.atom/packages/emmet/node_modules/emmet/lib/action/expandAbbreviation.js:140:14)
    at Object.run (/Users/Meligy/.atom/packages/emmet/node_modules/emmet/lib/action/main.js:150:21)
    at Object.run (/Users/Meligy/.atom/packages/emmet/node_modules/emmet/lib/emmet.js:81:23)
    at runAction (/Users/Meligy/.atom/packages/emmet/lib/emmet.coffee:94:9)
    at /Users/Meligy/.atom/packages/emmet/lib/emmet.coffee:62:9
    at Object.module.exports.exec (/Users/Meligy/.atom/packages/emmet/lib/editor-proxy.coffee:80:10)
    at /Users/Meligy/.atom/packages/emmet/lib/emmet.coffee:61:19
    at TextBuffer.module.exports.TextBuffer.transact (/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:828:18)
    at TextEditor.module.exports.TextEditor.transact (/Applications/Atom Beta.app/Contents/Resources/app.asar/src/text-editor.js:1328:26)
    at atom-text-editor.<anonymous> (/Users/Meligy/.atom/packages/emmet/lib/emmet.coffee:60:24)

Commands

     -0:24.1.0 snippets:expand (atom-text-editor.editor.is-focused)
     -0:24.1.0 emmet:expand-abbreviation-with-tab (atom-text-editor.editor.is-focused)
     -0:23.3.0 snippets:expand (atom-text-editor.editor.is-focused)
     -0:23.3.0 emmet:expand-abbreviation-with-tab (atom-text-editor.editor.is-focused)
  2x -0:22.8.0 core:backspace (atom-text-editor.editor.is-focused)
     -0:22 snippets:expand (atom-text-editor.editor.is-focused)
     -0:22 emmet:expand-abbreviation-with-tab (atom-text-editor.editor.is-focused)
     -0:20.8.0 core:backspace (atom-text-editor.editor.is-focused)
     -0:17.4.0 editor:newline (atom-text-editor.editor.is-focused)
  2x -0:13.9.0 core:backspace (atom-text-editor.editor.is-focused)
     -0:10.3.0 core:move-up (atom-text-editor.editor.is-focused)
  2x -0:06.5.0 core:backspace (atom-text-editor.editor.is-focused)
  3x -0:02.6.0 editor:move-to-beginning-of-word (atom-text-editor.editor.is-focused)
  7x -0:01.9.0 core:move-left (atom-text-editor.editor.is-focused)
     -0:00.5.0 snippets:expand (atom-text-editor.editor.is-focused)
     -0:00.5.0 emmet:expand-abbreviation-with-tab (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "themes": [
      "redmond-ui",
      "redmond-syntax"
    ]
  }
}

Installed Packages

# User
atom-typescript, v8.8.1
autocomplete-paths, v1.0.2
autocomplete-project-paths, v2.2.0
emmet, v2.4.3
emmet-snippets-compatibility, v1.0.6
file-icons, v1.7.3
linter, v1.11.4
markdown-scroll-sync, v2.1.2
redmond-syntax, v0.2.18
redmond-ui, v0.1.5

# Dev
No dev packages

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Meligy commented 8 years ago

For the record, here's the code that broke it -- I was formatting, reviewing, and refactoring it:

.section-footer-pager .active{
  font-size: 13px;
  border: 1px solid #999999  ;
  padding: 3px 9px;
  margin: 0;
  border-radius: 5px;
  background-color: #379e0f  ;
    color: #fff;
}

.section-footer-pager a{
  font-size: 13px;
  border: 1px solid #999999  ;
  padding: 3px 9px;
  margin: 0;
  border-radius: 5px;
  background-color: #lightgreen;
}