pptxtojson 1.3.2 → 1.5.0

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/src/utils.js CHANGED
@@ -151,7 +151,10 @@ export function toHex(n) {
151
151
  }
152
152
 
153
153
  export function hasValidText(htmlString) {
154
- if (!DOMParser) return true
154
+ if (typeof DOMParser === 'undefined') {
155
+ const text = htmlString.replace(/<[^>]+>/g, '').replace(/\s+/g, ' ')
156
+ return text.trim() !== ''
157
+ }
155
158
 
156
159
  const parser = new DOMParser()
157
160
  const doc = parser.parseFromString(htmlString, 'text/html')