From 5eb933d6c001caf7e9cba0339165f59819f79728 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Mon, 8 Apr 2013 20:30:34 +0100 Subject: Store styleName directly on paragraph --- lib/documents.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lib/documents.js') diff --git a/lib/documents.js b/lib/documents.js index d1c1e03..af416da 100644 --- a/lib/documents.js +++ b/lib/documents.js @@ -5,9 +5,18 @@ function Document(children) { }; } -Paragraph = ElementWithChildren("paragraph"); Run = ElementWithChildren("run"); +function Paragraph(children, properties) { + properties = properties || {}; + return { + type: "paragraph", + children: children, + styleName: properties.styleName, + properties: properties + }; +} + function Text(value) { return { type: "text", -- cgit v1.2.3