From 9b3366feb05a6406fe8cc8de64b92ec107bc74a4 Mon Sep 17 00:00:00 2001 From: wwwildcat Date: Thu, 19 Nov 2020 13:08:32 +0300 Subject: [PATCH] Add support for some special character (such as em dash, en dash, single and double quotes) control words --- rtf-interpreter.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/rtf-interpreter.js b/rtf-interpreter.js index 09a89dd..a266995 100644 --- a/rtf-interpreter.js +++ b/rtf-interpreter.js @@ -143,6 +143,36 @@ class RTFInterpreter extends Writable { this.group.addContent(new RTFSpan({ value: '\t' })) } + // en dash + ctrl$endash () { + this.group.addContent(new RTFSpan({ value: '\u2013' })) + } + + // em dash + ctrl$emdash () { + this.group.addContent(new RTFSpan({ value: '\u2014' })) + } + + // left single quote + ctrl$lquote () { + this.group.addContent(new RTFSpan({ value: '\u2018' })) + } + + // right single quote + ctrl$rquote () { + this.group.addContent(new RTFSpan({ value: '\u2019' })) + } + + // left double quote + ctrl$ldblquote () { + this.group.addContent(new RTFSpan({ value: '\u201c' })) + } + + // right double quote + ctrl$rdblquote () { + this.group.addContent(new RTFSpan({ value: '\u201d' })) + } + // alignment ctrl$qc () { this.group.style.align = 'center'