Commit graph

88 commits

Author SHA1 Message Date
Vicent Marti
a20ff08f6c Change include wards 2011-11-26 07:06:50 +01:00
Vicent Marti
c5eb872e97 Backport the changes to autolinking URLs by @codyrobbins 2011-11-26 07:00:43 +01:00
Vicent Martí
187444d917 Merge pull request #83 from cweider/master
Exclude <style> blocks from replacement
2011-11-25 21:56:06 -08:00
Vicent Martí
be410f637d Merge pull request #82 from andre-d/linktextfix
Corrected the way link alt text is handled
2011-11-25 21:54:59 -08:00
Vicent Marti
54523fc7db Initialize the in_link_body variable 2011-11-26 06:53:52 +01:00
Chad Weider
d976a845ad Commit compiled code. 2011-11-25 13:51:55 -08:00
Andre D
7b42d86de0 Corrected the way link alt text is handled 2011-11-22 22:04:14 -05:00
Andre D
6cbb0c9995 Nesting lists of different types works again 2011-11-21 14:43:02 -05:00
Vicent Martí
d2d3c533a9 Merge pull request #80 from andre-d/master
Fixes corruption with vbufprintf
2011-11-17 19:29:10 -08:00
Vicent Marti
9dfeea9da1 Backport changes from Snudown
Add escaping to ~ and ^, and disable autolinking inside of link bodies.
Note that the fix for autolinking is different than the one in Snudown;
I didn't want to touch the callbacks table.
2011-11-18 04:17:19 +01:00
Vicent Marti
3c32220c7b Fix unordered lists followed by ordered list bug
"An unordered list followed by an ordered list (separated by double
linebreake) yields only an unordered list with a set of paragraphs
inside it."

Original patch by Igor Bochkariov, backported from Redcarpet.
2011-11-06 21:21:06 +01:00
Andre D
86b851a55b Corruption in vbufprintf 2011-11-01 18:02:00 -04:00
Neil Williams
720ff71578 Make sure www-autolink text is entity-escaped.
rndr_link assumes the text is already escaped because
it's usually run through parse_inline. This is not true
when it's called via www-autolink.
2011-09-15 20:58:20 -07:00
Vicent Marti
137c1e6f20 Fix table cells being rendered as table headers 2011-09-13 19:44:40 +02:00
Vicent Marti
3cb0b6873a Locate block tags even if they have attributes
Previously, block tags like <div>foo</div> were being properly detected,
but tags with attributes such as <div class="blank">foo</div> were
inproperly discarded.
2011-09-13 19:26:59 +02:00
Vicent Marti
47c25422f1 Fix detection of block tags 2011-09-08 23:03:39 +02:00
Vicent Marti
9970b3da05 Fix out of bounds in stack 2011-09-08 06:41:57 +02:00
brief
78a764317b Use explicit cast to fix compiler warning 2011-09-03 14:34:03 -07:00
brief
97da8f23da Enforce const when parsing emphasis 2011-09-03 14:21:58 -07:00
Vicent Marti
63b1a9ebcf Enforce const on the renderer API 2011-09-02 23:40:21 +02:00
Vicent Marti
c650128164 Remove ref counting from the buffer struct 2011-09-02 23:33:59 +02:00
Vicent Marti
b8ed678a98 Enforce const on input document 2011-09-02 21:28:47 +02:00
Vicent Marti
6091758705 Do not use a local-aware isspace
It may conflict with UTF-8 characters in the extended range.
2011-09-02 21:12:45 +02:00
Vicent Marti
c059d133d2 Remove superfluous check for tab characters
All tabs are expanded during preprocessing.
2011-09-02 20:57:00 +02:00
Vicent Marti
d7d2af549e UTF-8 handling overhaul
Sundown doesn't handle "strings of characters", it handles buffers
with bytes with an UTF-8 encoding.

