Floating images in Github Readme - image

How would I go about doing this? Putting the following code into the
Markdown generator
gives me the desired output
<div style="float: left"><img src="http://ompldr.org/vaDU5NQ/scrotter.png"/>
</div>
I'm trying not to, kid. Don't act so surprised, Your Highness. You weren't
on any mercy mission this time. Several transmissions were beamed to this
ship by Rebel spies. I want to know what happened to the plans they sent
you. Kid, I've flown from one side of this galaxy to the other.
I've seen a lot of strange stuff, but I've never seen anything to make me
believe there's one all-powerful Force controlling everything.
However, adding this code to my README.md file makes it an inline image instead
of floating.
How could I work around this? Is it a Github bug?

I know this thread's old, but for anyone interested, you can use <img align="left" src="img.jpg"> and <img align="right" src="img.jpg"> to float images on GitHub.

I believe it is a security issue with GitHub. My understanding is they strip all HTML attributes such as style with the execption of perhaps href.

Related

Xpath, div with multiple classes

I feel really stupid: I just read this question How to get html elements with multiple css classes and the answer was very clear and straightforward but when I try to apply it on this HTML
<div class="header group">
I am completely unable to make it work.
Here are some of the variations I have tried
//*[contains (#class, ’header’) and contains (#class, ‘group’)]
//div[contains (#class, ’header’) and contains (#class, ‘group’)]
//div[contains (#class, ’header’)]
What am I missing here? Should be straightforward, shouldn't it?
Testing in Chrome Canary.
Updates
The invalid typographical apostrophes above happened when I copy-pasted into this form. I was using ' in the actual console.
I was playing around on an archived version of the page at the Wayback Machine (WM) and nothing worked. However, when trying on the live version, everything worked as expected (the problem with the live version was that the final element I was "aiming" at currently is missing but will return later on, therefore I used WM). Any ideas why // seems broken on WM? Even if WM adds a few levels of divs, // should be transparent about that, shouldn't it?
Just use this xpath.
//div[#class='header group']
you should use something like this
<xpath expr="//div[hasclass('header') and hasclass('group')]" position="replace">
<t>
xxxxxx
</t>
</xpath>

How to embed image in RTE componet in CQ5

I have a CQ5 component where the users can write some text with a richtext editor. It is also possible to paste Image script code into source editor available in RTE.
When I am pasting the source code as below
<div style="background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=='); height:100;width:100;"></div>
into RTE, It's getting converted as shown below and it is not rendering the image.
<div style="background: url('data:image/png; base64,ivborw0kggoaaaansuheugaaaauaaaafcayaaacnbyblaaaaheleqvqi12p4//8/w38giaxdibke0dhxgljnbaao9txl0y4ohwaaaabjru5erkjggg=='); height: 100; width: 100;"> </div>
Has anybody a suggestion what can be the cause of this problem?
I believe the code that is formatting the HTML is in /libs/cq/ui/rte/core/HtmlSerializer.js and/or /libs/cq/ui/rte/core/HtmlProcessor.js so you may need to override that by copying that file to apps as /apps/cq/ui/rte/core/HtmlSerializer.js and/or /libs/cq/ui/rte/core/HtmlProcessor.js. This code is doing toLowerCase in several places, though I don't know specifically where it would be altering a style attribute value. But I suspect it is. One of those files has a comment that seems suspicious:
// IE < 9 will report uppercase style names; hence normalize to
lowercase
So perhaps there is some code added to work around an IE bug that is messing up what you are wanting to do--essentially introducing a different bug while fixing an IE issue.

DRY partials with Assemble.io front-matter

