krakjoe / cmark Goto Github PK
View Code? Open in Web Editor NEWCommonMark for PHP
License: Other
CommonMark for PHP
License: Other
You are supposed to be able to pass options as the second parameter of CommonMark\Parse
, however it gives you:
TypeError: CommonMark\Parse() expects exactly 1 parameter, 2 given
Despite travis is green, I have 2 failing tests
=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
CommonMark\Node\OrderedList [tests/Node/OrderedList/001.phpt]
CommonMark\Node\OrderedList isset start [tests/Node/OrderedList/009.phpt]
=====================================================================
$ cat tests/Node/OrderedList/001.diff
003+ int(1)
003- int(0)
006+ int(1)
006- int(0)
009+ int(1)
009- int(0)
012+ int(1)
012- int(0)
$ cat tests/Node/OrderedList/009.diff
001+ int(1)
002+ bool(true)
001- int(0)
002- bool(false)
@krakjoe can you have a look please ?
P.S. built with libcmark 0.27 (see cmark for versions available in Fedora / RHEL / CentOS), perhaps a minimal version should be documented.
Can this go on PECL ?
/cc @remicollet
Hi remi, can you do the pkgconfig magic for libjit in feature/jit branch please ?
var_dump((new ReflectionClass(CommonMark\CQL::class))->getMethod('__construct')->getParameters());
outputs
array(0) {
}
var_dump((new ReflectionFunction('CommonMark\Parse'))->getReturnType());
gives: NULL
Syntax like
Lines 89 to 95 in c71ebe2
php_cmark_assert_type
macro gets resolved before the conditional compilation, and is expanded on a single line, yielding invalid syntax.
Maybe it's best to rewrite this as:
#if PHP_VERSION_ID >= 70400
php_cmark_assert_type(value, IS_STRING, 0, return &EG(uninitialized_zval), "fence expected to be string");
#else
php_cmark_assert_type(value, IS_STRING, 0, return, "fence expected to be string");
#endif
Possible to move these into release branch only ?
Can we get an appveyor build going please ?
I have built on windows, but am so bad at av ...
/cc @weltling
Hi Remi,
Can you do a release of develop branch please ?
I have a feature branch waiting to be merged, and I'll merge into develop after release, and then work on coverage and tests and it will be included in the next release ...
TEST 108/268 [tests/Node/BulletList/009.phpt]
========DIFF========
001+ Termsig=11
001- bool(false)
002- bool(true)
========DONE========
FAIL CommonMark\Node\BulletList cached write tight [tests/Node/BulletList/009.phpt]
TEST 110/268 [tests/Node/BulletList/011.phpt]
========DIFF========
001+ Termsig=11
001- int(1)
002- int(2)
========DONE========
FAIL CommonMark\Node\BulletList cached write delimiter [tests/Node/BulletList/011.phpt]
TEST 139/268 [tests/Node/Custom/004.phpt]
========DIFF========
001+ Termsig=11
001- string(2) "OK"
002- string(2) "KO"
========DONE========
FAIL CommonMark\Node\Custom cached write onEnter [tests/Node/Custom/004.phpt]
TEST 140/268 [tests/Node/Custom/005.phpt]
========DIFF========
001+ Termsig=11
001- string(2) "OK"
002- string(2) "KO"
========DONE========
FAIL CommonMark\Node\Custom cached write onLeave [tests/Node/Custom/005.phpt]
TEST 182/268 [tests/Node/Heading/008.phpt]
========DIFF========
001+ Termsig=11
001- int(1)
002- int(2)
========DONE========
FAIL CommonMark\Node\Heading cached write [tests/Node/Heading/008.phpt]
TEST 207/268 [tests/Node/Media/011.phpt]
========DIFF========
001+ Termsig=11
001- string(2) "OK"
002- string(2) "KO"
========DONE========
FAIL CommonMark\Node\Media write cached title [tests/Node/Media/011.phpt]
TEST 208/268 [tests/Node/Media/012.phpt]
========DIFF========
001+ Termsig=11
001- string(2) "OK"
002- string(2) "KO"
========DONE========
FAIL CommonMark\Node\Media write cached url [tests/Node/Media/012.phpt]
TEST 226/268 [tests/Node/OrderedList/007.phpt]
========DIFF========
001+ Termsig=11
001- OK
========DONE========
FAIL CommonMark\Node\OrderedList write cached start [tests/Node/OrderedList/007.phpt]
TEST 239/268 [tests/Node/Text/007.phpt]
========DIFF========
001+ Termsig=11
001- string(2) "OK"
002- string(2) "KO"
========DONE========
FAIL CommonMark\Node\Text cached write [tests/Node/Text/007.phpt]
Hi anatol,
Can you have a look at config.w32 for feature/jit branch (libjit dep, which I believe we have already in build system for pecl) please ?
It compiles against PHP 8.0 but it's failing to allow php-fpm to start.
PHP Fatal error: Class CommonMark\Node must implement interface Traversable as part of either Iterator or IteratorAggregate
Some of the other modules I interact with have used this release as a chance to switch to stub files (compiled with php-src/build/gen_stub.php) to automatically compile the function headers.
Should we follow suit on that? Or keep things as is as much as possible and only implement Traversable support.
var_dump((new ReflectionClass(CommonMark\Parser::class))->getMethod('finish')->getReturnType())
@krakjoe can you please have a look at the build warnings related to [-Wswitch](lot of noise may hide real issues)
I have already fix the other build warnings
work/GIT/cmark/src/node.c: In function 'php_cmark_node_class':
/work/GIT/cmark/src/node.c:100:25: warning: enumeration value 'CMARK_NO_LIST' not handled in switch [-Wswitch]
case CMARK_NODE_LIST: switch (cmark_node_get_list_type(node)) {
^~~~~~
/work/GIT/cmark/src/node.c:95:2: warning: enumeration value 'CMARK_NODE_NONE' not handled in switch [-Wswitch]
switch (cmark_node_get_type(node)) {
^~~~~~
/work/GIT/cmark/src/node.c: In function 'zim_Node_appendChild':
/work/GIT/cmark/src/node.c:195:2: warning: enumeration value 'PHP_CMARK_NODE_EDIT_OK' not handled in switch [-Wswitch]
switch (php_cmark_node_edit(
^~~~~~
/work/GIT/cmark/src/node.c: In function 'zim_Node_prependChild':
/work/GIT/cmark/src/node.c:225:2: warning: enumeration value 'PHP_CMARK_NODE_EDIT_OK' not handled in switch [-Wswitch]
switch (php_cmark_node_edit(
^~~~~~
/work/GIT/cmark/src/node.c: In function 'zim_Node_insertBefore':
/work/GIT/cmark/src/node.c:259:2: warning: enumeration value 'PHP_CMARK_NODE_EDIT_OK' not handled in switch [-Wswitch]
switch (php_cmark_node_edit(
^~~~~~
/work/GIT/cmark/src/node.c: In function 'zim_Node_insertAfter':
/work/GIT/cmark/src/node.c:289:2: warning: enumeration value 'PHP_CMARK_NODE_EDIT_OK' not handled in switch [-Wswitch]
switch (php_cmark_node_edit(
^~~~~~
/work/GIT/cmark/src/handlers.c: In function 'php_cmark_node_clone_impl':
/work/GIT/cmark/src/handlers.c:311:2: warning: enumeration value 'CMARK_NODE_NONE' not handled in switch [-Wswitch]
switch (type) {
^~~~~~
/work/GIT/cmark/src/handlers.c:311:2: warning: enumeration value 'CMARK_NODE_DOCUMENT' not handled in switch [-Wswitch]
/work/GIT/cmark/src/handlers.c:311:2: warning: enumeration value 'CMARK_NODE_BLOCK_QUOTE' not handled in switch [-Wswitch]
/work/GIT/cmark/src/handlers.c:311:2: warning: enumeration value 'CMARK_NODE_ITEM' not handled in switch [-Wswitch]
/work/GIT/cmark/src/handlers.c:311:2: warning: enumeration value 'CMARK_NODE_PARAGRAPH' not handled in switch [-Wswitch]
/work/GIT/cmark/src/handlers.c:311:2: warning: enumeration value 'CMARK_NODE_THEMATIC_BREAK' not handled in switch [-Wswitch]
/work/GIT/cmark/src/handlers.c:311:2: warning: enumeration value 'CMARK_NODE_FIRST_BLOCK' not handled in switch [-Wswitch]
/work/GIT/cmark/src/handlers.c:311:2: warning: enumeration value 'CMARK_NODE_LAST_BLOCK' not handled in switch [-Wswitch]
/work/GIT/cmark/src/handlers.c:311:2: warning: enumeration value 'CMARK_NODE_SOFTBREAK' not handled in switch [-Wswitch]
/work/GIT/cmark/src/handlers.c:311:2: warning: enumeration value 'CMARK_NODE_LINEBREAK' not handled in switch [-Wswitch]
/work/GIT/cmark/src/handlers.c:311:2: warning: enumeration value 'CMARK_NODE_EMPH' not handled in switch [-Wswitch]
/work/GIT/cmark/src/handlers.c:311:2: warning: enumeration value 'CMARK_NODE_STRONG' not handled in switch [-Wswitch]
/work/GIT/cmark/src/handlers.c: In function 'php_cmark_node_debug_impl':
/work/GIT/cmark/src/handlers.c:376:2: warning: enumeration value 'CMARK_NODE_NONE' not handled in switch [-Wswitch]
switch (cmark_node_get_type(parent->node)) {
^~~~~~
/work/GIT/cmark/src/handlers.c:376:2: warning: enumeration value 'CMARK_NODE_DOCUMENT' not handled in switch [-Wswitch]
/work/GIT/cmark/src/handlers.c:376:2: warning: enumeration value 'CMARK_NODE_BLOCK_QUOTE' not handled in switch [-Wswitch]
/work/GIT/cmark/src/handlers.c:376:2: warning: enumeration value 'CMARK_NODE_LIST' not handled in switch [-Wswitch]
/work/GIT/cmark/src/handlers.c:376:2: warning: enumeration value 'CMARK_NODE_ITEM' not handled in switch [-Wswitch]
/work/GIT/cmark/src/handlers.c:376:2: warning: enumeration value 'CMARK_NODE_PARAGRAPH' not handled in switch [-Wswitch]
/work/GIT/cmark/src/handlers.c:376:2: warning: enumeration value 'CMARK_NODE_HEADING' not handled in switch [-Wswitch]
/work/GIT/cmark/src/handlers.c:376:2: warning: enumeration value 'CMARK_NODE_THEMATIC_BREAK' not handled in switch [-Wswitch]
/work/GIT/cmark/src/handlers.c:376:2: warning: enumeration value 'CMARK_NODE_FIRST_BLOCK' not handled in switch [-Wswitch]
/work/GIT/cmark/src/handlers.c:376:2: warning: enumeration value 'CMARK_NODE_LAST_BLOCK' not handled in switch [-Wswitch]
/work/GIT/cmark/src/handlers.c:376:2: warning: enumeration value 'CMARK_NODE_SOFTBREAK' not handled in switch [-Wswitch]
/work/GIT/cmark/src/handlers.c:376:2: warning: enumeration value 'CMARK_NODE_LINEBREAK' not handled in switch [-Wswitch]
/work/GIT/cmark/src/handlers.c:376:2: warning: enumeration value 'CMARK_NODE_EMPH' not handled in switch [-Wswitch]
/work/GIT/cmark/src/handlers.c:376:2: warning: enumeration value 'CMARK_NODE_STRONG' not handled in switch [-Wswitch]
/work/GIT/cmark/src/visitor.c: In function 'php_cmark_node_accept_impl':
/work/GIT/cmark/src/visitor.c:56:3: warning: enumeration value 'CMARK_EVENT_NONE' not handled in switch [-Wswitch]
switch (event) {
^~~~~~
/work/GIT/cmark/src/visitor.c:56:3: warning: enumeration value 'CMARK_EVENT_DONE' not handled in switch [-Wswitch]
Given that the new release will have some bug fixes, and a new feature, but retains bc, are we calling that 1.1.0 ?
Writing docs and need to put versions numbers of new functions in, release will be maybe next Monday, when docs are finished ...
IMHO pkg-config method should be the preferred way to find build option, especially on multi-arch distribution, when the lib may be installed in some not-standard path (e.g. debian)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.