diff --git a/models.js b/models.js index a572d7e..11f7ad0 100644 --- a/models.js +++ b/models.js @@ -247,6 +247,11 @@ class Post extends ATProtoRecord { return this.isFediPost && (this.text.endsWith('…') || this.text.endsWith('[…]')); } + /** @returns {string | undefined} */ + get originalFediContent() { + return this.record.bridgyOriginalText; + } + /** @returns {string} */ get authorFediHandle() { if (this.isFediPost) { diff --git a/post_component.js b/post_component.js index 3ef876c..ecc4093 100644 --- a/post_component.js +++ b/post_component.js @@ -218,6 +218,10 @@ class PostComponent { /** @returns {AnyElement} */ buildPostBody() { + if (this.post.originalFediContent) { + return $tag('div.body', { html: sanitizeHTML(this.post.originalFediContent) }); + } + let p = $tag('p.body'); let richText = new RichText({ text: this.post.text, facets: this.post.facets });