1
0
mirror of https://github.com/danog/blackfriday.git synced 2024-11-30 04:29:13 +01:00
Commit Graph

24 Commits

Author SHA1 Message Date
Vytautas Šaltenis
f90a576a05 Untangle some mess with attribute escaping
1. Remove unused preserveEntities parameters
2. Move attrEscape() implementation inside esc()
3. Delegate most of esc() work to escCode()
2016-07-02 10:45:06 +03:00
Vytautas Šaltenis
76d8c71d70 Unduplicate attrEscape funcs 2016-04-11 15:55:50 +03:00
Vytautas Šaltenis
a55b2615a4 Run Smartypants as a separate pass over the AST
Separate Smartypants somewhat from the HTML renderer. Move its flags
from HtmlFlags to Extensions (probably should be moved to its own set of
flags, but not now). With that done, do a separate walk of the tree and
either run Smartypants processor if it's enabled, or simply escape text
nodes.
2016-04-01 10:44:22 +03:00
Vytautas Šaltenis
7869a127bd Combine two Smartypants structs into one
Combine smartypantsRenderer and smartypantsData into one struct. Make
action funcs methods on that struct.
2016-03-31 21:40:37 +03:00
Vytautas Šaltenis
ee98bc0bf4 Massive replacement of C_STYLE flags to typed ones 2015-11-10 21:08:32 +02:00
Anthony Fok
38cc6e9ae8 Add HTML_SMARTYPANTS_DASHES for toggling smart dashes 2015-08-03 23:57:26 -06:00
Anthony Fok
2c9fe2cd03 Avoid converting dates into fractions
So that dates like 1/2/2005 and 2005/3/4 stay the way it is
without turning into ½/2005 and 2005/¾.

See http://discuss.gohugo.io/t/any-way-to-disable-smart-fractions/328
for discussions.
2015-01-24 15:23:48 -07:00
bep
857a1a0260 Add support for angled, double quotes
The flag `HTML_SMARTYPANTS_ANGLED_QUOTES` combined with `HTML_USE_SMARTYPANTS` configures rendering of double quotes as angled left and right quotes (« »).

The SmartyPants documentation mentions a special syntax for these, `<<>>`, a syntax neither pretty nor user friendly.

Typical use cases would be either or, or combined, but never in the same document. As an example would be a person from Norway; he has a blog in both English and Norwegian (his native tounge); he would then configure Blackfriday to use angled quotes for the Norwegian section, but keep them as reqular double quotes for the English.

If the flag `HTML_SMARTYPANTS_ANGLED_QUOTES` is not provided, everything works as before this commit.
2014-11-05 23:29:41 +01:00
Russ Ross
48d1f9d9cc fix smartypants to pass single backticks through, issue #38 2013-10-01 13:55:34 -06:00
Russ Ross
b3c6494605 recognize fraction slash as well as regular slash to make fractions 2012-03-11 16:10:42 -06:00
Russ Ross
bb8ee591d1 doc improvements, commenting 2011-07-07 11:56:45 -06:00
Russ Ross
2b87b0e786 simplify naming of parsing functions 2011-07-05 14:22:21 -06:00
Russ Ross
3c6f18afc7 Renderer is now an interface 2011-06-29 11:13:17 -06:00
Russ Ross
b1a0318250 refactoring: inline renderers return bools, preparing rendering struct to become an interface 2011-06-28 19:46:35 -06:00
Russ Ross
55cde00c8a camel case 2011-06-28 16:02:12 -06:00
Russ Ross
fde2c60665 version number, few more options for command-line tool 2011-06-28 11:30:10 -06:00
Russ Ross
f8f70572a4 simplified BSD license 2011-06-27 20:11:32 -06:00
Russ Ross
157bb44c05 improved (hopefully) smart quote handling 2011-06-22 15:40:58 -06:00
Russ Ross
df64ec5d0f allocate new buffers on stack; mild speed improvement 2011-05-31 11:11:04 -06:00
Russ Ross
81cefb5e7c split parser into multiple files, clean up naming 2011-05-29 17:00:31 -06:00
Russ Ross
59dc1f8599 fix smartypants and html entity escaping 2011-05-28 22:50:33 -06:00
Russ Ross
de40da7ad6 escape entities when using smartypants 2011-05-28 22:39:22 -06:00
Russ Ross
9a11e96633 readme file 2011-05-28 21:33:16 -06:00
Russ Ross
965748ad3d refactored into a proper package 2011-05-28 21:17:53 -06:00