diff --git a/src/pages/tasks/NewTaskDescriptionPage.js b/src/pages/tasks/NewTaskDescriptionPage.js index 7c0042871770..e571edce39e9 100644 --- a/src/pages/tasks/NewTaskDescriptionPage.js +++ b/src/pages/tasks/NewTaskDescriptionPage.js @@ -1,3 +1,4 @@ +import ExpensiMark from 'expensify-common/lib/ExpensiMark'; import PropTypes from 'prop-types'; import React from 'react'; import {View} from 'react-native'; @@ -40,6 +41,8 @@ const defaultProps = { }, }; +const parser = new ExpensiMark(); + function NewTaskDescriptionPage(props) { const styles = useThemeStyles(); const {inputCallbackRef} = useAutoFocusInput(); @@ -75,7 +78,7 @@ function NewTaskDescriptionPage(props) { { setTaskTitle(props.task.title); - setTaskDescription(props.task.description || ''); + setTaskDescription(parser.htmlToMarkdown(parser.replace(props.task.description || ''))); }, [props.task]); /** @@ -118,6 +121,8 @@ function NewTaskDetailsPage(props) { autoGrowHeight submitOnEnter={!Browser.isMobile()} containerStyles={[styles.autoGrowHeightMultilineInput]} + textAlignVertical="top" + defaultValue={parser.htmlToMarkdown(parser.replace(taskDescription))} inputStyle={[styles.verticalAlignTop]} value={taskDescription} onValueChange={(value) => setTaskDescription(value)} diff --git a/src/pages/tasks/TaskDescriptionPage.js b/src/pages/tasks/TaskDescriptionPage.js index 27d49023b2c7..9069c7acdb68 100644 --- a/src/pages/tasks/TaskDescriptionPage.js +++ b/src/pages/tasks/TaskDescriptionPage.js @@ -1,4 +1,5 @@ import {useFocusEffect} from '@react-navigation/native'; +import ExpensiMark from 'expensify-common/lib/ExpensiMark'; import React, {useCallback, useRef} from 'react'; import {View} from 'react-native'; import {withOnyx} from 'react-native-onyx'; @@ -34,6 +35,7 @@ const defaultProps = { report: {}, }; +const parser = new ExpensiMark(); function TaskDescriptionPage(props) { const styles = useThemeStyles(); const validate = useCallback(() => ({}), []); @@ -99,7 +101,7 @@ function TaskDescriptionPage(props) { name="description" label={props.translate('newTaskPage.descriptionOptional')} accessibilityLabel={props.translate('newTaskPage.descriptionOptional')} - defaultValue={(props.report && props.report.description) || ''} + defaultValue={parser.htmlToMarkdown((props.report && parser.replace(props.report.description)) || '')} ref={(el) => { if (!el) { return;