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

Ignore empty title attributes #199

Closed
winniehell opened this issue Dec 28, 2014 · 5 comments
Closed

Ignore empty title attributes #199

winniehell opened this issue Dec 28, 2014 · 5 comments
Assignees
Labels

Comments

@winniehell
Copy link
Contributor

@winniehell winniehell commented Dec 28, 2014

An image with explicitly specified empty title attribute leads to incorrect Markdown:

$ kramdown -ihtml -okramdown <<<'<img src="x" alt="" title="" />'
![](x "")

As mentioned here the title must not be empty in Markdown and passing the output back to kramdown leads to strange behavior:

$ kramdown <<<'![](x "")'
<p>![](x “”)</p>

Please ignore empty title attributes as it already happens for links:

$ kramdown -ihtml -okramdown <<<'<a href="x" title="">y</a>'
[y](x)
@winniehell
Copy link
Contributor Author

@winniehell winniehell commented Dec 28, 2014

Seems like one line has to be copied from convert_a to convert_img (or maybe even extracted to convert_title?). I am not a rubyish person, otherwise I would test and pull request it.

Loading

@gettalong gettalong self-assigned this Dec 28, 2014
@gettalong
Copy link
Owner

@gettalong gettalong commented Dec 28, 2014

Thanks for the bug report!

Loading

@winniehell
Copy link
Contributor Author

@winniehell winniehell commented Dec 30, 2014

Same issue occurs for link references:

$ kramdown -ihtml -okramdown <<< '<a href="http://example.com" title="">foo</a>'
[foo][1]

[1]: http://example.com ""

Passing the output back to kramdown leads to the following:

$ kramdown <<< '[foo][1]

[1]: http://example.com ""'
<p>[foo][1]</p>

<p>[1]: http://example.com “”</p>
Warning: No link definition for link ID '1' found on line 1
Warning: No link definition for link ID '1' found on line 1
Warning: No link definition for link ID '1' found on line 3

Loading

@winniehell winniehell changed the title Ignore empty title attribute for images Ignore empty title attributes Dec 30, 2014
@gettalong gettalong added the bug label Feb 5, 2015
@winniehell
Copy link
Contributor Author

@winniehell winniehell commented Feb 14, 2015

Sorry for all the spam... seems like GitHub keeps the references from issues to commits even though the commits themselves are not referenced anymore. 😕

Loading

@gettalong gettalong closed this in 7471576 Feb 23, 2015
@gettalong
Copy link
Owner

@gettalong gettalong commented Feb 23, 2015

Fixed by your pull request #206 - thanks!

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants