From 44175322d76505ac732435876464fe1f17005ad2 Mon Sep 17 00:00:00 2001 From: bob Date: Mon, 16 Sep 2019 13:11:29 -0400 Subject: show title and parse font size changes --- src/new_fields/RichTextUtils.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/new_fields') diff --git a/src/new_fields/RichTextUtils.ts b/src/new_fields/RichTextUtils.ts index ff28e6861..9b6e55948 100644 --- a/src/new_fields/RichTextUtils.ts +++ b/src/new_fields/RichTextUtils.ts @@ -413,7 +413,7 @@ export namespace RichTextUtils { let matches: RegExpExecArray | null; if ((matches = /p(\d+)/g.exec(markName)) !== null) { converted = "fontSize"; - value = { magnitude: parseInt(matches[1]), unit: "PT" }; + value = { magnitude: parseInt(matches[1].replace("px", "")), unit: "PT" }; } textStyle[converted] = value; } @@ -421,10 +421,11 @@ export namespace RichTextUtils { requests.push(EncodeStyleUpdate(information)); } if (node.type.name === "image") { + const width = attrs.width; requests.push(await EncodeImage({ startIndex: position + nodeSize - 1, uri: attrs.src, - width: attrs.width + width: Number(typeof width === "string" ? width.replace("px", "") : width) })); } position += nodeSize; -- cgit v1.2.3-70-g09d2