Show a list item once when its text is wrapped in a paragraph - #787
Merged
Merged
Conversation
The teacher editor (TipTap) saves every list item as <li><p>X</p></li>. create_article_fragments walks all block elements recursively, so it emitted the li (which already gathers its children's text) and then the nested p again: students saw each bullet followed by the same text as a paragraph. Any block inside a list item is now left to its nearest li. Existing articles keep their duplicated fragments until rebuilt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
ArchLens - No architecturally relevant changes to the existing views |
Skipping every block inside a list item merged an item like <li><h3>Title</h3><p>A</p><p>B</p></li> into one bullet 'Title A B'. Now a list item that holds its text in blocks emits those blocks one by one, and the first carries the bullet. Loose text before the blocks, if any, is the bullet instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reported by teachers in Cyprus: in the student reader every bullet appeared twice, once as a bullet and once as a plain paragraph ("• Container ships" then "Container ships").
The teacher editor (TipTap) saves list items as
<li><p>X</p></li>.create_article_fragmentsiteratessoup.find_all(block_elements)recursively, so it emitted theli(which already collects its children's text) and then the nestedpagain. Now any block with anliancestor is skipped: its nearestlialready covered it. Nested lists still get one fragment per item.Test
zeeguu/core/test/test_article_fragments.py:li > p, nested lists, plainliand blockquote. The first two fail without the fix.test_article*.pyandtest_classroom*.pypass.After deploy
Existing articles keep their duplicated fragments. Rebuild fragments and clear
article_tokenization_cachefor affected teacher texts, at least 4903885 and 4938085.🤖 Generated with Claude Code