From 3f753da6277568d5902827ad1b5cec48433c7570 Mon Sep 17 00:00:00 2001 From: cloudhead Date: Thu, 25 Feb 2010 21:29:21 -0500 Subject: [PATCH] ability to parse more complex directives --- lib/less/parser.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/less/parser.js b/lib/less/parser.js index 5423132..19d101c 100644 --- a/lib/less/parser.js +++ b/lib/less/parser.js @@ -378,12 +378,17 @@ less.parser = { } }, directive: function directive(root) { - var name, value, rules; + var name, value, rules, types; if (input[i] !== '@') return; - if (name = $(/@[a-z]+/g)) { - if (name === '@media' || name === '@font-face') { + if (name = $(/@media|@page/g)) { + types = $(/[a-z:, ]+/g); + if (rules = $(this.block, root)) { + return new(node.Directive)(name + " " + types, rules); + } + } else if (name = $(/@[-a-z]+/g)) { + if (name === '@font-face') { if (rules = $(this.block, root)) { return new(node.Directive)(name, rules); }