@rr0/cms 0.3.24 → 0.3.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ImageCommand.js
CHANGED
|
@@ -7,7 +7,7 @@ import { imageSizeFromFile } from "image-size/fromFile";
|
|
|
7
7
|
*/
|
|
8
8
|
export class ImageCommand extends DomReplaceCommand {
|
|
9
9
|
constructor(outBaseDir, maxWidth, maxHeight, baseUrl = "") {
|
|
10
|
-
super("img", undefined);
|
|
10
|
+
super("img:not(.raw)", undefined);
|
|
11
11
|
this.outBaseDir = outBaseDir;
|
|
12
12
|
this.maxWidth = maxWidth;
|
|
13
13
|
this.maxHeight = maxHeight;
|
|
@@ -39,6 +39,7 @@ export declare class OpenGraphCommand implements ReplaceCommand<HtmlRR0Context>
|
|
|
39
39
|
* @private
|
|
40
40
|
*/
|
|
41
41
|
protected drawGradient(canvasCtx: CanvasRenderingContext2D, widthRatio: number, startColor?: string, endColor?: string): void;
|
|
42
|
+
readonly supportedFiles = "img[src$='.png'],img[src$='.jpg'],img[src$='.gif']";
|
|
42
43
|
/**
|
|
43
44
|
* Draw a height-scaled image on the right of the canvas.
|
|
44
45
|
*
|
package/dist/OpenGraphCommand.js
CHANGED
|
@@ -15,6 +15,7 @@ export class OpenGraphCommand {
|
|
|
15
15
|
this.width = width;
|
|
16
16
|
this.height = height;
|
|
17
17
|
this.num = 0;
|
|
18
|
+
this.supportedFiles = "img[src$='.png'],img[src$='.jpg'],img[src$='.gif']";
|
|
18
19
|
}
|
|
19
20
|
async execute(context) {
|
|
20
21
|
const title = context.file.title;
|
|
@@ -152,7 +153,7 @@ export class OpenGraphCommand {
|
|
|
152
153
|
*/
|
|
153
154
|
async drawImage(context, canvasCtx, dy = 0) {
|
|
154
155
|
const outDoc = context.file.document;
|
|
155
|
-
const docImages = outDoc.documentElement.
|
|
156
|
+
const docImages = outDoc.documentElement.querySelectorAll(this.supportedFiles);
|
|
156
157
|
let widthRatio = 0.5;
|
|
157
158
|
let imageIndex = 0;
|
|
158
159
|
if (imageIndex < docImages.length) {
|
|
@@ -54,7 +54,7 @@ export class PeopleHtmlRenderer {
|
|
|
54
54
|
titles.push(occupationMsg(gender));
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
const text = content || people.lastAndFirstName;
|
|
57
|
+
const text = content || people.lastAndFirstName || people.title;
|
|
58
58
|
const doc = context.file.document;
|
|
59
59
|
const link = doc.createElement("a");
|
|
60
60
|
link.innerHTML = text;
|
package/package.json
CHANGED