@dimer47/capacitor-plugin-printer 2.0.1 → 2.0.2

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.
@@ -28,7 +28,7 @@ class PrintContent private constructor(ctx: Context) {
28
28
  }
29
29
 
30
30
  private fun getContentType(path: String?, forcedMimeType: String? = null): ContentType {
31
- if (path == null || path.isEmpty() || path.startsWith("<")) {
31
+ if (path == null || path.isEmpty() || path.trimStart().startsWith("<")) {
32
32
  return ContentType.HTML
33
33
  }
34
34
 
@@ -186,7 +186,7 @@ public class PrinterPlugin: CAPPlugin, CAPBridgedPlugin, UIPrintInteractionContr
186
186
  item = webView.viewPrintFormatter()
187
187
  }
188
188
  }
189
- } else if let content = content, content.hasPrefix("<") {
189
+ } else if let content = content, content.trimmingCharacters(in: .whitespacesAndNewlines).hasPrefix("<") {
190
190
  DispatchQueue.main.sync {
191
191
  item = UIMarkupTextPrintFormatter(markupText: content)
192
192
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dimer47/capacitor-plugin-printer",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Capacitor plugin for printing HTML, PDF, images and plain text on iOS and Android",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",