rtf-parser
Advanced tools
Comparing version 1.2.0 to 1.3.0
@@ -5,2 +5,18 @@ # Change Log | ||
<a name="1.3.0"></a> | ||
# [1.3.0](https://github.com/iarna/rtf-parser/compare/v1.2.0...v1.3.0) (2018-07-08) | ||
### Bug Fixes | ||
* **nulls:** If a file is null terminated, don't emit the null ([7eee9a2](https://github.com/iarna/rtf-parser/commit/7eee9a2)), closes [#5](https://github.com/iarna/rtf-parser/issues/5) | ||
### Features | ||
* **fragments:** Add RTF fragment support ([a3fb225](https://github.com/iarna/rtf-parser/commit/a3fb225)), closes [#8](https://github.com/iarna/rtf-parser/issues/8) | ||
* **line:** Add support for rtf \line command ([1ebda17](https://github.com/iarna/rtf-parser/commit/1ebda17)), closes [#9](https://github.com/iarna/rtf-parser/issues/9) | ||
<a name="1.2.0"></a> | ||
@@ -7,0 +23,0 @@ # [1.2.0](https://github.com/iarna/rtf-parser/compare/v1.1.0...v1.2.0) (2018-07-07) |
{ | ||
"name": "rtf-parser", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"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", |
@@ -36,2 +36,5 @@ # rtf-parser | ||
RTF fragments are supported. `\b hi there\b0` will generate a document with | ||
`hi there` flagged as bold text. | ||
The document returned is of the `RTFDocument` class, see below for details. | ||
@@ -38,0 +41,0 @@ |
@@ -55,3 +55,3 @@ 'use strict' | ||
while (this.groupStack.length) this.cmd$groupEnd() | ||
const initialStyle = this.doc.content[0].style | ||
const initialStyle = this.doc.content.length ? this.doc.content[0].style : [] | ||
for (let prop of Object.keys(this.doc.style)) { | ||
@@ -110,2 +110,5 @@ let match = true | ||
this.flushHexStore() | ||
if (!this.group) { // an RTF fragment, missing the {\rtf1 header | ||
this.group = this.doc | ||
} | ||
this.group.addContent(new RTFSpan(cmd)) | ||
@@ -131,2 +134,7 @@ } | ||
// new line | ||
ctrl$line () { | ||
this.group.addContent(new RTFSpan({ value: '\n' })) | ||
} | ||
// alignment | ||
@@ -133,0 +141,0 @@ ctrl$qc () { |
@@ -31,3 +31,3 @@ 'use strict' | ||
_flush (done) { | ||
this.emitText() | ||
if (this.text !== '\u0000') this.emitText() | ||
done() | ||
@@ -34,0 +34,0 @@ } |
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
26597
718
103