HTML Output from image inserts in MMD doc

jason.verly's Avatar

jason.verly

01 Jan, 2013 08:26 PM

Followup from twitter from @mygeekdaddy.

In a MMD doc, I insert an image with the following syntax (image URL is live and works):

![Happy New Year][nye_img]
[nye_img]:http://verly.me/wp-content/uploads/2013/01/newyear2013.jpg width="400px" height="240px"

Previewing in Marked works and the HTML out put from Marked is:

<figure>
<img src="http://verly.me/wp-content/uploads/2013/01/newyear2013.jpg" alt="Happy New Year" id="nye_img" style="height:250px;width:400px;" />
<figcaption>Happy New Year</figcaption></figure>

The Marked HTML output doesn't include an expected "href" tag I've had with other applications that output to HTML format.

<a href="http://verly.me/wp-content/uploads/2013/01/newyear2013.jpg">

I'm just curious if this is how core MMD is supposed to handle image links when moving from MMD -> HTML or is this a programming choice in Marked. Thanks for the help.

  1. Support Staff 1 Posted by Brett on 01 Jan, 2013 08:28 PM

    Brett's Avatar

    There's no link syntax in your source, so I'm not sure why it would produce an href attribute… Can you show me a processor or application that does?

  2. 2 Posted by jason.verly on 01 Jan, 2013 09:27 PM

    jason.verly's Avatar

    When inserting image directly in WP editor the corresponding HTML includes the "href" tag. Example of inserting image directly in to WP post via WP editor (v3.4.2):

    <a href="http://theothersideof.mygeekdaddy.net/?attachment_id=736" 
    rel="attachment wp-att-736"><img class="alignnone size-full wp-image-736" 
    title="newyear2013_r3" src="http://theothersideof.mygeekdaddy.net/wp-
    content/uploads/2013/01/newyear2013_r31.jpg" alt="" width="500" height="300" />
    </a>
    

    I get the same syntax whether I'm loading an image directly into the post or with an image already in the media library.

    Do you know if there is a way to add link syntax to pick an href tag from a MMD doc?

  3. Support Staff 3 Posted by Brett on 01 Jan, 2013 10:17 PM

    Brett's Avatar

    WordPress is creating your thumbnail and a link to the full size image automatically. It has nothing to do with Markdown, you'd have to generate both versions and create the link with a syntax like:

    [![alt text](imageurl.jpg)](/full/size/imageurl.jpg)

  4. 4 Posted by jason.verly on 02 Jan, 2013 12:09 AM

    jason.verly's Avatar

    Thanks for the suggestion and the quick response.

  5. Brett closed this discussion on 13 Jan, 2013 04:04 PM.

Comments are currently closed for this discussion. You can start a new one.

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