fix: There is no such thing as markup.normal, use ui.text

This commit is contained in:
Blaž Hrastnik 2022-02-07 10:28:05 +09:00
parent f5b95beef6
commit e7f5ec5561

View file

@ -22,7 +22,6 @@ pub struct Markdown {
config_loader: Arc<syntax::Loader>, config_loader: Arc<syntax::Loader>,
text_style: String,
block_style: String, block_style: String,
heading_style: String, heading_style: String,
} }
@ -35,14 +34,12 @@ impl Markdown {
Self { Self {
contents, contents,
config_loader, config_loader,
text_style: "markup.normal".into(),
block_style: "markup.raw.inline".into(), block_style: "markup.raw.inline".into(),
heading_style: "markup.heading".into(), heading_style: "markup.heading".into(),
} }
} }
pub fn style_group(mut self, suffix: &str) -> Self { pub fn style_group(mut self, suffix: &str) -> Self {
self.text_style = format!("markup.normal.{}", suffix);
self.block_style = format!("markup.raw.inline.{}", suffix); self.block_style = format!("markup.raw.inline.{}", suffix);
self.heading_style = format!("markup.heading.{}", suffix); self.heading_style = format!("markup.heading.{}", suffix);
self self
@ -78,7 +75,7 @@ impl Markdown {
.unwrap_or_default() .unwrap_or_default()
}; };
} }
let text_style = get_theme!(self.text_style); let text_style = theme.map(|theme| theme.get("ui.text")).unwrap_or_default();
let code_style = get_theme!(self.block_style); let code_style = get_theme!(self.block_style);
let heading_style = get_theme!(self.heading_style); let heading_style = get_theme!(self.heading_style);