Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Markdown / extensions / smarty.pyc
Size: Mime:
ó
Âö™Wc@sfdZddlmZddlmZddlmZmZddlm	Z	ddl
mZd	Zd
Z
dZdZi	d
d6dd6dd6dd6dd6dd6dd6dd6dd6ZdeZd eZd!Zd"Zd#Zd$eZd%Zd&eZd'eZd(eZd)eZd*Zd+Zed,Zd-efd.„ƒYZd/efd0„ƒYZ d1„Z!d2S(3u§

Smarty extension for Python-Markdown
====================================

Adds conversion of ASCII dashes, quotes and ellipses to their HTML
entity equivalents.

See <https://pythonhosted.org/Markdown/extensions/smarty.html>
for documentation.

Author: 2013, Dmitry Shachnev <mitya57@gmail.com>

All changes Copyright 2013-2014 The Python Markdown Project

License: [BSD](http://www.opensource.org/licenses/bsd-license.php)

SmartyPants license:

   Copyright (c) 2003 John Gruber <http://daringfireball.net/>
   All rights reserved.

   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions are
   met:

   *  Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.

   *  Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in
      the documentation and/or other materials provided with the
      distribution.

   *  Neither the name "SmartyPants" nor the names of its contributors
      may be used to endorse or promote products derived from this
      software without specific prior written permission.

   This software is provided by the copyright holders and contributors "as
   is" and any express or implied warranties, including, but not limited
   to, the implied warranties of merchantability and fitness for a
   particular purpose are disclaimed. In no event shall the copyright
   owner or contributors be liable for any direct, indirect, incidental,
   special, exemplary, or consequential damages (including, but not
   limited to, procurement of substitute goods or services; loss of use,
   data, or profits; or business interruption) however caused and on any
   theory of liability, whether in contract, strict liability, or tort
   (including negligence or otherwise) arising in any way out of the use
   of this software, even if advised of the possibility of such damage.


smartypants.py license:

   smartypants.py is a derivative work of SmartyPants.
   Copyright (c) 2004, 2007 Chad Miller <http://web.chad.org/>

   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions are
   met:

   *  Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.

   *  Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in
      the documentation and/or other materials provided with the
      distribution.

   This software is provided by the copyright holders and contributors "as
   is" and any express or implied warranties, including, but not limited
   to, the implied warranties of merchantability and fitness for a
   particular purpose are disclaimed. In no event shall the copyright
   owner or contributors be liable for any direct, indirect, incidental,
   special, exemplary, or consequential damages (including, but not
   limited to, procurement of substitute goods or services; loss of use,
   data, or profits; or business interruption) however caused and on any
   theory of liability, whether in contract, strict liability, or tort
   (including negligence or otherwise) arising in any way out of the use
   of this software, even if advised of the possibility of such damage.

iÿÿÿÿ(tunicode_literalsi(t	Extensioni(tHtmlPatterntHTML_RE(tOrderedDict(tInlineProcessoru)[!"#\$\%'()*+,-.\/:;<=>?\@\[\\\]\^_`{|}~]u[\s.,;:!?)]u[^\ 	
\[\{\(\-]u1(\s|&nbsp;|--|–|—|&[mn]dash;|&#8211;|&#8212;)u&mdash;umdashu&ndash;undashu&hellip;uellipsisu&laquo;uleft-angle-quoteu&raquo;uright-angle-quoteu&lsquo;uleft-single-quoteu&rsquo;uright-single-quoteu&ldquo;uleft-double-quoteu&rdquo;uright-double-quoteu
^'(?=%s\B)u
^"(?=%s\B)u"'(?=\w)u'"(?=\w)u(?<!\w)'(?=\d{2}s)u	%s"(?=\w)u"(?=\s)u(?<=%s)"u	%s'(?=\w)u(?<=%s)'(?!\s|s\b|\d)u(?<=%s)'(\s|s\b)u'u"u(?!\>)tSubstituteTextPatterncBseZd„Zd„ZRS(cCs&tj||ƒ||_||_dS(u" Replaces matches with some text. N(Rt__init__treplacetmarkdown(tselftpatternRtmarkdown_instance((s8build/lib.linux-x86_64-2.7/markdown/extensions/smarty.pyRšs	cCsbd}xU|jD]J}t|tƒr;||j|ƒ7}q||jjj|dtƒ7}qW|S(Nutsafe(Rt
isinstancetinttgroupR	t	htmlStashtstoretTrue(R
tmtresulttpart((s8build/lib.linux-x86_64-2.7/markdown/extensions/smarty.pythandleMatch s#(t__name__t
__module__RR(((s8build/lib.linux-x86_64-2.7/markdown/extensions/smarty.pyR™s	tSmartyExtensioncBsGeZd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(cOs•itdgd6tdgd6tdgd6tdgd6id	gd
6|_tt|ƒj||Žttƒ|_|jj|j	d
diƒƒdS(NuEducate quotesusmart_quotesuEducate angled quotesusmart_angled_quotesuEducate dashesusmart_dashesuEducate ellipsesusmart_ellipsesuOverwrite default substitutionsu
substitutionstdefault(
RtFalsetconfigtsuperRRtdictt
substitutionstupdatet	getConfig(R
targstkwargs((s8build/lib.linux-x86_64-2.7/markdown/extensions/smarty.pyR«s



cCs€xyt|ƒD]k\}}||f7}t|Œ}|rLd||dfnd}d||f}|jj|||ƒq
WdS(Nu
>smarty-%s-%diu_beginusmarty-%s-%d(t	enumerateRtinlinePatternstadd(R
tmdtpatternstserietindRtaftertname((s8build/lib.linux-x86_64-2.7/markdown/extensions/smarty.pyt_addPatterns·s
 cCshtd|jdf|ƒ}td|jdf|ƒ}|jjd|dƒ|jjd|dƒdS(	Nu(?<!-)---(?!-)umdashu
(?<!-)--(?!-)undashusmarty-em-dashesu_beginusmarty-en-dashesu>smarty-em-dashes(RR R&R'(R
R(temDashesPatterntenDashesPattern((s8build/lib.linux-x86_64-2.7/markdown/extensions/smarty.pyt
educateDashes¿s	cCs6td|jdf|ƒ}|jjd|dƒdS(Nu(?<!\.)\.{3}(?!\.)uellipsisusmarty-ellipsesu_begin(RR R&R'(R
R(tellipsesPattern((s8build/lib.linux-x86_64-2.7/markdown/extensions/smarty.pyteducateEllipsesËscCshtd|jdf|ƒ}td|jdf|ƒ}|jjd|dƒ|jjd|dƒdS(	Nu\<\<uleft-angle-quoteu\>\>uright-angle-quoteusmarty-left-angle-quotesu_beginusmarty-right-angle-quotesu>smarty-left-angle-quotes(RR R&R'(R
R(tleftAngledQuotePatterntrightAngledQuotePattern((s8build/lib.linux-x86_64-2.7/markdown/extensions/smarty.pyteducateAngledQuotesÑs	
	cCsþ|jd}|jd}|jd}|jd}t|fft|fft||fft||fft|fftd|fft|fft|dfft	|fft
d|fft|fft|fft
|fff
}|j||dƒdS(Nuleft-single-quoteuright-single-quoteuleft-double-quoteuright-double-quoteiuquotes(R tsingleQuoteStartRetdoubleQuoteStartRetdoubleQuoteSetsRetsingleQuoteSetsRetdecadeAbbrRetopeningSingleQuotesRegextclosingSingleQuotesRegextclosingSingleQuotesRegex2tremainingSingleQuotesRegextopeningDoubleQuotesRegextclosingDoubleQuotesRegextclosingDoubleQuotesRegex2tremainingDoubleQuotesRegexR.(R
R(tlsquotrsquotldquotrdquoR)((s8build/lib.linux-x86_64-2.7/markdown/extensions/smarty.pyt
educateQuotesás$



cCsÞ|jƒ}tƒ|_|dr2|j|ƒn|drL|j|ƒn|dr||j|ƒtt|ƒ|jd<n|dr–|j|ƒnt	|ƒ}|j|_|j
jd|dƒ|jj
dd	gƒdS(
Nusmart_ellipsesusmart_quotesusmart_angled_quotesuhtmlusmart_dashesusmartyu_endu"u'(t
getConfigsRR&R3RHR6RtHTML_STRICT_RER1RttreeprocessorsR't
ESCAPED_CHARStextend(R
R(t
md_globalstconfigstinlineProcessor((s8build/lib.linux-x86_64-2.7/markdown/extensions/smarty.pytextendMarkdown÷s




(	RRRR.R1R3R6RHRQ(((s8build/lib.linux-x86_64-2.7/markdown/extensions/smarty.pyRªs						cOs
t||ŽS(N(R(R#R$((s8build/lib.linux-x86_64-2.7/markdown/extensions/smarty.pyt
makeExtensionsN("t__doc__t
__future__RtRtinlinepatternsRRtodictRRKRt
punctClasstendOfWordClasst
closeClasstopeningQuotesBaseR R7R8R9R:R;R@RARBR<R=R>R?RCRJRRRR(((s8build/lib.linux-x86_64-2.7/markdown/extensions/smarty.pyt<module>QsH	








a