Commit 0f55f6590b4fcc68e74c2910f6437b56f946b331
bump compose for latest ssb-markdown embedding changes
ssbc/ssb-markdown#22Matt McKegg committed on 4/14/2018, 9:47:47 AM
Parent: e81b654394d0126eee1fae14be659f26ed3c31cc
Files changed
modules/message/html/compose.js | changed |
package-lock.json | changed |
modules/message/html/compose.js | ||
---|---|---|
@@ -90,9 +90,11 @@ | ||
90 | 90 | var spacer = embed ? '\n' : ' ' |
91 | 91 | if (before && !before.endsWith(spacer)) before += spacer |
92 | 92 | if (!after.startsWith(spacer)) after = spacer + after |
93 | 93 | |
94 | - textArea.value = `${before}${embed}[${file.name}](${file.link})${after}` | |
94 | + var embedPrefix = getEmbedPrefix(file.type) | |
95 | + | |
96 | + textArea.value = `${before}${embed}[${embedPrefix}${file.name}](${file.link})${after}` | |
95 | 97 | console.log('added:', file) |
96 | 98 | }, { |
97 | 99 | private: isPrivate |
98 | 100 | }) |
@@ -225,5 +227,13 @@ | ||
225 | 227 | } |
226 | 228 | |
227 | 229 | function isEmbeddable (type) { |
228 | 230 | return type.startsWith('image/') || type.startsWith('audio/') || type.startsWith('video/') |
229 | -} | |
231 | +} | |
232 | + | |
233 | +function getEmbedPrefix (type) { | |
234 | + if (typeof type === 'string') { | |
235 | + if (type.startsWith('audio/')) return 'audio:' | |
236 | + if (type.startsWith('video/')) return 'video:' | |
237 | + } | |
238 | + return '' | |
239 | +} |
package-lock.json | ||
---|---|---|
The diff is too large to show. Use a local git client to view these changes. Old file size: 294177 bytes New file size: 294178 bytes |
Built with git-ssb-web