From 95039a0abc39dcc8cfe6b9f8f5d59f0b86021f75 Mon Sep 17 00:00:00 2001 From: NerdyPepper Date: Thu, 28 Jun 2018 21:06:06 +0530 Subject: Add support for sub-sub-headings --- src/content.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/content.rs') diff --git a/src/content.rs b/src/content.rs index 18b39f7..6492431 100644 --- a/src/content.rs +++ b/src/content.rs @@ -70,6 +70,7 @@ pub fn extract_formatter(extract: String) -> StyledString { let heading= Regex::new(r"^== (?P.*) ==$").unwrap(); let subheading= Regex::new(r"^=== (?P.*) ===$").unwrap(); + let subsubheading= Regex::new(r"^==== (?P.*) ====$").unwrap(); for line in extract.lines() { if heading.is_match(line) { @@ -84,6 +85,12 @@ pub fn extract_formatter(extract: String) -> StyledString { subheading.replace(line, "$d"), Effect::Italic ) ); + } else if subsubheading.is_match(line) { + formatted.append( + StyledString::styled( + subsubheading.replace(line, "$d"), Effect::Underline + ) + ); } else { formatted.append(StyledString::plain(line)); } -- cgit v1.2.3