|
1 | | -import escapeHtml from "escape-html"; |
2 | 1 | import { FaviconHtmlTag } from "../index"; |
3 | 2 | import { FaviconOptions, NamedIconOptions } from "../config/defaults"; |
4 | 3 | import { opaqueIcon } from "../config/icons"; |
@@ -33,33 +32,41 @@ export class AppleIconPlatform extends Platform { |
33 | 32 | .filter(({ name }) => /\d/.test(name)) // with a size in a name |
34 | 33 | .map((options) => { |
35 | 34 | const { width, height } = options.sizes[0]; |
36 | | - return new FaviconHtmlTag("link", { |
37 | | - rel: "apple-touch-icon", |
38 | | - sizes: `${width}x${height}`, |
39 | | - href: this.cacheBusting(this.relative(options.name)), |
40 | | - }); |
| 35 | + return { |
| 36 | + tag: "link", |
| 37 | + attrs: { |
| 38 | + rel: "apple-touch-icon", |
| 39 | + sizes: `${width}x${height}`, |
| 40 | + href: this.cacheBusting(this.relative(options.name)), |
| 41 | + }, |
| 42 | + }; |
41 | 43 | }); |
42 | 44 |
|
43 | 45 | const name = this.options.appShortName || this.options.appName; |
44 | 46 |
|
45 | 47 | return [ |
46 | 48 | ...icons, |
47 | | - new FaviconHtmlTag("meta", { |
48 | | - name: "apple-mobile-web-app-capable", |
49 | | - content: "yes", |
50 | | - }), |
51 | | - new FaviconHtmlTag("meta", { |
52 | | - name: "apple-mobile-web-app-status-bar-style", |
53 | | - content: this.options.appleStatusBarStyle, |
54 | | - }), |
55 | | - name |
56 | | - ? new FaviconHtmlTag("meta", { |
57 | | - name: "apple-mobile-web-app-title", |
58 | | - content: escapeHtml(name), |
59 | | - }) |
60 | | - : new FaviconHtmlTag("meta", { |
61 | | - name: "apple-mobile-web-app-title", |
62 | | - }), |
| 49 | + { |
| 50 | + tag: "meta", |
| 51 | + attrs: { |
| 52 | + name: "apple-mobile-web-app-capable", |
| 53 | + content: "yes", |
| 54 | + }, |
| 55 | + }, |
| 56 | + { |
| 57 | + tag: "meta", |
| 58 | + attrs: { |
| 59 | + name: "apple-mobile-web-app-status-bar-style", |
| 60 | + content: this.options.appleStatusBarStyle, |
| 61 | + }, |
| 62 | + }, |
| 63 | + { |
| 64 | + tag: "meta", |
| 65 | + attrs: { |
| 66 | + name: "apple-mobile-web-app-title", |
| 67 | + content: name || false, |
| 68 | + }, |
| 69 | + }, |
63 | 70 | ]; |
64 | 71 | } |
65 | 72 | } |
0 commit comments