summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-11-21 22:29:21 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2014-11-21 22:29:21 -0800
commitcf1c490c7a3fd3f9681e97f1e662735e1509250c (patch)
tree0d30c4010694fa061c16f3512b8af011a2e18161
parentfcad3ead2fb012ee60517cdd992453255255f62e (diff)
commonmark.rb: omit title if empty.
-rwxr-xr-xcommonmark.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/commonmark.rb b/commonmark.rb
index 8767c04..f52f082 100755
--- a/commonmark.rb
+++ b/commonmark.rb
@@ -166,7 +166,7 @@ class Renderer
end
def blocksep
- self.out("\n\n")
+ self.out("\n")
end
def containersep
@@ -287,7 +287,7 @@ class HtmlRenderer < Renderer
def link(node)
self.out('<a href="', URI.escape(node.url), '"')
- if node.title
+ if node.title && node.title.length > 0
self.out(' title="', CGI.escapeHTML(node.title), '"')
end
self.out('>', node.children, '</a>')
@@ -295,7 +295,7 @@ class HtmlRenderer < Renderer
def image(node)
self.out('<img src="', URI.escape(node.url), '"')
- if node.title
+ if node.title && node.title.length > 0
self.out(' title="', CGI.escapeHTML(node.title), '"')
end
plain do