Can image width-/height-attributes be applied as attributes instead of style?
When reading the old(?)
MultiMarkdown Style Guide I got the impression that image
attributes in conversion to HTML would be applied as attributes on
the image tag, but when testing it seems as my width
and height
attributes are used as values for a
style
attribute instead.
Is there a way to preserve them as individual attributes?
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Daniel on 02 Sep, 2013 08:12 PM
(I'm using MultiMarkdown 4.2.)
2 Posted by Daniel on 02 Sep, 2013 08:15 PM
(The link above should have said MultiMarkdown Syntax Guide.)
Support Staff 3 Posted by fletcher on 02 Sep, 2013 08:23 PM
Daniel,
You can always define an image manually in HTML, but when you use MMD the width/height are applied as style.
May I ask why it matters to you?
Fletcher
4 Posted by Daniel on 02 Sep, 2013 09:24 PM
Hi Fletcher, and thanks for the super fast response. And your fantastic tool.
I don't know if browsers handle these two expressions differently, but I know there are lots of recommendations for specifying width and height for images so the browser can allocate the needed space as it traverse the DOM and renders the page. I'm sure that the width and height attributes will be picked up at the right time, I'm not sure about the style rules.
It probably could be debated but to me it is the clearest way of expressing this information about the image. It isn't really a style, it's a description of the resource. I tend to avoid inline style, and keeping this information in the tag attributes is a reminder that this is something different.
Also, it would probably be the least surprising thing, and maybe save a line of code in your parser ... And should you chose to change this behavior to the one I expected, it would still be possible (but more verbose) to add them as style values, while it now seems "impossible" (without resorting to additional filters) to add them as attributes.
Regards
Daniel
5 Posted by Daniel on 02 Sep, 2013 09:26 PM
(And now I read your response again, and saw the answer to my "impossible" right there. But I would much prefer the reference-style image syntax.)
Support Staff 6 Posted by fletcher on 02 Sep, 2013 09:29 PM
Fair enough. No promises, but I'll look at changing it.
F-
--
Fletcher T. Penney
[email blocked]
Support Staff 7 Posted by fletcher on 05 Sep, 2013 12:40 PM
When I test in Chrome, the width/height work just fine when specified as style attributes for "blocking out" the image dimensions when image is unavailable.
Has that not been the case for you?
F-
8 Posted by Daniel on 05 Sep, 2013 09:04 PM
Yes it works for me to. My main concern was really my subjective opinion on what "looks best". The other concern was performance rather than functionality - it *might* be that the time that the inline style gets picked up/calculated is too late to prevent an additional reflow of the page. But even if it is so, I'm not publishing anything where it would be significant.
I also found [this Stackoverflow answer](http://stackoverflow.com/a/2414940/198420) that suggested this to be the most correct way, but there are other opinions.
Thanks for taking your time, but don't lose sleep over this. I will appreciate it you change it, or add an option (but going down that path is probably a never ending road for you), but I will live happily even if you don't.
Regards
Daniel
Support Staff 9 Posted by fletcher on 05 Sep, 2013 09:23 PM
For now, this will be filed under "Do it when I get around to it, either out of boredom, or because I've accomplished everything else." If it turns out to actually cause a problem, I will bump it up the priority ladder. Just let me know.
F-
--
Fletcher T. Penney
[email blocked]