summaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
Diffstat (limited to 'src/model')
-rw-r--r--src/model/content.rs14
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))