oblio
(oblio)
2015 年 8 月 28 日午前 9:56
1
I’ve embedded Discourse on several Github Pages blogs. Something strange happens when the posts are shown on the forum, the emoji are huge: https://forum.oblio360.com/t/welcome-to-hearthstone-you-suck-hearthstone/15
Is this a bug? Or something I need to configure?
For reference normal, forum emoji are small, like they’re supposed to be: https://forum.oblio360.com/t/welcome-to-the-oblio-360-forum/8
(I’ve since deleted the topics but the bug is still present. The embedded emoji are shown 100%, as they are stored, while the forum ones seem to be shrinked)
「いいね!」 1
gwwar
2015 年 9 月 8 日午後 9:37
2
The huge emoji are missing the class="emoji" attribute. How are the posts being imported? It’s likely being scrubbed by an attribute whitelist.
「いいね!」 3
oblio
(oblio)
2015 年 9 月 9 日午後 12:00
3
embed whitelist selector: div.post
So I’m basically just importing the whole post, there are no other selectors applied.
gwwar
2015 年 9 月 9 日午後 9:14
4
@sam does it sound about right to add a whitelist selector for img.emoji? I’m not as familiar with GitHub - cantino/ruby-readability: Port of arc90's readability project to Ruby · GitHub
「いいね!」 1
sam
(Sam Saffron)
2015 年 9 月 9 日午後 9:17
5
Sounds more or less right, been ages since I looked at that code.
「いいね!」 2
oblio
(oblio)
2015 年 9 月 10 日午後 9:38
6
Is there anything I can do as an user? Should I add another whitelist selector?
Please, please, please, let it be a configuration option!
oblio
(oblio)
2015 年 9 月 16 日午後 1:24
7
I’ve added img.emoji in the whitelist:
div.post img.emoji
And I only got the huge emoji as the forum post
So this looks like a bug (albeit minor).
gwwar
2015 年 9 月 22 日午後 9:41
8
Too bad the whitelist didn’t work.
Could you add steps to show how you’re embedding the posts? It’ll help a lot in reproducing the issue.
oblio
(oblio)
2015 年 9 月 22 日午後 9:54
9
Plain old integration into Github Pages, using EvilTrout’s info . You can see the Github Pages repo here: https://github.com/oblio360/dota-blog/blob/gh-pages/_layouts/post.html
I’m just using bog-standard Githug Pages emoji, such as : smile :
gwwar
2015 年 9 月 22 日午後 10:26
10
For reference the Jekyll page is using the GitHub - jekyll/jemoji: GitHub-flavored emoji plugin for Jekyll · GitHub plugin.
Original emoji markup looks like:
<img class="emoji" title=":worried:" alt=":worried:" src="https://assets.github.com/images/icons/emoji/unicode/1f61f.png" height="20" width="20" align="absmiddle">
「いいね!」 1
oblio
(oblio)
2015 年 9 月 22 日午後 11:10
11
I’m a bit unclear
Is this still a bug or did I just misconfigure something?
gwwar
2015 年 9 月 22 日午後 11:52
12
The huge emoji’s are the ones coming from assets.github.com (the jemoji gem). This is probably a minor bug with the crawler too aggressively scrubbing attributes from img tags.
Edit: After looking at the config settings, could you show me what you have in:
Is it just “div.post img.emoji” for the whitelist?
「いいね!」 2
oblio
(oblio)
2015 年 9 月 23 日午前 6:43
13
Now it’s just div.post.
When I tried div.post and img.emoji I got just the emoji.
BTW, the field doesn’t say which separator should be used. If it’s space or comma or whatever…
This is a good point, can we clarify the copy here @eviltrout so people are not confused, or show an example next to the field?
oblio
(oblio)
2015 年 9 月 23 日午前 8:29
15
I think that the best thing would be to change it to the token-type entry. See for example: “Required” → “exclude rel nofollow domains”.
If we’re at it, I propose another improvement for these kinds of field, they should tokenize on space and comma and other delimiters. This would make editing a lot more efficient. Right now you have to know that the separator is space and write everything and then Tab out, while the field separates the tokens. If it would just process the tokens during input, it would be a lot more user friendly, IMO. Write a word, space, token appears or write a word, comma, token appears.
Should I add this as a separate suggestion? (if you think it’s worth it)
eviltrout
(Robin Ward)
2015 年 9 月 23 日午後 4:12
16
I’ve added placeholder values to the fields with examples of CSS values.
@oblio it’s just a standard CSS selector so commas are the separators: article, .ad-unit etc.
I don’t think it makes sense to add a token entry for this kind of thing – CSS works great for this!
「いいね!」 1
oblio
(oblio)
2015 年 9 月 23 日午後 5:00
17
Ah, ok, the placeholder values will probably do
gwwar
2015 年 9 月 24 日午後 10:55
18
「いいね!」 5