auto-component 0.0.21 → 0.0.23
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/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState, useEffect } from 'react'
|
|
2
|
-
import beautify from 'js-beautify';
|
|
2
|
+
// import beautify from 'js-beautify';
|
|
3
3
|
import './auto-component.css'
|
|
4
4
|
|
|
5
5
|
const AutoComponent = ({ exclusions }) => {
|
|
@@ -34,13 +34,13 @@ const AutoComponent = ({ exclusions }) => {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
// format html for display (breaks/indentation)
|
|
37
|
-
const formatHtml = (html) => {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
37
|
+
// const formatHtml = (html) => {
|
|
38
|
+
// return beautify.html(html, {
|
|
39
|
+
// indent_size: 2,
|
|
40
|
+
// wrap_line_length: 80,
|
|
41
|
+
// max_preserve_newlines: 1,
|
|
42
|
+
// })
|
|
43
|
+
// }
|
|
44
44
|
|
|
45
45
|
// clean html of exclusions:
|
|
46
46
|
// if an element className includes 'exclude'
|
|
@@ -53,7 +53,8 @@ const AutoComponent = ({ exclusions }) => {
|
|
|
53
53
|
const cleanedHtml = html.replace(regexExcludeClass, '$1$3');
|
|
54
54
|
const scriptIndex = cleanedHtml.lastIndexOf('<script');
|
|
55
55
|
|
|
56
|
-
return formatHtml(cleanedHtml.substring(0, scriptIndex));
|
|
56
|
+
// return formatHtml(cleanedHtml.substring(0, scriptIndex));
|
|
57
|
+
return cleanedHtml.substring(0, scriptIndex);
|
|
57
58
|
};
|
|
58
59
|
|
|
59
60
|
// full exclusion
|