tiptap-php icon indicating copy to clipboard operation
tiptap-php copied to clipboard

Add PHP 7.4 support

Open jonassiewertsen opened this issue 2 years ago • 3 comments

I added PHP 7.4 support to Shiki, so tiptap-php does work with PHP 7.4 as well

https://github.com/spatie/shiki-php/releases/tag/1.3.0

jonassiewertsen avatar Jun 01 '22 11:06 jonassiewertsen

Somehow PHP 7.4 is breaking the "Tests\DOMParser\TaskListTest" https://github.com/spiegeltechlab/tiptap-php/runs/6688689946?check_suite_focus=true

jonassiewertsen avatar Jun 01 '22 11:06 jonassiewertsen

Hi @jonassiewertsen

This fails because the sort behaviour for equal values changed in PHP 8 - see Stable Sorting RFC.

In PHP 7, the sort applied to extensions places the ListItem class before the TaskItem class, which the DOMParser relies on when determining which Node class to use.

An option could be to implement a stable sorting algorithm but that would come with a performance hit. I think a better solution would be to simply apply the priority property to the TaskItem and TaskList classes, to ensure they take priority over the ListItem and BulletList classes, and to update the documentation accordingly

Martin

martindines avatar Aug 30 '22 14:08 martindines

Thanks for digging into this @martindines. I simply did not see your PR or message before.

The Unit Tests are looking good now: https://github.com/spiegeltechlab/tiptap-php/actions/runs/3235745959

jonassiewertsen avatar Oct 12 '22 15:10 jonassiewertsen