Skip to content

Remove trailing whitespace in produced markdown#44

Merged
gettalong merged 1 commit intogettalong:masterfrom
stomar:fix_whitespace
Apr 20, 2013
Merged

Remove trailing whitespace in produced markdown#44
gettalong merged 1 commit intogettalong:masterfrom
stomar:fix_whitespace

Conversation

@stomar
Copy link
Contributor

@stomar stomar commented Mar 27, 2013

Avoids a trailing whitespace in link definitions without a title when converting to markdown (kramdown) format:

require 'kramdown'
htmldoc =<<HTML
<p><a href="http://test1.com/">Test 1</a></p>
<p><a href="http://test2.com/" title="Test 2">Test 2</a></p>
HTML
puts Kramdown::Document.new(htmldoc, :input => :html).to_kramdown

Output:

[Test 1][1]

[Test 2][2]



[1]: http://test1.com/X
[2]: http://test2.com/ "Test 2"

with a whitespace (marked by "X") at the end of link definition 1.

Avoids a trailing whitespace in link definitions without a title
when converting to kramdown format.
@stomar
Copy link
Contributor Author

stomar commented Apr 17, 2013

Ping? Any feedback?

@ghost ghost assigned gettalong Apr 18, 2013
@gettalong
Copy link
Owner

Pong! Looks good, will have a detailed look on the weekend when I have more time.

@gettalong gettalong merged commit bbb28e4 into gettalong:master Apr 20, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants