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

Fixed first paragraph corruption on android when the markdown contained a list followed by a paragraph #12

Merged
merged 1 commit into from
Oct 5, 2024

Conversation

sonofsmog
Copy link

This pull request addresses a rendering issue specific to Android where the first paragraph of the markdown content was incorrectly displayed when the document structure included a list followed by another paragraph. This issue was not observed on Windows and has not been tested on iOS.

Issue details:

  • The first paragraph in the markdown would appear to have an extra column to its left.
  • This occurred regardless of where the list was placed in the content.
  • The glitch was triggered by the sequence: first paragraph -> [any content] -> list -> another paragraph.
  • Only the first paragraph was affected, not any subsequent paragraphs.

The problem was caused by improper handling of the transition between lists and paragraphs in the grid layout used for rendering.

Changes made:

  1. Added an isExitingList flag to track transitions out of lists.
  2. Modified list handling to set isExitingList = true at the end of both unordered and ordered list sections.
  3. Updated the "Regular text" section to check for isExitingList along with other list flags:
    if (isUnorderedListActive || isOrderedListActive || isExitingList)
    {
        isUnorderedListActive = false;
        isOrderedListActive = false;
        isExitingList = false;
        gridRow++;
        grid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
    }

… of the markdown content was incorrectly displayed when the document structure included a list followed by another paragraph. This issue was not observed on Windows and has not been tested on iOS.
@0xc3u 0xc3u merged commit 1227e42 into 0xc3u:main Oct 5, 2024
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

Successfully merging this pull request may close these issues.

3 participants