wporg-mu-plugins icon indicating copy to clipboard operation
wporg-mu-plugins copied to clipboard

Provide parser code for other projects to use

Open ryelle opened this issue 2 years ago • 1 comments

The content parsers from pattern-translations were duplicated into the main theme in https://github.com/WordPress/wporg-main-2022/pull/118 to support translating the rendered content. The parsers (parsers/*.php) themselves are almost exactly the same (wporg-main-2022 has a change in the button parser to support shortcodes).

We'll probably need the same code in other themes, too.

That parser code should live in this repo, so that the parsers could be used in export-content and pattern-translation without duplicating the source code.

ryelle avatar Sep 13 '22 17:09 ryelle

Also see https://github.com/WordPress/wordpress.org/pull/90

The block parsing classes in this PR differ from that which is used for Patterns (See https://github.com/WordPress/pattern-directory/tree/trunk/public_html/wp-content/plugins/pattern-translations/includes) as in testing I found issue with it and started writing my own parsers that seemed to work more reliably for the purpose of post translation.

So maybe we should be using those parsers instead.

ryelle avatar Sep 13 '22 20:09 ryelle