diff --git a/src/app/browser/window/tab/item/page/content/text/gemini/reader.rs b/src/app/browser/window/tab/item/page/content/text/gemini/reader.rs index ff20d6e3..c242652b 100644 --- a/src/app/browser/window/tab/item/page/content/text/gemini/reader.rs +++ b/src/app/browser/window/tab/item/page/content/text/gemini/reader.rs @@ -28,9 +28,10 @@ impl Reader { let mut title = None; // Init markup - let mut markup = String::new(); + let buffer = TextBuffer::new(None); for line in gemtext.lines() { + /* // Is header if let Some(header) = Header::from(line) { // Format @@ -54,11 +55,10 @@ impl Reader { // Nothing match, escape string just markup.push_str(Plain::from(line).markup()) - } + */ - // Init buffer @TODO - let buffer = TextBuffer::new(None); - buffer.set_text(&markup); + buffer.insert(&mut buffer.end_iter(), &Plain::from(line)); + } // Init widget let widget = Widget::new_arc(&buffer); diff --git a/src/app/browser/window/tab/item/page/content/text/gemini/reader/parser/plain.rs b/src/app/browser/window/tab/item/page/content/text/gemini/reader/parser/plain.rs index 7aa92c6a..ca0b301a 100644 --- a/src/app/browser/window/tab/item/page/content/text/gemini/reader/parser/plain.rs +++ b/src/app/browser/window/tab/item/page/content/text/gemini/reader/parser/plain.rs @@ -1,17 +1,11 @@ -use gtk::glib::{gformat, markup_escape_text, GString}; +use gtk::glib::{gformat, GString}; pub struct Plain { - markup: GString, + // nothing yet.. } impl Plain { - pub fn from(line: &str) -> Plain { - Self { - markup: gformat!("{}\n", markup_escape_text(line)), - } - } - - pub fn markup(&self) -> &GString { - &self.markup + pub fn from(line: &str) -> GString { + gformat!("{}\n", line) } }