bobbingwide / oik-bob-bing-wide

More lazy smart shortcodes
https://www.oik-plugins.com/oik-plugins/oik-bob-bing-wide-more-lazy-smart-shortcodes/
GNU General Public License v2.0
1 stars 0 forks source link

Support for WordPress 5.0 and the new editor - Gutenberg #25

Closed bobbingwide closed 4 years ago

bobbingwide commented 6 years ago

Since early 2017 a new editor has been under development. Code named Gutenberg this new editor is being developed as a feature plugin. It is expected to be merged into core for WordPress 5.0.

We need to be aware of Gutenberg and to attempt to be compatible with it. Actually, it's the other way round. Gutenberg needs to be backward compatible with us.

According to Gutenberg's README.

Posts are backwards compatible, and shortcodes will still work.

That's not the case right now.

I've already raised an issue against Gutenberg ( # 4456 ) which affects the [bw_csv] shortcode. It probably also affects the [bw_rpt] shortcode in exactly the same way.

Problems

Area Problem Reference
Various blocks New lines in shortcode content not respected See also https://github.com/bobbingwide/oik/issues/97

Workarounds?

For 4456 - new lines being ignored

bobbingwide commented 6 years ago

The new editor uses "dashicons" which are actually SVG's. The [bw_dash] shortcode should be extended to cater for SVG icons.

bobbingwide commented 6 years ago

For the oik-block-opinions.php routine in oik-block, oik-bob-bing-wide may respond to a number of the filters it invokes.

bobbingwide commented 6 years ago

Note: The [bw_graphviz] shortcode appears to work with Gutenberg. Unlike [bw_csv] it’s not sensitive to losing new line characters. We need to change the message from the filter function responding to oik_block_gather_site_opinions. Use [bw_rpt] if it’s affected in the same way as [bw_csv]

bobbingwide commented 6 years ago

Where dashicons are being generated in shortcodes the test cases will need changing. See icon= parameter.

bobbingwide commented 4 years ago

Blocks to be delivered by oik-bob-bing-wide, copied and cobbled from oik-blocks are listed below

new block name transform from shortcode
oik-bbw/csv [bw_csv]
oik-bbw/dashicon [bw_dash]
oik-bbw/github [github]
oik-bbw/search [bw_search]
oik-bbw/wordpress [wp]
bobbingwide commented 4 years ago

Whilst implementing support for blocks using the shared libraries we may as well take the opportunity to make oik-bob-bing-wide operate as a standalone plugin, using similar logic to that implemented for oik-css and uk-tides.

The [bw_csv] shortcode makes use of bw_array_get_from. This needs to be included in the bobbfunc shared library.

In order to use the [bw_csv] shortcode we have to implement additional compatibility checks against an existing version of oik - loading oik's back level code in preference to the shared library code.

bobbingwide commented 4 years ago

This was released in v1.34.0 on 30 Jan 2020 to oik-plugins.com

There are still problems when both blocks are used in a post and the [bw_csv] shortcode is used in a classic block. This has to be resolved when I update the documenation for the oik base plugin. I’ll check whether or not it’s possible to use the shortcode inside the shortcode block. The easiest thing would be to use convert to blocks and demonstrate that the transform worked.

bobbingwide commented 4 years ago

The easiest thing would be to use convert to blocks and demonstrate that the transform worked.

That's what I did. Each CSV block that was generated contained unwanted
tags. But pressing enter in each block resolved the problem. I just had to delete a blank line or two and unset the Table heading toggle for those blocks that didn't have table headings.

bobbingwide commented 4 years ago

Oik v4.0.0 has been released. The tables on the plugin page have been updated.

I’ll check whether or not it’s possible to use the shortcode inside the shortcode block. Yes it is, but what’s the point?