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

Indent Functionality Not Working as Expected #347

Open
RizwanaDesai opened this issue Sep 26, 2024 · 1 comment
Open

Indent Functionality Not Working as Expected #347

RizwanaDesai opened this issue Sep 26, 2024 · 1 comment

Comments

@RizwanaDesai
Copy link

I'm trying to add an indent to a paragraph when the user clicks the indent button. The goal is to apply a tab space to the entire paragraph (including wrapped lines). I don't want to use spaces in the beginning because in different device size it will mess it all up.

I've attempted to use three backticks (```) to indent the paragraph, but it didn't work, even not indented a single line. I also tried using quote formatting as an alternative, but it didn't work as expected. Please see the attached screenshot for reference.

MarkdownUI UItextview

Expected behavior
I expect that surrounding the paragraph with three backticks will indent the entire paragraph. If I'm missing something, please let me know how I can achieve the desired result shown in the screenshot.

expected output

I would appreciate any help with this!

@RizwanaDesai
Copy link
Author

RizwanaDesai commented Sep 26, 2024

I've followed the guidance provided in this discussion to add a custom configuration for blockquote in my custom theme. However, the custom blockquote styling does not seem to apply as expected when rendering Markdown content.

I'm not sure if the implementation needs to be done differently.

Markdown(summary)
            .markdownTheme(Theme.customTheme)
extension Theme {

    static let customTheme = Theme()
        .code {
            FontFamilyVariant(.monospaced)
            FontSize(.em(0.85))
        }
        .blockquote { configuration in
            configuration
                .label
                .markdownMargin(top: .zero, bottom: .em(1.5))
                // Adjust the head indent
                .relativePadding(.leading, length: .em(0.5))
                // Adjust the tail indent
                .relativePadding(.trailing, length: .em(1))
                // Adjust the line spacing
                .relativeLineSpacing(.em(0.25))
                // Adjust the text alignment
                .multilineTextAlignment(.center)
        }
        .link { ...}
        ....
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant