Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add class configurability to the enclosing tag. #324

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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