mundschenk-at / wp-typography

Improve your WordPress micro typography.
https://code.mundschenk.at/wp-typography/
Other
22 stars 3 forks source link

Gutenberg support #270

Closed strarsis closed 4 years ago

strarsis commented 4 years ago

Issue Overview

wp-typography doesn't seem to run in the Gutenberg editor although it could as it uses JavaScript.

Steps to Reproduce (for bugs)

  1. Open a page/post in Gutenberg editor and start typing, notice that no typographic rules are applied to the text in the editor.

Expected Behavior

Typographic rules like hyphenation are applied to text in Gutenberg editor as in the frontend.

Current Behavior

Typographic rules are not applied to Gutenberg editor text.

Possible Solution

Re-using the JavaScript in frontend and rewrite some PHP of wp-typography into JavaScript to apply these rules also in Gutenberg editor.

Related Issues and/or PRs

https://github.com/mundschenk-at/wp-typography/issues/249

mundschenk-at commented 4 years ago

wp-Typography is a WordPress wrapper for the mundschenk-at/php-typography library. Nothing is done in JavaScript, other then removing some hidden characters for improved browser compatibility when using copy & paste.

mundschenk-at commented 4 years ago

I am going to close this as wontfix, @strarsis, because while there are several theoretical ways to make WYSIWYG blocks, none of them are viable: Reimplementing PHP-Typography in JavaScript is a fantasy and replacing it with an existing library like Typeset would introduce a mismatch between the JS and PHP side. A block using server-side rendering would be easy to do, but not provide the WYSIWYG behavior your after.

Additionally, one of wp-Typography precepts is to not change the original content in the database - that does not work with a WYSIWYG block.