Coverage for collectra/displays/texts.py: 100.00%

4 statements  

« prev     ^ index     » next       coverage.py v7.16.2, created at 2026-10-16 09:56 +0000

1"""Text format selection and editor descriptors.""" 

2 

3 

4def text(context, item): 

5 path = context.text_path(item.id) 

6 format = {".md": "markdown", ".markdown": "markdown", ".xml": "xml"}.get( 

7 path.suffix.lower() if path else "", "plain" 

8 ) 

9 return { 

10 "kind": "text", 

11 "format": format, 

12 "text": str(item.data), 

13 "editable": True, 

14 "target_id": item.id, 

15 }