From 873ec1a06d62fd46fa9d4e607e9a302f2e1f01f5 Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Thu, 20 Oct 2016 10:28:40 -0400 Subject: [PATCH] Upgrade SmartyPants version for TextformatterSmartypants module, plus updates per processwire/processwire-issues#17 --- .../Michelf/License.md | 36 + .../Michelf/Readme.md | 220 +++ .../Michelf/SmartyPants.inc.php | 9 + .../Michelf/SmartyPants.php | 513 +++++++ .../Michelf/SmartyPantsTypographer.inc.php | 10 + .../Michelf/SmartyPantsTypographer.php | 553 ++++++++ .../TextformatterSmartypants.module | 88 +- .../TextformatterSmartypants/smartypants.php | 1186 ----------------- 8 files changed, 1423 insertions(+), 1192 deletions(-) create mode 100755 wire/modules/Textformatter/TextformatterSmartypants/Michelf/License.md create mode 100755 wire/modules/Textformatter/TextformatterSmartypants/Michelf/Readme.md create mode 100755 wire/modules/Textformatter/TextformatterSmartypants/Michelf/SmartyPants.inc.php create mode 100755 wire/modules/Textformatter/TextformatterSmartypants/Michelf/SmartyPants.php create mode 100755 wire/modules/Textformatter/TextformatterSmartypants/Michelf/SmartyPantsTypographer.inc.php create mode 100755 wire/modules/Textformatter/TextformatterSmartypants/Michelf/SmartyPantsTypographer.php delete mode 100644 wire/modules/Textformatter/TextformatterSmartypants/smartypants.php diff --git a/wire/modules/Textformatter/TextformatterSmartypants/Michelf/License.md b/wire/modules/Textformatter/TextformatterSmartypants/Michelf/License.md new file mode 100755 index 00000000..20aad723 --- /dev/null +++ b/wire/modules/Textformatter/TextformatterSmartypants/Michelf/License.md @@ -0,0 +1,36 @@ +PHP SmartyPants Lib +Copyright (c) 2005-2016 Michel Fortin + +All rights reserved. + +Original SmartyPants +Copyright (c) 2003-2004 John Gruber + +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. diff --git a/wire/modules/Textformatter/TextformatterSmartypants/Michelf/Readme.md b/wire/modules/Textformatter/TextformatterSmartypants/Michelf/Readme.md new file mode 100755 index 00000000..06b9210a --- /dev/null +++ b/wire/modules/Textformatter/TextformatterSmartypants/Michelf/Readme.md @@ -0,0 +1,220 @@ +PHP SmartyPants +=============== + +PHP SmartyPants Lib 1.7.1 - 16 Oct 2016 + +by Michel Fortin + + +Original SmartyPants by John Gruber + + + +Introduction +------------ + +This is a library package that includes the PHP SmartyPants and its +sibling PHP SmartyPants Typographer with additional features. + +SmartyPants is a free web typography prettifyier tool for web writers. It +easily translates plain ASCII punctuation characters into "smart" typographic +punctuation HTML entities. + +PHP SmartyPants is a port to PHP of the original SmartyPants written +in Perl by John Gruber. + +SmartyPants can perform the following transformations: + +* Straight quotes (`"` and `'`) into “curly” quote HTML entities +* Backtick-style quotes (` ``like this'' `) into “curly” quote HTML + entities +* Dashes (`--` and `---`) into en- and em-dash entities +* Three consecutive dots (`...`) into an ellipsis entity + +SmartyPants Typographer can perform additional transformations: + +* French guillemets done using (`<<` and `>>`) into true « guillemets » + HTML entities. +* Comma-style quotes (` ,,like this`` ` or ` ''like this,, `) into their + curly equivalent. +* Replace existing spaces with non-break spaces around punctuation marks + where appropriate, can also add or remove them if configured to. +* Replace existing spaces with non-break spaces for spaces used as + a thousand separator and between a number and the unit symbol that + follows it (for most common units). + +This means you can write, edit, and save using plain old ASCII straight +quotes, plain dashes, and plain dots, but your published posts (and +final HTML output) will appear with smart quotes, em-dashes, proper +ellipses, and proper no-break spaces (with Typographer). + +SmartyPants does not modify characters within `
`, ``,
+``, or `