summaryrefslogtreecommitdiff
path: root/src/inlines.c
AgeCommit message (Collapse)Author
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
2014-12-29Added cmark_ prefix to functions in cmark_ctype.John MacFarlane
2014-12-29Added cmark_ctype.h with locale-independent isspace, ispunct, etc.John MacFarlane
Otherwise cmark's behavior varies unpredictably with the locale. `is_punctuation` in utf8.h has also been adjusted so that everything that counts all ASCII symbol characters count as punctuation, even though some are not in P* character classes.
2014-12-26Optimized the change in 72a556fd3bd17feaffba2fb6faa8c8f2a3931643.John MacFarlane
Thanks @Knagis.
2014-12-25Updated C parser to handle #252.John MacFarlane
Closes #252.
2014-12-25Improved rules for emphasis and strong emphasis.John MacFarlane
This improves parsing of emphasis around punctuation. Background: http://talk.commonmark.org/t/emphasis-inside-strong-broken-in-js-implementation-when-parenthesis-involved/903/6 The basic idea of the change is that if the delimiter is part of a delimiter clump that has punctuation to the left and a normal character (non-space, non-punctuation) to the right, it can only be an opener. If it has punctuation to the right and a normal character (non-space, non-punctuation) to the left, it can only be a closer. This handles cases like **Gomphocarpus (*Gomphocarpus physocarpus*, syn. *Asclepias physocarpa*)** and **foo "*bar*" foo** better than before. The spec section on Emphasis and Strong Emphasis has been extensively revised. The C and JS implementations have been brought up to date, and all tests pass.
2014-12-15Re-added cmark_ prefix to strbuf and chunk.John MacFarlane
Reverts 225d720.
2014-12-14Added comment.John MacFarlane
2014-12-14Use UTF-8 sensitive functions to check for spaces around emph markers.John MacFarlane
2014-12-14Rename CMARK_NODE_INLINE_CODE -> CMARK_NODE_CODE.John MacFarlane
2014-12-13Removed cmark_ prefix on chunk and strbuf.John MacFarlane
This isn't needed any more since we don't expose these in the API.
2014-12-04Moved source files from src/html into src.John MacFarlane
The separate directory presents problems for some simple extension building systems, like luarocks.
2014-11-30Rename member first_inline to inl_text in struct delimiterNick Wellnhofer
2014-11-30Eliminate delim_count in struct delimiterNick Wellnhofer
Use literal length instead.
2014-11-30Simplify remove_delimiterNick Wellnhofer
2014-11-30Simplify push_delimiterNick Wellnhofer
Always modify the subject when pushing a delimiter.
2014-11-30Rename delimiter_stack to delimiterNick Wellnhofer
The struct actually describes a delimiter. I also find it conceptually much clearer to think of a doubly linked list of delimiters than a stack.
2014-11-29Merge pull request #227 from nwellnhof/process_emphJohn MacFarlane
Optimize and clarify process_emph
2014-11-29Check for `[` character in `link_label`.John MacFarlane
Closes #226.
2014-11-29Clarify code in insert_emphNick Wellnhofer
2014-11-29Add local variable for closer inlineNick Wellnhofer
2014-11-29Optimize emph insertionNick Wellnhofer
Avoid unnecessary malloc/free if opener is removed.
2014-11-29Remove redundant codeNick Wellnhofer
next/prev pointers are handled by cmark_node_free.
2014-11-29Split process_emphasis into two functionsNick Wellnhofer
Makes the code more readable.
2014-11-29Fix prev pointer of emph->first_childNick Wellnhofer
2014-11-28Removed cmark_free_nodes from public API.John MacFarlane
Replace it with static S_free_nodes.
2014-11-28Clarified logic in remove_delimiter.John MacFarlane
Motivated by warnings from clang static analyzer.
2014-11-28Use prefixed names for symbols from references.hNick Wellnhofer
2014-11-28Use prefixed names for symbols from inlines.hNick Wellnhofer
2014-11-25Rename NODE_STRING -> NODE_TEXT.John MacFarlane
In JS, use 'Text' instead of 'Str'. In spec, use "plain textual content" instead of "strings."
2014-11-22Fixed #214 C and JS implementations.John MacFarlane
They were gobbling whitespace after shortcut reference links, e.g. [foo] bar [foo]: url Closes #214.
2014-11-18Initialize all fields in node when creating inlines.John MacFarlane
2014-11-17Make sure the emph inline added in process_emphasis has a parent.John MacFarlane
2014-11-17Make parse_inlines add directly to parent.John MacFarlane
Previously parse_inlines returned a list of parsed inlines. This had to be added to the parent, and fix_parents had to be called to manually add the 'parent' links to the children, and the 'last_child' link to the parent. Now parse_inlines takes the parent block as a parameter, and uses cmark_node_append_child to add the children, so that the pointers should be properly managed. This avoids the need for the fix_parents pass.
2014-11-17Set last_child and parent in make_linkNick Wellnhofer
2014-11-17Store link labels as children in tree structureNick Wellnhofer
2014-11-17Set prev, parent and last_child for inlinesNick Wellnhofer
2014-11-17Rename ast.h to parser.hNick Wellnhofer