Skip to content

Commit

Permalink
1761 - add and use decode-html to decode characters like < and > when…
Browse files Browse the repository at this point in the history
… saving mention input
  • Loading branch information
kresimir-coko committed Nov 28, 2024
1 parent 6d1080f commit ffdbcb4
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
17 changes: 17 additions & 0 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
"d3-timer": "^3.0.1",
"date-fns": "^4.1.0",
"fetch-intercept": "^2.4.0",
"html-entities": "^2.5.2",
"i18next": "^24.0.2",
"lucide-react": "^0.461.0",
"monaco-editor": "^0.52.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {ArrayPropertyType, PropertyAllType} from '@/shared/types';
import {QuestionMarkCircledIcon} from '@radix-ui/react-icons';
import {TooltipPortal} from '@radix-ui/react-tooltip';
import {usePrevious} from '@uidotdev/usehooks';
import {decode} from 'html-entities';
import resolvePath from 'object-resolve-path';
import {ChangeEvent, KeyboardEvent, ReactNode, useEffect, useRef, useState} from 'react';
import {Control, Controller, FieldValues, FormState} from 'react-hook-form';
Expand Down Expand Up @@ -323,6 +324,10 @@ const Property = ({
})
: strippedValue;

if (typeof strippedValue === 'string') {
strippedValue = decode(strippedValue);
}

saveProperty({
currentComponent,
includeInMetadata: custom,
Expand Down

0 comments on commit ffdbcb4

Please sign in to comment.