Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion source/community/reactnative/src/utils/markdown-formatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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]);
Expand Down Expand Up @@ -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(<Text key={'list_item_' + index} style={[this.userStyles.concat(elementStylesArray[index])]}>{eachWord}</Text>)
tempJSX.push(<Text key={'list_item_' + index} style={[this.userStyles.concat(elementStylesArray[index])]} onPress={() => this.addOnPress(elementLinksArray[index])}>{eachWord}</Text>)
} else {
tempJSX.push(<Text key={key} style={[elementStylesArray[index]]} onPress={() => this.addOnPress(elementLinksArray[index])}>{eachWord}</Text>)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,9 @@ export default payloads = [
{
"title": "Cafe",
"json": require('./cafe.json')
},
{
"title": "Bulleted Hyperlink",
"json": require('./bulletedHyperlink.json')
}
]