Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to not include image size attributes #100

Closed
drewm opened this issue Dec 31, 2012 · 1 comment
Closed

Option to not include image size attributes #100

drewm opened this issue Dec 31, 2012 · 1 comment

Comments

@drewm
Copy link

drewm commented Dec 31, 2012

When inserting an image, Textile attempts to get the image dimensions and insert width and height attributes (in the fImage() function)

if ($this->isRelUrl($url)) {
    $size = @getimagesize(realpath($this->doc_root.ltrim($url, $this->ds)));
}

if ($size) {
    $atts .= " $size[3]";
}

This is a hindrance for responsive web design layouts, where CSS is used to scale images to their containing element. In that scenario, the user doesn't want the width and height attributes added by Textile.

It would be great if there was a runtime option to specify whether to insert size attributes on image tags, defaulting to the current behaviour.

@netcarver
Copy link
Contributor

Fixed in a 2.5 based branch along with #101. Will become part of v2.5.1 and v3.5.1.

netcarver pushed a commit that referenced this issue Jan 1, 2013
netcarver pushed a commit that referenced this issue Jan 1, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants