rtf-parser
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "rtf-parser", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "This is a general RTF parser. It takes a text stream and produces a document object representing the parsed document. In and of itself, this isn't super useful but it's the building block for other tools to convert RTF into other formats.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -72,3 +72,4 @@ # rtf-parser | ||
* marginLeft, marginRight, marginBottom, marginTop — the margins for this document. | ||
* marginLeft, marginRight, marginBottom, marginTop — the margins for this document. These are in | ||
twips, which are one twentieth of a point. | ||
* content — An array of RTFParagraph objects | ||
@@ -75,0 +76,0 @@ |
@@ -21,4 +21,4 @@ 'use strict' | ||
strikethrough: false, | ||
foreground: 0, | ||
background: 0, | ||
foreground: null, | ||
background: null, | ||
firstLineIndent: 0, | ||
@@ -49,2 +49,8 @@ indent: 0, | ||
super.addContent(node) | ||
if (node.content.length) { | ||
node.style = Object.assign({}, node.content[0].style) | ||
node.style.font = this.getFont(node.style.font) | ||
node.style.foreground = this.getColor(node.style.foreground) | ||
node.style.background = this.getColor(node.style.background) | ||
} | ||
} else { | ||
@@ -51,0 +57,0 @@ super.addContent(node) |
@@ -32,5 +32,5 @@ 'use strict' | ||
node.style = Object.assign({}, this.getStyle()) | ||
node.style.font = this.getFont(node.style.font) || defaultFont | ||
node.style.foreground = this.getColor(node.style.foreground) || defaultColor | ||
node.style.background = this.getColor(node.style.background) || defaultColor | ||
node.style.font = this.getFont(node.style.font) | ||
node.style.foreground = this.getColor(node.style.foreground) | ||
node.style.background = this.getColor(node.style.background) | ||
this.content.push(node) | ||
@@ -37,0 +37,0 @@ } |
@@ -108,3 +108,3 @@ 'use strict' | ||
ctrl$qj () { | ||
this.group.style.align = 'justified' | ||
this.group.style.align = 'justify' | ||
} | ||
@@ -152,3 +152,3 @@ ctrl$ql () { | ||
ctrl$strike (set) { | ||
this.group.style.strike = set !== 0 | ||
this.group.style.strikethrough = set !== 0 | ||
} | ||
@@ -263,9 +263,9 @@ ctrl$ul (set) { | ||
ctrl$cf (value) { | ||
this.group.foreground = value | ||
this.group.style.foreground = value | ||
} | ||
ctrl$cb (value) { | ||
this.group.background = value | ||
this.group.style.background = value | ||
} | ||
ctrl$fs (value) { | ||
this.group.fontSize = value | ||
this.group.style.fontSize = value | ||
} | ||
@@ -272,0 +272,0 @@ |
@@ -6,3 +6,2 @@ 'use strict' | ||
if (!opts) opts = {} | ||
this.value = '\n' | ||
this.style = opts.style || {} | ||
@@ -9,0 +8,0 @@ this.content = [] |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23263
10
624
98