Skip to content

MudCodeViewer Wraping issue #628

@dorin182

Description

@dorin182

There is an issue in edit mode with text wrapping. By default, the <pre><code></code></pre> element uses text-wrap-mode: nowrap; from prism.min.css.
Prism does not wrap the text, but the underlying textarea does, which results in a visual mismatch.

Example:

<MudCodeViewer @bind-Code="@code" Language="CodeLanguage.Razor" Editable="true" />

Even if you explicitly set Wrap="true" or Wrap="false", the issue still persists.

Image

PS:
When toggling the editable state, the syntax highlighting is lost until the text is modified.

Example:

<MudCodeViewer @bind-Code="@code" Language="CodeLanguage.Razor" @bind-Editable="isEditable" />
Image

PS 2:
When using show lines, there is also a mess.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions