You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 9, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Jul 9, 2026. It is now read-only.
If we simply catch when we have an empty paragraph tag, and set the text to an empty string (""), we start seeing some immediate problems. Basically some of the functionality around selecting and manipulating multiline quotations is currently reliant on the paragraph tags being there, even when the actual text content is empty. My strategy so far has been trying to fix all the places that need the paragraph tags even for empty content, in order to work. For example this function was breaking if we simply remove paragraph tags for empty strings https://github.com/WordPress/gutenberg/blob/master/packages/rich-text/src/component/index.native.js#L532-L538
Unfortunately, even after a few small victories, I was still seeing some broken behaviors when merging blocks or doing multiline quotes with my strategy of deleting paragraph tags on empty blocks, and fixing the code reliant on them. An alternate strategy is to go to the AztecText on the AztecEditor-Android side and try and catch empty paragraph tags there and still show the placeholder text. As seen in the following link, we're already doing this with some end of line characters, so this could be a viable strategy, but will just be slower to test, and potentially more dangerous with affecting other users of AztecAndroid: https://github.com/wordpress-mobile/AztecEditor-Android/blob/1e09b7daa88498c2c8d62b09cee0c8af8bb86616/aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt#L1795-L1801
I was still seeing some broken behaviors when merging blocks or doing multiline quotes with my strategy of deleting paragraph tags on empty blocks, and fixing the code reliant on them.
I was able to get this working with a relatively safe looking change. The fix itself appears a bit unintuitive, and could probably use a larger refactor, but the more minimal change here in the following PR's seemed like the least intrusive way to fix this in the near term:
Gutenberg PR: WordPress/gutenberg#22561
Gutenberg-Mobile PR: #2307
Activity
[-][Android] Quote block placeholder is not visible[/-][+]Quote block placeholder is not visible[/+]cameronvoell commentedon May 22, 2020
Going to save a few notes on here (perhaps for myself).
We are seeing the missing placeholder because multiline prop/functionality causes empty paragraph tags (
<p></p>) to be sent to ourRichText, and it needs to be completely empty for the placeholder to be shown. See note in comment here:https://github.com/WordPress/gutenberg/blob/316c2f9ef46ed821190e2229ba0b71d01c2bd54a/packages/rich-text/src/component/index.native.js#L681-L684
If we simply catch when we have an empty paragraph tag, and set the text to an empty string (
""), we start seeing some immediate problems. Basically some of the functionality around selecting and manipulating multiline quotations is currently reliant on the paragraph tags being there, even when the actual text content is empty. My strategy so far has been trying to fix all the places that need the paragraph tags even for empty content, in order to work. For example this function was breaking if we simply remove paragraph tags for empty strings https://github.com/WordPress/gutenberg/blob/master/packages/rich-text/src/component/index.native.js#L532-L538Unfortunately, even after a few small victories, I was still seeing some broken behaviors when merging blocks or doing multiline quotes with my strategy of deleting paragraph tags on empty blocks, and fixing the code reliant on them. An alternate strategy is to go to the
AztecTexton theAztecEditor-Androidside and try and catch empty paragraph tags there and still show the placeholder text. As seen in the following link, we're already doing this with some end of line characters, so this could be a viable strategy, but will just be slower to test, and potentially more dangerous with affecting other users of AztecAndroid: https://github.com/wordpress-mobile/AztecEditor-Android/blob/1e09b7daa88498c2c8d62b09cee0c8af8bb86616/aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt#L1795-L1801cameronvoell commentedon May 23, 2020
I was able to get this working with a relatively safe looking change. The fix itself appears a bit unintuitive, and could probably use a larger refactor, but the more minimal change here in the following PR's seemed like the least intrusive way to fix this in the near term:
Gutenberg PR: WordPress/gutenberg#22561
Gutenberg-Mobile PR: #2307