Uncodin / bypass

Skip the HTML, Bypass takes markdown and renders it directly on Android and iOS.
http://uncodin.github.com/bypass/
Apache License 2.0
1.51k stars 192 forks source link

Prevent auto-adding trailing whitespace to document. #175

Closed laszlourszuly closed 9 years ago

laszlourszuly commented 9 years ago

Prior to this change the Android layout formating code (in Bypass.java) appended a trailing double-newline to the last element in the formatted document. This had the implication of affecting the client side UI, as the target textbox would expand at the bottom by the height of an empty line.

This change prevents the layout formatter from appending said newlines by (recursively) keeping track of the index of the currently formatted element, the number of siblings in the batch and their parent.

jsonfry commented 9 years ago

Glad it's not just me experiencing this issue. Thanks for the fix, looking forward to seeing it merged.