mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-03 01:55:27 +00:00
strip xml tags from the markdown source
This commit is contained in:
parent
b6b8f96bba
commit
563b228e9e
3 changed files with 10 additions and 4 deletions
|
|
@ -14,6 +14,7 @@ use gtk::{
|
|||
use gutter::Gutter;
|
||||
use sourceview::prelude::{ActionExt, ActionMapExt, DisplayExt, ToVariant};
|
||||
use std::{cell::Cell, collections::HashMap, rc::Rc};
|
||||
use strip_tags::*;
|
||||
use tags::Tags;
|
||||
|
||||
pub struct Markdown {
|
||||
|
|
@ -39,9 +40,6 @@ impl Markdown {
|
|||
// * maybe less expensive than update entire HashMap by iter
|
||||
let hover: Rc<Cell<Option<TextTag>>> = Rc::new(Cell::new(None));
|
||||
|
||||
// Init code features
|
||||
//let mut code = None;
|
||||
|
||||
// Init colors
|
||||
// @TODO use accent colors in adw 1.6 / ubuntu 24.10+
|
||||
let link_color = (
|
||||
|
|
@ -54,7 +52,7 @@ impl Markdown {
|
|||
|
||||
// Init new text buffer
|
||||
let buffer = TextBuffer::new(Some(&TextTagTable::new()));
|
||||
buffer.set_text(markdown);
|
||||
buffer.set_text(&strip_tags(markdown)); // @TODO extract `<img>` tags?
|
||||
|
||||
// Init main widget
|
||||
let text_view = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue