Skip to content

images cannot be displayed completely #439

@Rabithua

Description

@Rabithua
//
//  ArticleDetailView.swift
//  Rote
//
//  Created by antigravity on 2026/1/13.
//

import MarkdownUI
import SwiftUI

struct ArticleDetailView: View {
  let article: Article
  @Environment(\.dismiss) private var dismiss

  var body: some View {
    NavigationStack {
      ScrollView {
        Markdown(article.content)
          .padding()
          .markdownTheme(.gitHub)  // Use GitHub theme as it's common for markdown
      }
      .toolbar {
        ToolbarItem(placement: .topBarTrailing) {
          Button {
            HapticType.light.trigger()
            dismiss()
          } label: {
            Image(systemName: "xmark")
          }
        }
      }
    }
  }
}

Image

I am using a Markdown component on a sheet to display an article, but I have found a problem that the images cannot be displayed completely; they are cut off and exceed the container range. How can I avoid this situation? Thank you for any help you can provide.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions