mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:47:35 +00:00
Libraries: Add LibMarkdown
This commit is contained in:
parent
dd5541fefc
commit
2e80b2b32f
17 changed files with 711 additions and 1 deletions
28
Libraries/LibMarkdown/MDText.h
Normal file
28
Libraries/LibMarkdown/MDText.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/String.h>
|
||||
#include <AK/Vector.h>
|
||||
|
||||
class MDText final {
|
||||
public:
|
||||
struct Style {
|
||||
bool emph { false };
|
||||
bool strong { false };
|
||||
bool code { false };
|
||||
};
|
||||
|
||||
struct Span {
|
||||
String text;
|
||||
Style style;
|
||||
};
|
||||
|
||||
const Vector<Span>& spans() const { return m_spans; }
|
||||
|
||||
String render_to_html() const;
|
||||
String render_for_terminal() const;
|
||||
|
||||
bool parse(const StringView&);
|
||||
|
||||
private:
|
||||
Vector<Span> m_spans;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue