Extend the HTML rendering mechanism to support attributes specified as macro invocations

This commit is contained in:
Jeremy Ruston
2013-06-18 15:37:19 +01:00
parent 18f8b7266e
commit 12b471b8fb
7 changed files with 87 additions and 57 deletions

View File

@@ -190,13 +190,13 @@ exports.parseMacroParameter = function(source,pos) {
};
/*
Look for a macro invocation. Returns null if not found, or {type: "macro-invocation", name:, parameters:, start:, end:}
Look for a macro invocation. Returns null if not found, or {type: "macrocall", name:, parameters:, start:, end:}
*/
exports.parseMacroInvocation = function(source,pos) {
var node = {
type: "macro-invocation",
type: "macrocall",
start: pos,
parameters: []
params: []
}
// Define our regexps
var reMacroName = /([^\s>"'=]+)/g;
@@ -218,7 +218,7 @@ exports.parseMacroInvocation = function(source,pos) {
// Process parameters
var parameter = this.parseMacroParameter(source,pos);
while(parameter) {
node.parameters.push(parameter);
node.params.push(parameter);
pos = parameter.end;
// Get the next parameter
parameter = this.parseMacroParameter(source,pos);