I'm wondering how to make re-usable html partials with Assemble.
What I would like to do is just simply override front-matter of my new template that references the component I want. See below:
Below is my-list.hbs(references my-list.yml)
---
horiz-list: "<%= my-list %>"
---
{{> horiz-list}}
Below is horiz-list.hbs(references horiz-list.yml)
<ul class="horiz-list">
{{#each horiz-list}}
<li>{{.}}</li>
{{/each}}
</li>
Yml files are just lists of things like bananas, apples, oranges, or whatever.
I thought this would work, but it doesn't.
NOTE: The only thing I have seen about re-usable components so far is a stack-overflow that talked about extending the page using handlebars, but I couldn't find that this morning, and when I read it, it didn't seem like a straight-forward process.
Any help from the community would be much appreciated, given that assemble has some really nice features.
Thanks!
Okay, so... Trying to override data like this won't work, because it has a rigid order to how contexts are put together.
Thankfully, someone has already solved this problem for all of us.
This(below) is what I meant by "extending the page using handlebars"... It basically makes contexts in partials more flexible with data.
https://github.com/albogdano/handlebars-helper-mdpartial
There is also a node package that works with this to put keys for all the partials, and adds even more flexibility.
https://www.npmjs.org/package/assemble-partial-data

How to remove tweet photos from twitter widget?

to display and style my tweets on my website I use somethiong like this code:
<a
class="twitter-timeline"
href="https://twitter.com/YourNickname"
data-widget-id="xxxxxxxxxxxxxxxxxxx" <!--you will haveyour own number http://stackoverflow.com/questions/16375116/what-is-data-widget-id-in-twitter-api-how-i-can-get-the-data-widget-id-->
data-chrome="noheader nofooter noborders noscrollbar transparent" <!--tweak these for the looks-->
data-tweet-limit="5"
data-link-color="#FFFFFF"
data-border-color="#FFFFFF"
lang="EN" data-theme="light" <!--light or dark-->
height="447"
width="255"
data-screen-name="yourName"
data-show-replies="false"
data-aria-polite="assertive">
Tweets by #YourName
</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
I'm looking for a way to remove images in case they are twitted.
Looking for a solution I've found this:
https://dev.twitter.com/discussions/19073
They suggest to add a line
data-src-2x="false"
to my code.
This solution, sadly, doesn't seem to work for me.
If any of you have solved this problem, a hint would be much appreciated!
Cheers!
The following answer is no longer relevant due to recent changes by twitter!
In the configuration options when creating the widget there is a checkbox labeled 'auto expand photos'. Uncheck this, but be aware it takes

EmberJs model output into an img tag in a handlebar template

I am trying to learn EmberJs, in conjuction with Laravel 4, to create a blog. Things have been going great, stuff hasn't been too difficult yet. But I got into a snag when trying to have a <img/> tag in one of my handlebar templates.
From my understanding to use info from a model in a template you use {{attribute_name}} and like magic, it's there! And so for my tag I was trying something like:
<img src="{{URL::asset('images/posts/')}}#{{id}}.#{{image_extension}}" }}" alt=""/>
Adding the url to images with Laravel and Blade, then on the template, just adding in those last little pieces to make the it all work. But I get this instead:
<img src="http://localhost/blog/images/posts<script id='metamorph-11-start' type='text/x-placeholder'></script>26<script id='metamorph-11-end' type='text/x-placeholder'></script>.<script id='metamorph-12-start' type='text/x-placeholder'></script>jpg<script id='metamorph-12-end' type='text/x-placeholder'></script>" alt="">
Obviously theres script tags in my src tag and this is causing some issues.
Now then, upon much research I discovered {{unbound attribute_name}} and came up with:
<img src="{{URL::asset('images/posts')}}/#{{unbound id}}.#{{unbound image_extension}}" alt=""/>
and while this works on the first blog post I click, it doesn't switch images when I switch posts. So is there a way to make this guy work? I'm running out of ideas! Any information you could shed on this would be great! I really like ember so far and want to get even better! IF there's any more info you need, let em know and I will edit this question! Thanks so much!
EDIT:
Based on the advise from #buruzaemon, I tried
<img src="{{URL::asset('images/posts')}}/#{{bind-attr src=id}}.#{{bind-attr src=image_extension}}" alt="Post image"/>
and it feels like it's on the right path, but not quite there. Any more advice?
Perhaps you should have a look at bind_attr in Ember.js. It will allow you to set the src attribute properly with value that can be set in your controller.

Resources