Name stuff accordingly.
2011-09-02 20:19:48 +02:00
Vicent Marti
03e8ae0f1d stack: Properly zero-out the stack after reallocations 2011-09-02 04:53:14 +02:00
Vicent Marti
429546d2cd Add missing Stack code
Oops... Forgot about it.
2011-09-01 06:26:30 +02:00
Vicent Marti
b9670c1570 Prefer header lines to item lists
If a line is followed by a header line, do always render it as a header,
even if it begins with a number or slash.
2011-09-01 06:11:33 +02:00
Vicent Marti
c8e42e1eaf Fix #57 "Issue with emphasized links"
The closing character was mismatched.
2011-09-01 05:50:40 +02:00
Vicent Marti
fcfb81f24d Fix #56 "nested strong/em"
I don't understand what was that check doing there, but it makes no
sense. Emphasis parsing is non-greedy, so it should always close on the
nearest match.
2011-09-01 05:43:05 +02:00
Vicent Marti
13359d5898 Create a standalone markdown object
This was the next logical step on the interface revamp for 2.0.

The old API was doing very fishy stuff with allocation: the `rndr`
struct was being called once for every `sd_markdown` call, and the
amount stack space filled with it was just inappropriate (256 bytes
just from the char table and 300 more from pointers in the callback
table).

By creating the renderer on the heap and reusing it, we save a lot of
time on initialization code, at the expense of not being able to
change the enabled extensions on each parse (something which is not
that common anyway).

This will make wrapping Sundown in higher level languages more direct,
given that every other language has OO design, which maps better to
the concept of a reusable renderer.
2011-09-01 05:02:26 +02:00
Vicent Marti
fa42843852 Drop dependency on the old array.c
The old array was not quite optimal, and was not used optimally either.

- The `struct array` that was used for accessing link references has
been replaced with a minimal, fixed-width hash table. This should
be much more straightforward for small documents.

- The `struct parray` used as a string pool has been replaced with
a fast-growing stack. Realloc'ing once per push has never been a
good idea anyway.

Yey for losing boilerplate!
2011-09-01 04:32:38 +02:00
Vicent Marti
9988a0123c Perfect hashing for HTML block names
Because fuck binary searches, that's why.
2011-08-30 17:46:06 +02:00
Vicent Marti
714348714d Cleanup table parsing 2011-08-08 21:11:42 -07:00
Neil Williams
6cfe32ade8 Use <th> for table header cells. 2011-08-08 20:57:35 -07:00
Vicent Marti
a0b0a11d0e markdown: Fix codespan skip
Backport from Upskirt. Thanks Natacha!
2011-08-08 12:35:50 -07:00
Vicent Marti
dd979be0ed Experimental: New Renderer management
No more dynamic allocation. Explicit is better than implicit.
2011-08-04 16:22:38 +02:00
Vicent Marti
1d6f114b86 Sup bro
Add support for the Superscript extension.
2011-07-25 02:15:43 +02:00
Vicent Marti
251d02a260 i += 1 is boring 2011-07-19 21:45:38 +02:00
Vicent Marti
e3e2f5e53d Fix invalid memory read in find_emph_char 2011-07-19 21:44:43 +02:00
Vicent Marti
cdfaee1993 smartypants: Do not replace inside <code> blocks
Following the original Smartypants code, do not do SmartyPants
replacements inside of <code>, <pre>, <kbd> and <script> blocks.
2011-07-19 21:32:14 +02:00
Vicent Marti
7cba7b6ba3 Add figure as block-level tag 2011-07-19 20:45:11 +02:00
Brandon Croft
3b8605f248 fix autolink.h include guard 2011-07-19 03:29:33 -06:00
Vicent Marti
5d201dbcdc Rename Upskirt to Sundown
It is by the goodness of God that in our country we have those
three unspeakably precious things:

    freedom of speech,
    freedom of conscience,
    and the prudence never to practice either of them.

                -- Mark Twain, Following the Equator (1897)
2011-07-19 01:10:05 +02:00
Vicent Marti
3b0a641094 Dashes are allowed in domain names! 2011-06-19 20:58:36 +02:00
Vicent Marti
76fd65c396 autolink: Better domain name checker 2011-06-11 16:18:18 +02:00
Vicent Marti
cf5cb52ae9 Remove html_autolink.c
This file has been moved to Rinku
2011-06-11 16:17:51 +02:00
Vicent Marti
b3957282ce autolink: Cleanup API 2011-06-09 02:58:06 +02:00
Vicent Marti
8af37fd1b4 autolinking: fix bugs 2011-06-08 23:11:58 +02:00
Vicent Marti
cbb7fb53c6 Create an autolinking API for external applications 2011-06-08 18:30:37 +02:00