diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-05-19 13:11:00 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-05-19 13:11:00 +0200 |
| commit | 08554380f8813d4105c13abacb08fff8e5a0f318 (patch) | |
| tree | a03df3fecd9d5ec774a087f8f2a9540b88d9f815 /src/model/content.rs | |
| parent | 5a7c901f2195a746e0982723b959c07431844077 (diff) | |
Fix generated strong and emphasized text
Diffstat (limited to 'src/model/content.rs')
| -rw-r--r-- | src/model/content.rs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/model/content.rs b/src/model/content.rs index 6956d380..ff10de5d 100644 --- a/src/model/content.rs +++ b/src/model/content.rs @@ -14,7 +14,9 @@ use crate::diag::StrResult; use crate::library::layout::{FlowChild, FlowNode, PageNode, PlaceNode, Spacing}; use crate::library::prelude::*; use crate::library::structure::{DocNode, ListItem, ListNode, ORDERED, UNORDERED}; -use crate::library::text::{DecoNode, ParChild, ParNode, UNDERLINE}; +use crate::library::text::{ + DecoNode, EmphNode, ParChild, ParNode, StrongNode, UNDERLINE, +}; use crate::util::EcoString; /// Composable representation of styled content. @@ -164,6 +166,16 @@ impl Content { self.clone().styled_with_entry(StyleEntry::Unguard(sel)) } + /// Make this content strong. + pub fn strong(self) -> Self { + Self::show(StrongNode(self)) + } + + /// Make this content emphasized. + pub fn emph(self) -> Self { + Self::show(EmphNode(self)) + } + /// Underline this content. pub fn underlined(self) -> Self { Self::show(DecoNode::<UNDERLINE>(self)) |
