Skip to content

Fix #6430, #6431: Preserve worked example list spacing - #6432

Open
Neer-rn wants to merge 3 commits into
developfrom
fix-6430-6431-worked-example-list-spacing
Open

Fix #6430, #6431: Preserve worked example list spacing#6432
Neer-rn wants to merge 3 commits into
developfrom
fix-6430-6431-worked-example-list-spacing

Conversation

@Neer-rn

@Neer-rn Neer-rn commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Explanation

Fixes #6430

Fixes #6431

Worked example lists were not parsed correctly when the list tags had extra attributes. Because of this, spaces between list items and paragraphs were missing. Some joined words were also shown as links.

This PR fixes the list parsing and adds tests for these cases.

Essential Checklist

  • The PR title starts with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • The explanation section above starts with "Fixes #bugnum: " (If this PR fixes part of an issue, use instead: "Fixes part of #bugnum: ...".)
  • Any changes to scripts/assets files have their rationale included in the PR explanation.
  • The PR follows the style guide.
  • The PR does not contain any unnecessary code changes from Android Studio (reference).
  • The PR is made from a branch that's not called "develop" and is up-to-date with "develop".
  • The PR is assigned to the appropriate reviewers (reference).

Disclosure of LLM Usage

  • Did you use AI/LLMs when working on this PR? No

@Neer-rn
Neer-rn requested a review from a team as a code owner September 5, 2026 17:17
@Neer-rn
Neer-rn requested a review from manas-yu September 5, 2026 17:17
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Results

Number of files assessed: 1
Overall Coverage: 0.00%
Coverage Analysis: PASS

Exempted coverage

Files exempted from coverage
File Exemption Reason
HtmlParser.ktutility/src/main/java/org/oppia/android/util/parser/html/HtmlParser.kt
This file is incompatible with code coverage tooling; skipping coverage check.

Refer test_file_exemptions.textproto for the comprehensive list of file exemptions and their required coverage percentages.

To learn more, visit the Oppia Android Code Coverage wiki page

@Neer-rn

Neer-rn commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator Author

@adhiamboperes Please review and test this when you get time.

@adhiamboperes adhiamboperes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Neer-rn, the regex looks good. I just need to test this manually.

@Neer-rn

Neer-rn commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator Author

@adhiamboperes Please test this manually and let me know. If it doesn’t work as expected, I will need to make another revision.

@adhiamboperes

Copy link
Copy Markdown
Contributor

The solution is in the right direction but there are some issues. First, the apperance of false links issue is fixed. It seems that some of the list item tags were being incorrectly stripped before, causing them to be appended to the end of the previous list items.

Screenshot_1788951708 Screenshot_1788951449 Screenshot_1788951390

As for the list spacing:

Ordered List Unordered list
Screenshot_1788952264 Screenshot_1788952600

In the answer contains ol, the spacing is correct.

But if ul:
The second question and answer is indented, while the bullet alignement is kept at the same level as the outer list.

@Neer-rn

Neer-rn commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator Author

@adhiamboperes I have fixed the it. Please review this.

Before After
before after

@Neer-rn Neer-rn assigned adhiamboperes and unassigned Neer-rn Sep 9, 2026
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.

[BUG]: Missing Spacing After Sentences in Worked Examples [BUG]: No spacing after lists in worked examples

2 participants