Skip to content

Commit c75a691

Browse files
Merge pull request trentm#324 from ginger-io/enclosing-tag-class
Add class configurability to the enclosing tag.
2 parents 6bd1875 + d57f946 commit c75a691

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

lib/markdown2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2073,7 +2073,7 @@ def _form_paragraphs(self, text):
20732073

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

20782078
if cuddled_list:
20792079
grafs.append(cuddled_list)

test/tm-cases/html_classes.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
</tbody>
2727
</table>
2828

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

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

35-
<p><img src="http://www.google.com/images/logo.gif" alt="the google logo" class="custom-image-class" /></p>
35+
<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>

test/tm-cases/html_classes.opts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"pre": "syntaxcolor",
77
"code": "codesyntaxcolor",
88
"img": "custom-image-class",
9-
"table": "table table-striped"
9+
"table": "table table-striped",
10+
"p": "col-xs-3 custom-paragraph-class",
1011
}
1112
}
1213
}

test/tm-cases/html_classes.tags

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
extras html-classes knownfailure code.as.com
1+
extras html-classes code.as.com

0 commit comments

Comments
 (0)