Skip to content

Documentation does not describe how to use Markdown feature #808

@basebox-mt

Description

@basebox-mt

Cursive does have a markdown feature flag, but it is not documented how to display Markdown e.g. in a TextView.

There is also no example code.

This is what I have come up with so far:

use cursive::utils::markup::markdown::parse;

let content = parse(include_str!("LICENSE.md"));
// `content` is a `SpannedString` with styles, I can see that when I dump it
let text_view = TextView::new(content)
  .scrollable()
  [...]

The output is not styled, it is rather garbled, as it strips newlines, see screenshot: The '## Overview' heading should really start on a new line.

Screenshot 2025-01-09 at 14 54 21

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions