Commit graph

284 commits

Author SHA1 Message Date
Xavier Mendez
810c79db34 Reset the TOC header count after a render (closes #147) 2014-12-25 11:13:53 +01:00
Xavier Mendez
a8fdc099bd Release version 3.0.1 2014-12-01 23:16:37 +01:00
Steve Wolter
d2dde183ee Fix out-of-bounds memory access in tab expansion.
The loop performs two jobs: Find the first tabstop, and counting the number of
characters before it. To count the number of characters before the
tabstop, it counts all bytes that are not UTF-8 continuation bytes.
The current form of the loop doesn't check the first character, but
checks the character past the range's end. Since these are both
usually non-continuation characters, it does the right thing accidentally.
However, it accesses the character range at index `size`, which is
forbidden and might be uninitialized for strings that are not
null-terminated.
2014-12-01 12:35:43 +01:00
Steve Wolter
737304d2aa Fix issue #125: Don't escape HTML tags in tables of contents.
Before this patch, a header like "# *A*" was displayed as
"<li>&lt;em&gtA&lt;/em&gt;</li>" in the TOC. The error was caused by
toc_header doing the HTML escaping. In the normal HTML renderer, the escaping
is done by the normal_text hook. This patch uses the same handling to
fix the issue.
2014-12-01 12:35:14 +01:00
Xavier Mendez
3afc3ec505 Release v3.0.0! 2014-11-04 19:18:32 +01:00
Devin Torres
9aa8c8acf1 Use a stricter subset of C 2014-10-18 18:33:34 -05:00
Devin Torres
4e1b16cfab Merge pull request #130 from MarkLodato/utf8-tab-expansion
Make tab expansion UTF-8 aware.
2014-10-04 16:56:22 -05:00
Devin Torres
278702f097 Merge pull request #126 from mo/typofixes
Fixes a few typos
2014-10-04 05:13:42 -05:00
Xavier Mendez
9b561d721e Don't use "for (declaration" 2014-10-04 12:00:11 +02:00
Devin Torres
758951ba6d Merge pull request #124 from jmendeth/renderer-api
Renderer API
2014-10-02 22:16:52 -05:00
Xavier Mendez
f7384f0d70 Revert hoedown_inline 2014-10-02 21:51:38 +02:00
Mark Lodato
23a8c1933b Make expand_tabs() UTF-8 aware.
Previously, expand_tabs() counted every *byte* rather than every *character*
to determine the proper tab stops.  This change fixes that by skipping over
UTF-8 continuation bytes (bytes of the form 10xxxxxx), which are the only
types of bytes in valid UTF-8 that do not start a character.

This code does not skip over combining characters.
2014-09-22 10:06:25 -04:00
Martin Olsson
aec5b6f782 Fix a few typos 2014-09-19 22:48:02 +02:00
Xavier Mendez
108ee1a463 Remove HTML_SAFELINK and EXT_LAX_SPACING 2014-09-19 17:45:32 +02:00
Xavier Mendez
5215172914 Don't require spacing around math spans (fix #120) 2014-09-14 19:00:10 +02:00
Xavier Mendez
1ece600df1 Properly name category 2014-09-14 13:56:04 +02:00
Xavier Mendez
4684906bd8 Split table in table_header and table_body
Only one parameter  (`content`) can have rendered output.
The `table` callback contradicts this rule, so it has to be split
in `table_header` and `table_body`.

This also helps keep the HTML renderer code dry and readable.
2014-09-14 13:52:56 +02:00
Xavier Mendez
544246c672 Call it content when it's rendered output, text otherwise
If it's rendered output, i.e. output coming from other callbacks,
it must be called `content`, and be the first parameter after `ob`.
2014-09-14 12:28:25 +02:00
Xavier Mendez
2fca42565a Rename raw_html_tag to just raw_html 2014-09-14 11:21:14 +02:00
Xavier Mendez
f83d1686f4 Put HTML callbacks at the end of their categories 2014-09-14 11:21:14 +02:00
Xavier Mendez
5fda56777d Update HTML renderer to use new API 2014-09-14 11:21:14 +02:00
Xavier Mendez
6dbc94872b Add render_inline parameter to header and footer callbacks 2014-09-14 11:21:14 +02:00
Xavier Mendez
f6700624da Create renderer_data and pass it to callbacks 2014-09-14 11:21:13 +02:00
Florian Hahn
d0759dd208 Include strings.h to silence warnings for strncasecmp 2014-09-14 00:21:08 +02:00
Xavier Mendez
8c14212dd9 Use memcmp in hoedown_buffer_eq(...) 2014-09-09 11:05:14 +02:00
Xavier Mendez
30dd50f16a Keep code without warnings 2014-09-04 14:17:50 +02:00
Xavier Mendez
821b3495ce Keep up to date with master 2014-09-04 14:09:04 +02:00
Xavier Mendez
a715656fb7 Add __builtin_expect fallback for MSVC 2014-09-03 11:14:58 +02:00
Xavier Mendez
73d8a1120a More fixes 2014-09-03 10:39:33 +02:00
Xavier Mendez
a6b90a7cf7 Import improvements from Lanli (and more things) 2014-09-02 19:21:58 +02:00
Xavier Mendez
1868710ff4 Keep up to date with master
Conflicts:
	src/document.c
2014-09-02 00:54:00 +02:00
Xavier Mendez
3a1d4f0a21 Rename MATH_DOLLAR to MATH_EXPLICIT, update descriptions 2014-09-02 00:46:28 +02:00
Xavier Mendez
960179e51f document: Make MATH extension context-sensitive 2014-09-02 00:41:12 +02:00
Xavier Mendez
0088492f5e html: Add *provisional* implementation for MATH 2014-08-18 12:04:03 +02:00
Xavier Mendez
d3c7ec801b document: Implement MATH extension 2014-08-18 12:03:18 +02:00
Xavier Mendez
62908524c5 document: Simplify finding of HTML block end tag 2014-08-17 22:49:41 +02:00
Xavier Mendez
18df3a98ca document: Never omit the newline on sublists
See https://github.com/hoedown/hoedown/issues/102#issuecomment-52290938 for discussion.
2014-08-15 20:24:33 +02:00
Xavier Mendez
d59438f36c document: Optimize replace_spacing to pregrow output buffer 2014-08-14 23:36:51 +02:00
Xavier Mendez
514e80acb8 document: Make replace_spacing collapse newlines 2014-08-14 23:14:55 +02:00
Xavier Mendez
f81eac9e1e document: Better fix for #84
Made stricter: now it'll only reject the codefence if the delimiter
that was used to start it is found three consecutive times.
2014-08-14 22:04:57 +02:00
Xavier Mendez
c56d635afd document: Use find_emph_char for links (fixes #106)
As long as there's a valid matching ] at the end, and there's no
codespan inside the link, things should render exactly the same
as before. Please review this.
2014-08-14 20:55:16 +02:00
Xavier Mendez
7dce1ac18a document: Simplify char_link(...)
(This is to prepare for next commit)
2014-08-14 20:42:28 +02:00
Xavier Mendez
fbe1448b1f document: Allow images to be escaped (fixes #108) 2014-08-14 18:03:54 +02:00
Xavier Mendez
a87d39e0c8 document: Allow footnotes to be parsed when link == NULL (fixes #66) 2014-08-13 11:33:48 +02:00
Xavier Mendez
17a6992dba document: Move list typechecking logic to right location (fixes #102) 2014-08-13 11:30:22 +02:00
Xavier Mendez
646c8de9d2 document: Avoid parsing codespan as a fence (fixes #84) 2014-08-13 11:28:13 +02:00
Devin Torres
6590101008 Merge pull request #97 from uranusjr/fix_89-markup-escape
Fix markup characters escaping
2014-08-13 00:26:32 -05:00
Devin Torres
e2d34bba00 Merge pull request #96 from jmendeth/parse-inline
Add hoedown_document_render_inline
2014-08-13 00:15:22 -05:00
Tzu-ping Chung
efc8974c73 Use find_emph_char to find delims in char_quote 2014-08-13 10:38:11 +08:00
Tzu-ping Chung
492e3d14de find_emph_char should starts from the beginning
This fixes bugs for edge cases of pattern:

    opening  backtick  ending  [any]  backtick  [any]  ending

Examples: *`**`* and __`__`__

Range handling in 48a19b3 and e7bcbe3 is also changed to match the
correct behavior.
2014-08-11 03:38:27 +08:00