fix: mount StringsScope, keep list inline text, show FOB until scroll down
This commit is contained in:
parent
9a11194f77
commit
65e693b9c6
6 changed files with 281 additions and 27 deletions
|
|
@ -164,4 +164,39 @@ void main() {
|
|||
final text = mewsPlainText(broken);
|
||||
expect(text, contains('Visible & intact.'));
|
||||
});
|
||||
|
||||
test('keeps bare inline content in list items and quotes', () {
|
||||
final source = '''
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head><title>Bare</title><meta name="mews-profile" content="0.1" /></head>
|
||||
<body>
|
||||
<ul>
|
||||
<li><a href="2026-10-08-post.html">2026-10-08 A dated link</a></li>
|
||||
<li>Plain item</li>
|
||||
<li>Text then a list:<ul><li>Nested</li></ul></li>
|
||||
</ul>
|
||||
<blockquote>Quoted words <em>verbatim</em>.</blockquote>
|
||||
</body>
|
||||
</html>
|
||||
''';
|
||||
final page = parseMewsPage(source: source, url: 'https://example.com/bare.html');
|
||||
final list = page.body[0] as ListBlock;
|
||||
final first = (list.items[0].blocks.single as ParagraphBlock).inline;
|
||||
final link = first.single as MewsLink;
|
||||
expect(link.href, 'https://example.com/2026-10-08-post.html');
|
||||
expect((link.children.single as MewsText).text, '2026-10-08 A dated link');
|
||||
|
||||
expect((list.items[1].blocks.single as ParagraphBlock).inline.single,
|
||||
isA<MewsText>());
|
||||
// Text before a nested list stays with the item; the list becomes a block.
|
||||
expect(list.items[2].blocks, hasLength(2));
|
||||
expect(list.items[2].blocks[0], isA<ParagraphBlock>());
|
||||
expect(list.items[2].blocks[1], isA<ListBlock>());
|
||||
|
||||
final quote = page.body[1] as QuoteBlock;
|
||||
final quoteText = (quote.children.single as ParagraphBlock).inline;
|
||||
expect(quoteText, hasLength(3));
|
||||
expect((quoteText[0] as MewsText).text, 'Quoted words ');
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue