Skip to content

Commit

Permalink
fix: CopyMarkdown
Browse files Browse the repository at this point in the history
Closes #1130
  • Loading branch information
HdShare committed Aug 15, 2024
1 parent c2f2827 commit 5c0b933
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/src/main/java/me/hd/hook/menu/CopyMarkdown.kt
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,14 @@ object CopyMarkdown : CommonSwitchFunctionHook(
val item = CustomMenu.createItemIconNt(msg, "复制内容", R.drawable.ic_item_copy_72dp, R.id.item_copy_md) {
val ctx = ContextUtils.getCurrentActivity()
val msgRecord = XposedHelpers.callMethod(msg, "getMsgRecord") as MsgRecord
val stringBuilder = StringBuilder()
msgRecord.elements.forEach { element ->
element.markdownElement?.let { markdownElement ->
val content = markdownElement.content
copyToClipboard(ctx, content)
Toasts.success(ctx, "复制成功")
stringBuilder.append(markdownElement.content)
}
}
copyToClipboard(ctx, stringBuilder.toString())
Toasts.success(ctx, "复制成功")
}
param.result = listOf(item) + param.result as List<*>
}
Expand Down

0 comments on commit 5c0b933

Please sign in to comment.