mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 01:25:27 +00:00
disable deprecated markup formatter
This commit is contained in:
parent
46fa31ab16
commit
c499f10320
2 changed files with 9 additions and 15 deletions
|
|
@ -28,9 +28,10 @@ impl Reader {
|
||||||
let mut title = None;
|
let mut title = None;
|
||||||
|
|
||||||
// Init markup
|
// Init markup
|
||||||
let mut markup = String::new();
|
let buffer = TextBuffer::new(None);
|
||||||
|
|
||||||
for line in gemtext.lines() {
|
for line in gemtext.lines() {
|
||||||
|
/*
|
||||||
// Is header
|
// Is header
|
||||||
if let Some(header) = Header::from(line) {
|
if let Some(header) = Header::from(line) {
|
||||||
// Format
|
// Format
|
||||||
|
|
@ -54,11 +55,10 @@ impl Reader {
|
||||||
|
|
||||||
// Nothing match, escape string just
|
// Nothing match, escape string just
|
||||||
markup.push_str(Plain::from(line).markup())
|
markup.push_str(Plain::from(line).markup())
|
||||||
}
|
*/
|
||||||
|
|
||||||
// Init buffer @TODO
|
buffer.insert(&mut buffer.end_iter(), &Plain::from(line));
|
||||||
let buffer = TextBuffer::new(None);
|
}
|
||||||
buffer.set_text(&markup);
|
|
||||||
|
|
||||||
// Init widget
|
// Init widget
|
||||||
let widget = Widget::new_arc(&buffer);
|
let widget = Widget::new_arc(&buffer);
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,11 @@
|
||||||
use gtk::glib::{gformat, markup_escape_text, GString};
|
use gtk::glib::{gformat, GString};
|
||||||
|
|
||||||
pub struct Plain {
|
pub struct Plain {
|
||||||
markup: GString,
|
// nothing yet..
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Plain {
|
impl Plain {
|
||||||
pub fn from(line: &str) -> Plain {
|
pub fn from(line: &str) -> GString {
|
||||||
Self {
|
gformat!("{}\n", line)
|
||||||
markup: gformat!("{}\n", markup_escape_text(line)),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn markup(&self) -> &GString {
|
|
||||||
&self.markup
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue