Skip to content

Commit

Permalink
Merge branch 'dev' and prepare release v0.4.7.0b1
Browse files Browse the repository at this point in the history
  • Loading branch information
dominickpastore committed May 8, 2021
2 parents 75cb8fb + d54b2e4 commit c4b9113
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 10 deletions.
24 changes: 23 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,27 @@ PyMD4C version numbers track MD4C version numbers:
MD4C version and be incremented each time there is a new PyMD4C release for
the same version of MD4C.

[Unreleased]
------------

[0.4.7.0b1] - 2021-05-08
------------------------

### Added

- `GenericParser` provides details from `MD_BLOCK_TABLE_DETAIL`, introduced in
the latest version of MD4C, when block callbacks are called for a table.

### Changed

- Compatible with MD4C version 0.4.7

### Fixed

- Typo for flag in README (PR #19, thanks @modeja)
- Parse unsigned ints in `MD_BLOCK_*_DETAIL` structs as unsigned instead of
signed

[0.4.6.0b1] - 2020-10-28
------------------------

Expand Down Expand Up @@ -46,6 +67,7 @@ This is the initial beta release.
- `HTMLRenderer` class wrapping the MD4C HTML renderer
- Written for the MD4C version 0.4.4

[Unreleased]: https:/dominickpastore/pymd4c/compare/v0.4.6.0b1..dev
[Unreleased]: https:/dominickpastore/pymd4c/compare/v0.4.7.0b1..dev
[0.4.7.0b1]: https:/dominickpastore/pymd4c/compare/tag/release-0.4.6.0b1..v0.4.7.0b1
[0.4.6.0b1]: https:/dominickpastore/pymd4c/compare/tag/release-0.4.4.0b1..v0.4.6.0b1
[0.4.4.0b1]: https:/dominickpastore/pymd4c/releases/tag/release-0.4.4.0b1
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PyMD4C (This Project)

MIT License

Copyright (c) 2020 Dominick C. Pastore
Copyright (c) 2020-2021 Dominick C. Pastore

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ package manager. Otherwise, it can be built from source as follows:
cmake --build . --config Release
cmake --install .

The library will install to "C:/Program Files (x86)/MD4C/" by default.

In addition, on Unix-like systems (including macOS), the `pkg-config` tool must
be available to build PyMD4C. After PyMD4C is built, it is no longer required
(that is, it is not a prerequisite for actually *using* PyMD4C). This tool is
Expand Down Expand Up @@ -254,7 +256,7 @@ Initialize a new `HTMLRenderer`. Parameters:
```python
import md4c
html_renderer = md4c.HTMLRenderer(...)
html_renderer.parse(input)
output = html_renderer.parse(input)
```

Parse markdown text and return a `str` with rendered HTML. Parameters:
Expand Down
2 changes: 1 addition & 1 deletion about.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pymd4c",
"version": "0.4.6.0b1",
"version": "0.4.7.0b1",
"description": "Python bindings for MD4C",
"author": "Dominick C. Pastore",
"author_email": "[email protected]",
Expand Down
19 changes: 13 additions & 6 deletions src/pymd4c.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* pymd4c.c - md4c._md4c module
* Contains the parser and renderer classes that interface directly with MD4C
*
* Copyright (c) 2020 Dominick C. Pastore
* Copyright (c) 2020-2021 Dominick C. Pastore
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -686,7 +686,7 @@ static int GenericParser_block(MD_BLOCKTYPE type, void *detail,
"mark", ((MD_BLOCK_UL_DETAIL *) detail)->mark);
break;
case MD_BLOCK_OL:
arglist = Py_BuildValue("(O{s:i,s:N,s:C})",
arglist = Py_BuildValue("(O{s:I,s:N,s:C})",
get_enum_blocktype(type),
"start", ((MD_BLOCK_OL_DETAIL *) detail)->start,
"is_tight",
Expand All @@ -696,7 +696,7 @@ static int GenericParser_block(MD_BLOCKTYPE type, void *detail,
break;
case MD_BLOCK_LI:
if (((MD_BLOCK_LI_DETAIL *) detail)->is_task) {
arglist = Py_BuildValue("(O{s:O,s:C,s:i})",
arglist = Py_BuildValue("(O{s:O,s:C,s:I})",
get_enum_blocktype(type), "is_task", Py_True,
"task_mark",
((MD_BLOCK_LI_DETAIL *) detail)->task_mark,
Expand All @@ -708,11 +708,11 @@ static int GenericParser_block(MD_BLOCKTYPE type, void *detail,
}
break;
case MD_BLOCK_H:
arglist = Py_BuildValue("(O{s:i})", get_enum_blocktype(type),
arglist = Py_BuildValue("(O{s:I})", get_enum_blocktype(type),
"level", ((MD_BLOCK_H_DETAIL *) detail)->level);
break;
case MD_BLOCK_CODE:
if (((MD_BLOCK_CODE_DETAIL *) detail)->fence_char == NULL) {
if (((MD_BLOCK_CODE_DETAIL *) detail)->fence_char == '\0') {
arglist = Py_BuildValue("(O{s:O,s:O})",
get_enum_blocktype(type),
"info", GenericParser_md_attribute(
Expand All @@ -730,6 +730,14 @@ static int GenericParser_block(MD_BLOCKTYPE type, void *detail,
fence_char);
}
break;
case MD_BLOCK_TABLE:
arglist = Py_BuildValue("(O{s:I,s:I,s:I})",
get_enum_blocktype(type),
"col_count", ((MD_BLOCK_TABLE_DETAIL *) detail)->col_count,
"head_row_count", ((MD_BLOCK_TABLE_DETAIL *) detail)->
head_row_count,
"body_row_count", ((MD_BLOCK_TABLE_DETAIL *) detail)->
body_row_count);
case MD_BLOCK_TH:
case MD_BLOCK_TD:
arglist = Py_BuildValue("(O{s:O})", get_enum_blocktype(type),
Expand Down Expand Up @@ -1178,7 +1186,6 @@ PyMODINIT_FUNC PyInit__md4c(void)
Py_DECREF(m);
return NULL;
}
// Add the ParseError exception to the module
StopParsing = PyErr_NewExceptionWithDoc("md4c._md4c.StopParsing",
"Raised to stop parsing before complete.", NULL, NULL);
Py_XINCREF(StopParsing);
Expand Down

0 comments on commit c4b9113

Please sign in to comment.