cmark

My personal build of CMark ✏️

Commit
cf1c490c7a3fd3f9681e97f1e662735e1509250c
Parent
fcad3ead2fb012ee60517cdd992453255255f62e
Author
John MacFarlane <jgm@berkeley.edu>
Date

commonmark.rb: omit title if empty.

Diffstat

1 file changed, 3 insertions, 3 deletions

Status File Name N° Changes Insertions Deletions
Modified commonmark.rb 6 3 3
diff --git 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