git ssb

7+

dinoworm 🐛 / patchcore



Commit c6ab0ded01f255585c588b9693b975297127a920

markdown: use html-escape on emoji attributes instead of incorrect encoding

Matt McKegg committed on 6/3/2017, 4:51:27 AM
Parent: e88968184cc1392c4b3b1ebb85d0a3b0e0523b13

Files changed

message/html/markdown.jschanged
package.jsonchanged
message/html/markdown.jsView
@@ -1,8 +1,9 @@
11 const renderer = require('ssb-markdown')
22 const h = require('mutant/h')
33 const ref = require('ssb-ref')
44 const nest = require('depnest')
5 +var htmlEscape = require('html-escape')
56
67 exports.needs = nest({
78 'blob.sync.url': 'first',
89 'emoji.sync.url': 'first'
@@ -48,11 +49,11 @@
4849 function renderEmoji (emoji, url) {
4950 if (!url) return ':' + emoji + ':'
5051 return `
5152 <img
52- src="${encodeURI(url)}"
53- alt=":${escape(emoji)}:"
54- title=":${escape(emoji)}:"
53 + src="${htmlEscape(url)}"
54 + alt=":${htmlEscape(emoji)}:"
55 + title=":${htmlEscape(emoji)}:"
5556 class="emoji"
5657 >
5758 `
5859 }
package.jsonView
@@ -36,8 +36,9 @@
3636 "color-hash": "^1.0.3",
3737 "depnest": "^1.0.2",
3838 "emoji-named-characters": "^1.0.2",
3939 "es2040": "^1.2.4",
40 + "html-escape": "^2.0.0",
4041 "human-time": "0.0.1",
4142 "mutant": "^3.17.0",
4243 "mutant-pull-reduce": "^1.1.0",
4344 "pull-abortable": "^4.1.0",

Built with git-ssb-web