mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +00:00
implement view-source feature
This commit is contained in:
parent
9784a8a1a1
commit
614aa1d71a
5 changed files with 86 additions and 25 deletions
|
|
@ -92,7 +92,7 @@ impl Content {
|
|||
/// * could be useful to extract document title parsed from Gemtext
|
||||
pub fn to_text_gemini(&self, base: &Uri, data: &str) -> Text {
|
||||
self.clean();
|
||||
let text = Text::gemini(
|
||||
let text = Text::new_gemini(
|
||||
data,
|
||||
base,
|
||||
(self.window_action.clone(), self.tab_action.clone()),
|
||||
|
|
@ -101,6 +101,13 @@ impl Content {
|
|||
text
|
||||
}
|
||||
|
||||
pub fn to_text_source(&self, data: &str) -> Text {
|
||||
self.clean();
|
||||
let text = Text::new_source(data);
|
||||
self.gobject.append(&text.scrolled_window);
|
||||
text
|
||||
}
|
||||
|
||||
/// Remove all children components from `Self`
|
||||
pub fn clean(&self) {
|
||||
while let Some(child) = self.gobject.last_child() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue