diff --git a/src/pages/tasks/NewTaskDescriptionPage.js b/src/pages/tasks/NewTaskDescriptionPage.js index c25beba384ad..b70186944ccd 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 {inputCallbackRef} = useAutoFocusInput(); @@ -74,7 +77,7 @@ function NewTaskDescriptionPage(props) { { setTaskTitle(props.task.title); - setTaskDescription(props.task.description || ''); + setTaskDescription(parser.htmlToMarkdown(parser.replace(props.task.description || ''))); }, [props.task]); /** @@ -117,6 +120,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 992e7c9b582b..fb1322bdaf05 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 validate = useCallback(() => ({}), []); @@ -98,7 +100,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;