summaryrefslogtreecommitdiff
path: root/src/inlines.c
AgeCommit message (Collapse)Author
2016-04-09Fixed whitespace.John MacFarlane
2016-04-09Use library functions to insert nodes in emphasis/link processing.John MacFarlane
Previously we did this manually, which introduces many places where errors can creep in.
2016-03-12Switch from "inline" to "CMARK_INLINE"Nick Wellnhofer
Newer MSVC versions support enough of C99 to be able to compile cmark in plain C mode. Only the "inline" keyword is still unsupported. We have to use "__inline" instead.
2015-12-28Don't allow space between link text and link labelJohn MacFarlane
in a reference link. (Spec change.)
2015-12-28Rename NODE_HTML -> NODE_HTML_BLOCK, NODE_INLINE_HTML -> NODE_HTML_INLINE.John MacFarlane
API change. Sorry, but this is the time to break things, before 1.0 is released. This matches the recent changes to CommonMark.dtd.
2015-12-19Use fully qualified versions of constants.John MacFarlane
2015-08-10Remove need to disable MSVC warning 4800Kevin Wojniak
2015-08-07Fixed `--hardbreaks` with CRLF line breaks.John MacFarlane
Closes #68.
2015-08-06Prefix utf8proc functions to avoid conflict with existing libraryKevin Wojniak
2015-07-27Use clang-format, llvm style, for formatting.John MacFarlane
* Reformatted all source files. * Added 'format' target to Makefile. * Removed 'astyle' target. * Updated .editorconfig.
2015-07-15Improved `make_autolink`.John MacFarlane
Ensures that title is chunk with empty string rather than NULL, as with other links. Avoids "potential memory leak" warning from clang static analyzer (though I couldn't measure one with valgrind).
2015-07-15Use full CMARK_NODE_x instead of NODE_x alias.John MacFarlane
2015-07-13Removed assertion that broke debug build.John MacFarlane
2015-07-09Implemented new treatment of dashes with `--smart`.John MacFarlane
2015-06-18process_emphasis: Fixed setting lower bound to potential openers.John MacFarlane
2015-06-18Rename potential_openers -> openers_bottom.John MacFarlane
2015-06-18Rename start_delim -> stack_bottom.John MacFarlane
2015-06-17Fixed emphasis/link parsing bug.John MacFarlane
Closes #59.
2015-06-17Added assertion to peek_char to catch any stray NULLs.John MacFarlane
Note that our current procedure for removing nulls is not working properly.
2015-06-16Small code simplification in inlines.c.John MacFarlane
Use S_is_line_end_char.
2015-06-16skip_spaces: skip tabs too.John MacFarlane
2015-06-16Don't rtrim in subject_from_buffer.John MacFarlane
This gives bad results in parsing reference links, where we might have trailing blanks. (finalize in blocks.c removes the bytes parsed as a reference definition; before this change, some blank bytes might remain on the line.)
2015-06-15Fixed cases likeJohn MacFarlane
``` [ref]: url "title" ok ``` Here we should parse the first line as a reference.
2015-06-15inlines.c: Added utility functions to skip spaces and line endings.John MacFarlane
2015-06-11Small logic fixes and a simplification in process_emphasis.John MacFarlane
2015-06-11Fixed `process_emphasis` to handle new pathological cases.John MacFarlane
Now we have an array of pointers (`potential_openers`), keyed to the delim char. When we've failed to match a potential opener prior to point X in the delimiter stack, we reset `potential_openers` for that opener type to X, and thus avoid having to look again through all the openers we've already rejected. See jgm/commonmark#43.
2015-06-10More code simplification.John MacFarlane
2015-06-10Code simplification.John MacFarlane
2015-06-10process_inlines: remove closers from delim stack when possible.John MacFarlane
When they have no matching openers and cannot be openers themselves, we can safely remove them. This helps with a performance case: "a_ " * 20000. See jgm/commonmark.js#43.
2015-06-07Convert code base to strbuf_tNick Wellnhofer
There are probably a couple of places I missed. But this will only be a problem if we use a 64-bit bufsize_t at some point. Then, we'll get warnings from -Wshorten-64-to-32.
2015-06-06astyle formatting changes.John MacFarlane
2015-06-04Don't allow link labels with no non-whitespace characters.John MacFarlane
See jgm/CommonMark#322.
2015-06-03Merge branch 'master' of https://github.com/btrask/cmark into btrask-masterJohn MacFarlane
Conflicts: src/blocks.c
2015-05-14Store link URL and title as cmark_chunkNick Wellnhofer
2015-04-27Fixed _ emphasis parsing to conform to spec.John MacFarlane
See jgm/CommonMark#317.
2015-04-07Add CRLF/CR handling to inlines.c.Ben Trask
2015-03-30Fixed memory issue.John MacFarlane
This fixes valgrind "invalid read of size 1" on input `[link](<>)`.
2015-03-03astyle changes.John MacFarlane
2015-02-18Repacked delimiter struct to avoid hole.John MacFarlane
2015-02-17Moved a test outside a loop.John MacFarlane
2015-02-16Rename CMARK_OPT_SMARTPUNCT -> CMARK_OPT_SMART.John MacFarlane
2015-02-16Made 'options' an int rather than a long.John MacFarlane
For consistency with the API.
2015-02-16Use ascii escapes for punctuation characters for portability.John MacFarlane
2015-02-16Properly handle " with no matching close quote with --smart.John MacFarlane
This occurs in fiction: when a speaker has dialogue with multiple paragraphs, a close quote is used only on the final one. Added test cases.
2015-02-15Moved handling of --smart from renderer to parser.John MacFarlane
This allows backslash escapes to disable smart quote transformations in particular cases. Closes #8.
2015-02-15Added options parameter to cmark_parse_document, cmark_parse_file.John MacFarlane
Also to some non-exported functions in blocks and inlines.
2015-02-14astyle changes (code formatting only).John MacFarlane
2015-01-18Changed rule for `_` emphasis and strong emphasis.John MacFarlane
To prevent intra-word emphasis, we used to check to see if the delimiter was followed/preceded by an ASCII alphanumeric. We now do something more elegant: whereas an opening `*` must be left-flanking, an opening `_` must be left-flanking *and not right-flanking*. And so on for the other cases. All the original tests passed except some tests with Russian text with internal `_`, which formerly created emphasis but no longer do with the new rule. These tests have been adjusted. A few new test cases have been added to illustrate the rule. The C and JS implementations have both been updated.
2015-01-05Reformatted code consistently with astyle.John MacFarlane
2014-12-29Renamed a couple variables.John MacFarlane