diff --git a/manifest.json b/manifest.json index 515ebd1..13fee1a 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "name": "JDN", "description": "", "devtools_page": "index.html", - "version": "3.0.42", + "version": "3.0.43", "permissions": [ "activeTab", "tabs", diff --git a/package.json b/package.json index 1d3e0a0..0cf35e6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jdi-react-extension", - "version": "3.0.42", + "version": "3.0.43", "description": "jdi react extension", "scripts": { "start": "npm run webpack", diff --git a/src/js/blocks/autoFind/autoFindProvider/pageObject.js b/src/js/blocks/autoFind/autoFindProvider/pageObject.js index 78d5fa4..31b021f 100644 --- a/src/js/blocks/autoFind/autoFindProvider/pageObject.js +++ b/src/js/blocks/autoFind/autoFindProvider/pageObject.js @@ -1,6 +1,7 @@ import { camelCase } from "../../../models/GenerateBlockModel"; import { getJDILabel } from "./generationClassesMap"; import { connector } from "./connector"; +import { startsWith } from "lodash"; const getPackage = (url) => { const urlObject = new URL(url); @@ -25,18 +26,19 @@ export const predictedToConvert = (elements) => { return f.map((e, i) => { let elementName = getElementName(e); - let elementTagId = e.predictedAttrId; - let customElementName = e.jdi_custom_class_name; + let elementTagId = e.predictedAttrId.replaceAll(" ", ""); + elementTagId = startsWith(elementTagId, '^[0-9].+$') ? `name${elementTagId}` : elementTagId; + const customElementName = e.jdi_custom_class_name; if (uniqueNames.indexOf(elementName) >= 0) elementName += i; if (elementTagId && uniqueNames.indexOf(elementTagId) >= 0) elementTagId += i; uniqueNames.push(elementTagId, elementName); - const name = customElementName - ? customElementName - : elementTagId - ? elementTagId - : elementName; + const name = customElementName ? + customElementName : + elementTagId ? + elementTagId : + elementName; return { ...e,