Skip to content

Commit

Permalink
Merge pull request #324 from ginger-io/enclosing-tag-class
Browse files Browse the repository at this point in the history
Add class configurability to the enclosing tag.
  • Loading branch information
nicholasserra committed May 8, 2019
2 parents 6bd1875 + d57f946 commit c75a691
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/markdown2.py
Expand Up @@ -2073,7 +2073,7 @@ def _form_paragraphs(self, text):

# Wrap <p> tags.
graf = self._run_span_gamut(graf)
grafs.append("<p>" + graf.lstrip(" \t") + "</p>")
grafs.append("<p%s>" % self._html_class_str_from_tag('p') + graf.lstrip(" \t") + "</p>")

if cuddled_list:
grafs.append(cuddled_list)
Expand Down
4 changes: 2 additions & 2 deletions test/tm-cases/html_classes.html
Expand Up @@ -26,10 +26,10 @@
</tbody>
</table>

<p>For example:</p>
<p class="col-xs-3 custom-paragraph-class">For example:</p>

<pre class="syntaxcolor"><code class="codesyntaxcolor">if cond:
print doit()
</code></pre>

<p><img src="http://www.google.com/images/logo.gif" alt="the google logo" class="custom-image-class" /></p>
<p class="col-xs-3 custom-paragraph-class"><img src="http://www.google.com/images/logo.gif" alt="the google logo" class="custom-image-class" /></p>
3 changes: 2 additions & 1 deletion test/tm-cases/html_classes.opts
Expand Up @@ -6,7 +6,8 @@
"pre": "syntaxcolor",
"code": "codesyntaxcolor",
"img": "custom-image-class",
"table": "table table-striped"
"table": "table table-striped",
"p": "col-xs-3 custom-paragraph-class",
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/tm-cases/html_classes.tags
@@ -1 +1 @@
extras html-classes knownfailure code.as.com
extras html-classes code.as.com

0 comments on commit c75a691

Please sign in to comment.