diff --git a/source/community/reactnative/src/utils/markdown-formatter.js b/source/community/reactnative/src/utils/markdown-formatter.js index 2ab33eaad9..3d02aed362 100644 --- a/source/community/reactnative/src/utils/markdown-formatter.js +++ b/source/community/reactnative/src/utils/markdown-formatter.js @@ -273,6 +273,7 @@ export default class MarkdownFormatter extends React.PureComponent { let modifiedElement = lastElement.replace(matchedStr, ""); let dividedElements = this.splitValue(lastElement, lastElement.indexOf(matchedStr), matchedStr); let lastElementStyles = elementStylesArray.pop(); + let lastElementLink = elementLinksArray?.pop(); if (modifiedElement !== "" && !isMatch) { elementJsxArray.push(dividedElements[0]); elementStylesArray.push(lastElementStyles); @@ -286,6 +287,11 @@ export default class MarkdownFormatter extends React.PureComponent { let elementStyle = [this.matchesStyleTypes[idx]]; elementStyle = elementStyle.concat(this.matchesStyles[idx]); elementStylesArray.push(elementStyle.concat(lastElementStyles)); + if (this.matchesStyleTypes[idx] === 'hyperlinkText') { + elementLinksArray.push(this.matchesFound[idx][2]); + } else { + elementLinksArray.push(null); + } if (dividedElements.length > 1) { elementJsxArray.push(dividedElements[1]); @@ -360,7 +366,7 @@ export default class MarkdownFormatter extends React.PureComponent { let key = 'text_' + index; if (elementStylesArray[index].indexOf('bulletText') !== -1 || elementStylesArray[index].indexOf('numberedText') !== -1) { - tempJSX.push({eachWord}) + tempJSX.push( this.addOnPress(elementLinksArray[index])}>{eachWord}) } else { tempJSX.push( this.addOnPress(elementLinksArray[index])}>{eachWord}) } diff --git a/source/community/reactnative/src/visualizer/payloads/data-binding/bulletedHyperlink.json b/source/community/reactnative/src/visualizer/payloads/data-binding/bulletedHyperlink.json new file mode 100644 index 0000000000..808c3426b9 --- /dev/null +++ b/source/community/reactnative/src/visualizer/payloads/data-binding/bulletedHyperlink.json @@ -0,0 +1,59 @@ +{ + "type": "AdaptiveCard", + "body": [ + { + "type": "Container", + "items": [ + { + "type": "Container", + "spacing": "large", + "items": [ + { + "type": "TextBlock", + "text": "Link Type: [Normal Text Link](https://bing.com)", + "wrap": true + } + ] + }, + { + "type": "Container", + "spacing": "large", + "items": [ + { + "type": "TextBlock", + "text": "Bulleted Text Link", + "wrap": true + } + ] + }, + { + "type": "Container", + "items": [ + { + "type": "TextBlock", + "text": "- [Bing.com](https://bing.com)", + "wrap": true + }, + { + "type": "TextBlock", + "text": "- [Microsoft.com](https://microsoft.com)SUFFIX", + "wrap": true + }, + { + "type": "TextBlock", + "text": "- PREFIX[Microsoft.com](https://microsoft.com)", + "wrap": true + }, + { + "type": "TextBlock", + "text": "- PREFIX[Microsoft.com](https://microsoft.com)SUFFIX", + "wrap": true + } + ] + } + ] + } + ], + "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", + "version": "1.3" +} \ No newline at end of file diff --git a/source/community/reactnative/src/visualizer/payloads/data-binding/index.js b/source/community/reactnative/src/visualizer/payloads/data-binding/index.js index c24467bda5..4e8e8c38c5 100644 --- a/source/community/reactnative/src/visualizer/payloads/data-binding/index.js +++ b/source/community/reactnative/src/visualizer/payloads/data-binding/index.js @@ -28,5 +28,9 @@ export default payloads = [ { "title": "Cafe", "json": require('./cafe.json') + }, + { + "title": "Bulleted Hyperlink", + "json": require('./bulletedHyperlink.json') } ] \ No newline at end of file