Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code in Markdown doesn't wrap #3721

Closed
dentro-innovation opened this issue Jul 30, 2024 · 0 comments · Fixed by #3755
Closed

Code in Markdown doesn't wrap #3721

dentro-innovation opened this issue Jul 30, 2024 · 0 comments · Fixed by #3755
Labels
bug Something isn't working

Comments

@dentro-innovation
Copy link

Describe the bug
The markdown component wraps nicely when only text is displayed, but the moment some part is rendered as code and longer than the width it doesn't wrap and the screen is suddenly vertically scrollable.

To Reproduce
Steps to reproduce the behavior:

  • Code/Link to Repo:

E.g.

message_style = dict(
    display="inline-block",
    padding_x="1em",
    border_radius="8px",
    max_width=max_width,
)


def message_block(query: str):
    return rx.box(
        rx.markdown(
            query,
            background_color=rx.color("gray", 3),
            color=rx.color("gray", 12),
            text_align="left",
            **message_style,
        ),
        text_align="right",
        padding="1em",
        padding_top="2em",
        width="100%",
        height="100%",
    )

Expected behavior
Code blocks inside markdown components are also wrapped

Screenshots
If applicable, add screenshots to help explain your problem.

image

image

Specifics (please complete the following information):

  • Python Version: 3.12
  • Reflex Version: 0.5.8 (also happened on older versions)
  • OS: linux
  • Browser (Optional): firefox, chrome

Additional context
long live the team

@dentro-innovation dentro-innovation added the bug Something isn't working label Jul 30, 2024
Alek99 added a commit that referenced this issue Aug 7, 2024
Related to #3721

Update `Markdown` component to wrap long lines in code blocks.

* Modify `reflex/components/markdown/markdown.py` to set the `wrap_long_lines` prop to `True` for the `CodeBlock` component in the `component_map`.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/reflex-dev/reflex/issues/3721?shareId=XXXX-XXXX-XXXX-XXXX).
@Alek99 Alek99 linked a pull request Aug 7, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant