@flourish/layout
Advanced tools
| import { addHttp } from "./utils.js"; | ||
| import { expect } from "chai"; | ||
| describe("addHttp", () => { | ||
| it("passes through http:// URLs unchanged", () => { | ||
| expect(addHttp("http://example.com/image.png")).eq( | ||
| "http://example.com/image.png", | ||
| ); | ||
| }); | ||
| it("passes through https:// URLs unchanged", () => { | ||
| expect(addHttp("https://example.com/image.png")).eq( | ||
| "https://example.com/image.png", | ||
| ); | ||
| }); | ||
| it("passes through cached-assets/ paths unchanged", () => { | ||
| expect(addHttp("cached-assets/abc123.png")).eq("cached-assets/abc123.png"); | ||
| expect(addHttp("cached-assets/abc123.woff2")).eq( | ||
| "cached-assets/abc123.woff2", | ||
| ); | ||
| }); | ||
| it("prepends http:// to bare URLs", () => { | ||
| expect(addHttp("example.com/image.png")).eq("http://example.com/image.png"); | ||
| }); | ||
| }); |
+3
-3
| { | ||
| "name": "@flourish/layout", | ||
| "type": "module", | ||
| "version": "8.8.0", | ||
| "version": "8.8.1", | ||
| "private": false, | ||
@@ -50,5 +50,5 @@ "description": "Flourish module to control layouts", | ||
| "@flourish/number-formatter": "^2.0.0", | ||
| "@flourish/interpreter": "^9.3.0", | ||
| "@flourish/utils-color": "^2.0.0", | ||
| "@flourish/interpreter": "^9.3.0", | ||
| "@flourish/pocket-knife": "^2.3.0" | ||
| "@flourish/pocket-knife": "^2.3.1" | ||
| }, | ||
@@ -55,0 +55,0 @@ "exports": "./src/index.js", |
+3
-0
@@ -0,1 +1,4 @@ | ||
| # 8.8.1 | ||
| * Fix logo images not rendering in standalone downloads | ||
| # 8.8.0 | ||
@@ -2,0 +5,0 @@ * Change the default formatting for floating point numbers to remove non-significant trailing zeros while keeping two-decimal rounding |
+4
-0
@@ -5,2 +5,3 @@ - Layout | ||
| type: font | ||
| cacheable_for_standalone_downloads: true | ||
| width: three quarters | ||
@@ -343,2 +344,3 @@ description: This font will apply to the whole graphic by default. You can optionally change the font for the title, subtitle, footer, etc in the Header and Footer settings panels. | ||
| type: font | ||
| cacheable_for_standalone_downloads: true | ||
| show_if: title_styling | ||
@@ -435,2 +437,3 @@ optional: true | ||
| type: font | ||
| cacheable_for_standalone_downloads: true | ||
| show_if: subtitle_styling | ||
@@ -755,2 +758,3 @@ optional: true | ||
| type: font | ||
| cacheable_for_standalone_downloads: true | ||
| name: Font | ||
@@ -757,0 +761,0 @@ optional: true |
+7
-3
@@ -28,7 +28,11 @@ var window_width, base_size; | ||
| function addHttp(url) { | ||
| if (url.indexOf("http://") !== 0 && url.indexOf("https://") !== 0) | ||
| return "http://" + url; | ||
| else return url; | ||
| if ( | ||
| url.startsWith("http://") || | ||
| url.startsWith("https://") || | ||
| url.startsWith("cached-assets/") | ||
| ) | ||
| return url; | ||
| return "http://" + url; | ||
| } | ||
| export { remToPx, getJustifyContent, getTextAlign, addHttp }; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Unidentified License
LicenseSomething that seems like a license was found, but its contents could not be matched with a known license.
Found 2 instances in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Unidentified License
LicenseSomething that seems like a license was found, but its contents could not be matched with a known license.
Found 2 instances in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
447925
0.09%28
3.7%8594
0.24%