Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: third_party/Python-Markdown/markdown/extensions/nl2br.py

Issue 1356203004: Check in a simple pure-python based Markdown previewer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add
Patch Set: fix license file Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 """
2 NL2BR Extension
3 ===============
4
5 A Python-Markdown extension to treat newlines as hard breaks; like
6 GitHub-flavored Markdown does.
7
8 See <https://pythonhosted.org/Markdown/extensions/nl2br.html>
9 for documentation.
10
11 Oringinal code Copyright 2011 [Brian Neal](http://deathofagremmie.com/)
12
13 All changes Copyright 2011-2014 The Python Markdown Project
14
15 License: [BSD](http://www.opensource.org/licenses/bsd-license.php)
16
17 """
18
19 from __future__ import absolute_import
20 from __future__ import unicode_literals
21 from . import Extension
22 from ..inlinepatterns import SubstituteTagPattern
23
24 BR_RE = r'\n'
25
26
27 class Nl2BrExtension(Extension):
28
29 def extendMarkdown(self, md, md_globals):
30 br_tag = SubstituteTagPattern(BR_RE, 'br')
31 md.inlinePatterns.add('nl', br_tag, '_end')
32
33
34 def makeExtension(*args, **kwargs):
35 return Nl2BrExtension(*args, **kwargs)
OLDNEW
« no previous file with comments | « third_party/Python-Markdown/markdown/extensions/meta.py ('k') | third_party/Python-Markdown/markdown/extensions/sane_lists.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698