PEG Markdown Highlight
|
Parser public interface. More...
Go to the source code of this file.
Functions | |
void | pmh_markdown_to_elements (char *text, int extensions, pmh_element **out_result[]) |
Parse Markdown text, return elements. | |
void | pmh_sort_elements_by_pos (pmh_element *element_lists[]) |
Sort elements in list by start offset. | |
void | pmh_free_elements (pmh_element **elems) |
Free pmh_element array. | |
char * | pmh_element_name_from_type (pmh_element_type type) |
Get element type name. | |
pmh_element_type | pmh_element_type_from_name (char *name) |
Get element type from a name. |
Parser public interface.
char* pmh_element_name_from_type | ( | pmh_element_type | type | ) |
Get element type name.
[in] | type | The type value to get the name for. |
pmh_element_type pmh_element_type_from_name | ( | char * | name | ) |
Get element type from a name.
[in] | name | The name of the type. |
void pmh_free_elements | ( | pmh_element ** | elems | ) |
Free pmh_element array.
Frees an pmh_element array returned by pmh_markdown_to_elements().
[in] | elems | The pmh_element array resulting from calling pmh_markdown_to_elements(). |
void pmh_markdown_to_elements | ( | char * | text, |
int | extensions, | ||
pmh_element ** | out_result[] | ||
) |
Parse Markdown text, return elements.
Parses the given Markdown text and returns the results as an array of linked lists of elements, indexed by type.
[in] | text | The Markdown text to parse for highlighting. |
[in] | extensions | The extensions to use in parsing (a bitfield of pmh_extensions values). |
[out] | out_result | A pmh_element array, indexed by type, containing the results of the parsing (linked lists of elements). You must pass this to pmh_free_elements() when it's not needed anymore. |
void pmh_sort_elements_by_pos | ( | pmh_element * | element_lists[] | ) |
Sort elements in list by start offset.
Sorts the linked lists of elements in the list returned by pmh_markdown_to_elements() by their start offsets (pos).
[in] | element_lists | Array of linked lists of elements (output from pmh_markdown_to_elements()). |