Skip to content

Commit

Permalink
Merge pull request #55509 from software-mansion-labs/@Skalakid/bump-r…
Browse files Browse the repository at this point in the history
…eact-native-live-markdown-0.1.221

Bump react-native-live-markdown version to 0.1.221
  • Loading branch information
mountiny authored Jan 28, 2025
2 parents 28cb413 + ac5a13f commit 00f5edd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
9 changes: 4 additions & 5 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
},
"dependencies": {
"@dotlottie/react-player": "^1.6.3",
"@expensify/react-native-live-markdown": "0.1.210",
"@expensify/react-native-live-markdown": "0.1.221",
"@expensify/react-native-background-task": "file:./modules/background-task",
"@expo/metro-runtime": "^4.0.0",
"@firebase/app": "^0.10.10",
Expand Down
12 changes: 12 additions & 0 deletions src/components/RNMarkdownTextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ type AnimatedMarkdownTextInputRef = typeof AnimatedMarkdownTextInput & MarkdownT

type RNMarkdownTextInputProps = Omit<MarkdownTextInputProps, 'parser'>;

function handleFormatSelection(selectedText: string, formatCommand: string) {
switch (formatCommand) {
case 'formatBold':
return `*${selectedText}*`;
case 'formatItalic':
return `_${selectedText}_`;
default:
return selectedText;
}
}

function RNMarkdownTextInputWithRef({maxLength, ...props}: RNMarkdownTextInputProps, ref: ForwardedRef<AnimatedMarkdownTextInputRef>) {
const theme = useTheme();

Expand All @@ -28,6 +39,7 @@ function RNMarkdownTextInputWithRef({maxLength, ...props}: RNMarkdownTextInputPr
}
ref(refHandle as AnimatedMarkdownTextInputRef);
}}
formatSelection={handleFormatSelection}
// eslint-disable-next-line
{...props}
/**
Expand Down

0 comments on commit 00f5edd

Please sign in to comment.