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

[FR] Preview toggle for markdown formatting #516

Open
taylorcox75 opened this issue Jul 16, 2024 · 1 comment
Open

[FR] Preview toggle for markdown formatting #516

taylorcox75 opened this issue Jul 16, 2024 · 1 comment
Labels
feature/enhancement New feature or request

Comments

@taylorcox75
Copy link

taylorcox75 commented Jul 16, 2024

Is your feature request related to a problem? Please describe.
Often times when writing a post I might use a lot of markup. Currently I cannot preview the rendered markup to see how tables, links, headers, formatting, etc look.

Describe the solution you'd like
Would like the ability to preview my post before making it. With maybe a button that essentially toggles the existing

MDEditor(text: $textWrapper.replyText)

Showing:

Text(textWrapper.replyText)

I.e. pseudo:

var body: some View {
    VStack {
        HStack {
            Button(action: {
                isPreview.toggle()
            }) {
                Text(isPreview ? "Edit" : "Preview")
            }
            Spacer()
        }
        .padding()
        
        if isPreview {
            ScrollView {
                Text(textWrapper.replyText)
                    .padding()
            }
        } else {
            MDEditor(text: $textWrapper.replyText)
        }
    }
}

With textWrapper.replyText containing:
**bold** text (link)[link].
We get a preview window:

bold text link

https://github.com/lo-cafe/winston/blob/main/winston/components/Modals/ReplyModal.swift

Describe alternatives you've considered
Posting my comment, then editing it if I see a formatting issue.

Additional context
Here’s how another client does something similar:
IMG_9837
IMG_9838
I might do a PR, but don’t have a Mac to test so need to figure something out.

@taylorcox75 taylorcox75 added the feature/enhancement New feature or request label Jul 16, 2024
Copy link

linear bot commented Jul 16, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant