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

Set "title" attribute for images from markdown #985

Closed
gotdibbs opened this issue Oct 8, 2013 · 7 comments
Closed

Set "title" attribute for images from markdown #985

gotdibbs opened this issue Oct 8, 2013 · 7 comments
Labels
affects:editor Work relating to the Koenig Editor

Comments

@gotdibbs
Copy link
Contributor

gotdibbs commented Oct 8, 2013

It'd be nice if we could set the title attribute for images as well as the alt attribute with the caption being entered in the markdown.

@JohnONolan
Copy link
Member

I agree - this is a markdown extension, however, and as such extremely complicated to implement at present.

@ErisDS
Copy link
Member

ErisDS commented Oct 14, 2013

At the moment, we're using showdown for markdown to html conversion. Showdown uses regular expressions, which gets us into all kinds of knots. I had to take out title support in order to have better URL support. At the moment, it's a trade-off. In the future we'll use a proper parser, and be able to handle advanced features such as this.

@halfdan
Copy link
Contributor

halfdan commented Oct 17, 2013

Regarding the title: I propose to use

<figure>
  <img src=".." alt=".." title="Optional title" />
  <figcaption>Optional title</figcaption>
</figure>

This would make it easy to add captions to images that are easy to style with CSS.

@JohnONolan This isn't a Markdown extension. It's part of the original Markdown: http://daringfireball.net/projects/markdown/syntax#img


I'd like to implement this if above format is accepted.

@Fasani
Copy link

Fasani commented Oct 17, 2013

@halfdan looks good...

Would this result in this for no title?

<figure>
    <img src=".." alt=".." title="Optional title" />
</figure>

or simple:

<img src=".." alt=".." />

@halfdan
Copy link
Contributor

halfdan commented Oct 17, 2013

@Fasani: I guess to be consistent it should also result in <figure />, but I let @JohnONolan decide on that.

@JohnONolan
Copy link
Member

Creating functionality like this is a lot less to do with what is and isn't a formal Markdown extension (you're right, it is) and a lot more to do with what is and isn't an extension of the Markdown-parsing-functionality which we have available to us (in which context, it absolutely is).

We plan to rip out the guts of our current Markdown parsing implementation (which is hack++) and write our own engine, as this is obviously a very integral/core part of Ghost.

Until then, as @ErisDS mentions, we heard you like REGEX so we put some REGEX in ur REGEX. ;) Which is not an ideal starting point for extending into more complex functionality.

Enhancements like this are absolutely welcome - we're just not quite ready for them yet.

@ErisDS ErisDS closed this as completed Oct 29, 2013
@ErisDS ErisDS reopened this Jan 7, 2014
@ErisDS ErisDS removed this from the 0.7 Editor milestone Aug 23, 2014
@ErisDS
Copy link
Member

ErisDS commented Aug 23, 2014

Closing as wontfix against #1294 as it's pretty hard to get done before we rebuild the editor.

@ErisDS ErisDS closed this as completed Aug 23, 2014
@ErisDS ErisDS mentioned this issue Oct 31, 2014
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects:editor Work relating to the Koenig Editor
Projects
None yet
Development

No branches or pull requests

5 participants