Subscript elements should be bottom aligned
Is this a bug report or a feature request?
Bug Report
Have you read the guidelines regarding bug report?
Yes
Have you read the documentation in its entirety?
Yes
Have you made sure that your issue hasn't already been reported/solved?
Yes
Is the bug specific to iOS or Android? Or can it be reproduced on both platforms?
Reproducible on all platforms
Is the bug reproductible in a production environment (not a debug one)?
Yes
Have you been able to reproduce the bug in the provided example?
Yes
Environment
The bug is environment independent
Steps to Reproduce
Attempt to render a subscript element e.g.
<p>N<sub>2</sub></p>
Expected Behavior
You should see the text that is within the subscript element is vertically aligned to the bottom, e.g. it should look like:
N2
Actual Behavior
The text that is within the subscript element is vertically aligned to the top, e.g. it currently looks like:
N2
We can see that that <sub> elements are given vertical alignment to top here:
https://github.com/archriss/react-native-render-html/blob/master/src/HTMLDefaultStyles.js#L47
when it just needs to be bottom.
Hi
sup tag align text to bottom , sub is working fine now.
can you please help me with this ?
Hey, sup or sub is not working for me. Were you able to do this with a custom renderer/styling?
So I managed to use a custom renderer for both sub and sup and managed to set it so that sup received textAlignVertical: "top" and also display: "inline-block" for web but display: "flex" for native (as I'm working on a React Native Web project), and for sub it was textAlignVertical: "bottom"
Unfortunately textAlignVertical is an android only property, and not sure about what the plans are for it in the future for both Android and iOS.
@jamesovens Can you share your code here?
I'm closing in favor of #76. @jamesovens in response to what you suggested, see this commit message: 002b7fbc63731e7050dd3c64509383821b5cf0fd
If you want this feature, upvote it here: https://react-native.canny.io/feature-requests/p/support-superscript-and-subscript