diff --git a/packages/text/src/markup/utils.ts b/packages/text/src/markup/utils.ts index 22de08ab53..03653ae031 100644 --- a/packages/text/src/markup/utils.ts +++ b/packages/text/src/markup/utils.ts @@ -114,6 +114,11 @@ export function pmNodeToText (node: ProseMirrorNode): string { return jsonToText(node.toJSON()) } +export function markupToText (markup: Markup, schema?: Schema, extensions?: Extensions): string { + const pmNode = markupToPmNode(markup, schema, extensions) + return pmNode.textBetween(0, pmNode.content.size, '\n', '') +} + // HTML /** @public */ diff --git a/plugins/activity-assets/lang/en.json b/plugins/activity-assets/lang/en.json index 77e9345d45..dfd9d563f2 100644 --- a/plugins/activity-assets/lang/en.json +++ b/plugins/activity-assets/lang/en.json @@ -5,7 +5,7 @@ "All": "All", "AllActivity": "All activity", "Attributes": "Attributes", - "Changed": "changed", + "Changed": "Changed", "CollectionUpdated": "Update {collection}", "Created": "Created", "DocAdded": "added {_class}", diff --git a/plugins/activity-resources/package.json b/plugins/activity-resources/package.json index c5ada239b3..8d26b53358 100644 --- a/plugins/activity-resources/package.json +++ b/plugins/activity-resources/package.json @@ -45,6 +45,7 @@ "@hcengineering/platform": "^0.6.9", "@hcengineering/preference": "^0.6.9", "@hcengineering/presentation": "^0.6.2", + "@hcengineering/text": "^0.6.1", "@hcengineering/ui": "^0.6.11", "@hcengineering/view": "^0.6.9", "@hcengineering/view-resources": "^0.6.0", diff --git a/plugins/activity-resources/src/components/BasePreview.svelte b/plugins/activity-resources/src/components/BasePreview.svelte index d2b36aade7..9f949569a1 100644 --- a/plugins/activity-resources/src/components/BasePreview.svelte +++ b/plugins/activity-resources/src/components/BasePreview.svelte @@ -28,6 +28,7 @@ import { Asset, getEmbeddedLabel, IntlString } from '@hcengineering/platform' import activity, { ActivityMessage, ActivityMessagePreviewType } from '@hcengineering/activity' import { classIcon, DocNavLink, showMenu } from '@hcengineering/view-resources' + import { markupToText } from '@hcengineering/text' export let message: ActivityMessage | undefined = undefined export let text: string | undefined = undefined @@ -126,7 +127,7 @@