diff --git a/package.json b/package.json index 94bd2bf6..0ec39110 100644 --- a/package.json +++ b/package.json @@ -46,9 +46,9 @@ "@emotion/react": "^11.11.1", "@emotion/styled": "^11.11.0", "@mui/material": "^5.14.9", + "@types/geojson": "^7946.0.10", "ajv": "^8.12.0", "ajv-formats": "^2.1.1", - "@types/geojson": "^7946.0.10", "docx": "^8.2.2", "eslint": "^8.49.0", "fast-xml-parser": "^4.2.7", @@ -69,6 +69,7 @@ "prettier": "^3.0.3", "react": "^18.2.0", "react-dom": "^18.2.0", + "striptags": "^3.2.0", "type-fest": "^4.3.1", "uuid": "^9.0.1", "zod": "^3.22.2" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1739eea7..e0587ee8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -83,6 +83,9 @@ dependencies: react-dom: specifier: ^18.2.0 version: 18.2.0(react@18.2.0) + striptags: + specifier: ^3.2.0 + version: 3.2.0 type-fest: specifier: ^4.3.1 version: 4.3.1 @@ -5359,6 +5362,10 @@ packages: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} + /striptags@3.2.0: + resolution: {integrity: sha512-g45ZOGzHDMe2bdYMdIvdAfCQkCTDMGBazSw1ypMowwGIee7ZQ5dU0rBJ8Jqgl+jAKIv4dbeE1jscZq9wid1Tkw==} + dev: false + /strnum@1.0.5: resolution: {integrity: sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==} dev: false diff --git a/src/export/bops/index.ts b/src/export/bops/index.ts index 6a27fd59..3f1a8500 100644 --- a/src/export/bops/index.ts +++ b/src/export/bops/index.ts @@ -1,5 +1,6 @@ import isEmpty from "lodash.isempty"; import isNil from "lodash.isnil"; +import striptags from "striptags"; import { getResultData } from "../../models/result"; import { sortBreadcrumbs } from "../../models/session/logic"; @@ -244,7 +245,7 @@ export function formatProposalDetails({ if (node.data?.policyRef) { metadata.policy_refs = [ // remove html tags - { text: node.data?.policyRef?.replace(/<[^>]*>/g, "").trim() }, + { text: striptags(node.data?.policyRef) }, ]; } return metadata;