about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/reducers/compose.js
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-08-28 12:40:19 +0200
committerThibG <thib@sitedethib.com>2018-08-28 19:52:28 +0200
commite3246cd13b6ee034f5c8e969828332dc9312d449 (patch)
tree7027e2c853fab81a0bf80cfb35c83da3080cae36 /app/javascript/flavours/glitch/reducers/compose.js
parent14563f51674aa601b7684dc62a394469a9634c4d (diff)
Preserve hashtag casing in threaded mode
Inspired by f9b23a5d6247445ea5b70b431c934a4bb99213bc
Diffstat (limited to 'app/javascript/flavours/glitch/reducers/compose.js')
-rw-r--r--app/javascript/flavours/glitch/reducers/compose.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/javascript/flavours/glitch/reducers/compose.js b/app/javascript/flavours/glitch/reducers/compose.js
index 8b997bf4d..5ef5d3f5c 100644
--- a/app/javascript/flavours/glitch/reducers/compose.js
+++ b/app/javascript/flavours/glitch/reducers/compose.js
@@ -39,6 +39,7 @@ import { privacyPreference } from 'flavours/glitch/util/privacy_preference';
 import { me } from 'flavours/glitch/util/initial_state';
 import { overwrite } from 'flavours/glitch/util/js_helpers';
 import { unescapeHTML } from 'flavours/glitch/util/html';
+import { recoverHashtags } from 'flavours/glitch/util/hashtag';
 
 const totalElefriends = 3;
 
@@ -114,8 +115,9 @@ function apiStatusToTextMentions (state, status) {
 }
 
 function apiStatusToTextHashtags (state, status) {
-  return ImmutableOrderedSet([]).union(status.tags.map(
-    ({ name }) => `#${name} `
+  const text = unescapeHTML(status.content);
+  return ImmutableOrderedSet([]).union(recoverHashtags(status.tags, text).map(
+    (name) => `#${name} `
   )).join('');
 }