AztecEditor-Android icon indicating copy to clipboard operation
AztecEditor-Android copied to clipboard

Missing padding after block elements in visual mode

Open rachelmcr opened this issue 8 years ago • 2 comments

Expected

I expect to see padding after a block element (e.g. list or quote) in Calypso mode, as in Calypso web:

calypsovisual-blocks

Observed

There isn't any visual padding below block elements:

wpandroidaztecvisual-blocks

Reproduced

  1. In Calypso mode, create a new post with a blockquote.
  2. End the blockquote and enter a new line of non-quoted text below the quote.
  3. Compare the results with Calypso web (note that there is no space between the quote and the new line of text).

Tested

Nexus 9 on Android 7.1.1 with WPAndroid alpha-87

rachelmcr avatar Dec 05 '17 17:12 rachelmcr

I took a look at this issue and seems that the only way to fix it is to add 2 NewLine characters instead of 1 in AztecParser.addVisualNewlinesToBlockElements. (and also change AztecParser.syncVisualNewlinesOfBlockElements.) The downside of this solution is that the 2nd "new-line" is visible on the screen, and you can put the cursor on the empty line between 2 blocks.

I wish there was a way to just simply add some margin to each Span. Instead of doing text manipulation with "hidden" characters.

daniloercoli avatar Jan 10 '18 13:01 daniloercoli

@0nko found a library we can check to get some inspiration to fix this issue. See https://github.com/hanks-zyh/LineHeightEditText

daniloercoli avatar Mar 16 '18 11:03 daniloercoli