diff options
| author | bob <bcz@cs.brown.edu> | 2019-09-16 13:11:29 -0400 |
|---|---|---|
| committer | bob <bcz@cs.brown.edu> | 2019-09-16 13:11:29 -0400 |
| commit | 44175322d76505ac732435876464fe1f17005ad2 (patch) | |
| tree | 2060cb68cfb436103329de8d24714afc57b79698 /src/new_fields | |
| parent | 36a4caa28a7a83823027e6f0af47ffb1878ae86b (diff) | |
show title and parse font size changes
Diffstat (limited to 'src/new_fields')
| -rw-r--r-- | src/new_fields/RichTextUtils.ts | 5 |
1 files changed, 3 insertions, 2 deletions
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; |
