diff --git a/gui/src/components/Taipy/Field.tsx b/gui/src/components/Taipy/Field.tsx index df9bce66..373ccb2a 100644 --- a/gui/src/components/Taipy/Field.tsx +++ b/gui/src/components/Taipy/Field.tsx @@ -25,7 +25,7 @@ interface TaipyFieldProps extends TaipyBaseProps, TaipyHoverProps { defaultValue?: string; format?: string; raw?: boolean; - code?: string; + mode?: string; } const unsetWeightSx = { fontWeight: "unset" }; @@ -39,7 +39,7 @@ const Field = (props: TaipyFieldProps) => { const className = useClassNames(props.libClassName, props.dynamicClassName, props.className); const hover = useDynamicProperty(props.hoverText, props.defaultHoverText, undefined); - const code = typeof props.code === "string" ? props.code.toLowerCase() : undefined; + const mode = typeof props.mode === "string" ? props.mode.toLowerCase() : undefined; const value = useMemo(() => { return formatWSValue( @@ -52,13 +52,13 @@ const Field = (props: TaipyFieldProps) => { return ( - {code == "text" ? ( + {mode == "pre" ? (
                     {value}
                 
- ) : code == "markdown" ? ( + ) : mode == "markdown" || mode == "md" ? ( {value} - ) : raw || code == "raw" ? ( + ) : raw || mode == "raw" ? ( {value} diff --git a/src/taipy/gui/_renderers/factory.py b/src/taipy/gui/_renderers/factory.py index d4a80353..e45d3ebb 100644 --- a/src/taipy/gui/_renderers/factory.py +++ b/src/taipy/gui/_renderers/factory.py @@ -497,7 +497,7 @@ class _Factory: ("id",), ("hover_text", PropertyType.dynamic_string), ("raw", PropertyType.boolean, False), - ("code", PropertyType.string), + ("mode", PropertyType.string), ] ), "toggle": lambda gui, control_type, attrs: _Builder( diff --git a/src/taipy/gui/viselements.json b/src/taipy/gui/viselements.json index 67a2e467..2e9cd6b5 100644 --- a/src/taipy/gui/viselements.json +++ b/src/taipy/gui/viselements.json @@ -21,9 +21,9 @@ "doc": "If set to True, the component renders as an HTML <span> element without any default style." }, { - "name": "code", + "name": "mode", "type": "str", - "doc": "Define the way the content is treated. text: will keep spaces and new lines; raw: as property raw=True; markdown: basic support for markdown." + "doc": "Define the way the text is processed: