mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:57:43 +00:00
LibMarkdown: Parse horizontal rules
A horizontal rule is generated by a line with three or more of these characters: '*', '-', '_'.
This commit is contained in:
parent
888a93e0f6
commit
042890d319
4 changed files with 120 additions and 1 deletions
|
@ -28,6 +28,7 @@
|
|||
#include <LibMarkdown/CodeBlock.h>
|
||||
#include <LibMarkdown/Document.h>
|
||||
#include <LibMarkdown/Heading.h>
|
||||
#include <LibMarkdown/HorizontalRule.h>
|
||||
#include <LibMarkdown/List.h>
|
||||
#include <LibMarkdown/Paragraph.h>
|
||||
#include <LibMarkdown/Table.h>
|
||||
|
@ -105,7 +106,7 @@ OwnPtr<Document> Document::parse(const StringView& str)
|
|||
}
|
||||
|
||||
bool any = helper<Table>(lines, blocks) || helper<List>(lines, blocks) || helper<CodeBlock>(lines, blocks)
|
||||
|| helper<Heading>(lines, blocks);
|
||||
|| helper<Heading>(lines, blocks) || helper<HorizontalRule>(lines, blocks);
|
||||
|
||||
if (any) {
|
||||
if (!paragraph_lines.is_empty()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue