cosmocode / edittable

Plugin to provide a custom editor for tables in DokuWiki
https://www.dokuwiki.org/plugin:edittable
32 stars 26 forks source link

support new EDIT_FORM_ADDTEXTAREA event #198

Closed ssahara closed 3 years ago

ssahara commented 3 years ago

This PR will make the EditTable plugin compatible with DokuWiki snapshot 2020-10-13 or later that #3198 merged. The edit form has now build using new dokuwiki\Form\Form class instead of deprecated Doku_Form. We need new event EDIT_FORM_ADDTEXTAREA handler to modify the edit form.

This PR will also fix issues of deprecated JSON()->decode() methods and utf8_strlen().

annda commented 3 years ago

LGTM. However, the change in 3f61cb4 breaks compatibility with DokuWiki versions prior to Hogfather.

@ssahara could you add a check for the existence of the newUtf8\phpString class?

ssahara commented 3 years ago

@annda thanks for the comment. I have added availability check of Utf8\PhpString class in new strWidth() method. Japanese users will often use kanji and hiragana (漢字かな) as well as alphabet, it is nice to count those fullwidth zenkaku letters as 2 to get tidy table source text.