Add RTL/LTR text direction support for paragraph elements - #967
Conversation
|
Thanks @ssmns for taking the time to tackle this and for thinking about RTL/LTR support here 😀 I'm not sure that the I’d think we should consider whether we can solve this closer to the source of the markup. A few alternatives seem worth exploring first:
What do you think @ssmns? |
|
Thanks for the thoughtful feedback. I agree that a MutationObserver is not the cleanest long-term approach. I’ve actually implemented these changes directly in redoc itself. If my PR gets accepted upstream, then simply updating the redoc dependency in our codebase should bring these fixes in automatically. So from that perspective, this can be kept in the codebase temporarily as a short-term workaround, but it shouldn’t be treated as the final solution. The preferred path is definitely to rely on the upstream redoc update once the PR is merged. If you want, I can also make this sound a bit more formal or more concise for GitHub review. |
|
Thanks @ssmns, this approach is much better than the It may be worth checking whether the |
|
Thanks for catching that! You're right, the The JS-side Upstream ReDoc PR: Redocly/redoc#2823 |
Add dir="auto" attribute to <p> tags in both Swagger UI and ReDoc views to enable proper bidirectional text rendering. Uses MutationObserver to handle dynamically added content.
The placeholder div is replaced entirely by replaceChild in redoc-init.js, so the attribute has no effect on the rendered UI.
Add dir="auto" attribute to
tags in both Swagger UI and ReDoc views to enable proper bidirectional text rendering. Uses MutationObserver to handle dynamically added content.