Skip to content

Commit

Permalink
Add code to the default rich text configuration (#406)
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick91 authored Jul 21, 2024
1 parent d2b0520 commit b8f9faf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion crates/loro-common/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub enum LoroError {
ArgErr(Box<str>),
#[error("Auto commit has not started. The doc is readonly when detached. You should ensure autocommit is on and the doc and the state is attached.")]
AutoCommitNotStarted,
#[error("You need to specify the style flag for \"({0:?})\" before mark with this key")]
#[error("Style configuration missing for \"({0:?})\". Please provide the style configuration using `configTextStyle` on your Loro doc.")]
StyleConfigMissing(InternalString),
#[error("Unknown Error ({0})")]
Unknown(Box<str>),
Expand Down
7 changes: 7 additions & 0 deletions crates/loro-internal/src/container/richtext/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ impl StyleConfigMap {
expand: ExpandType::None,
},
);

map.map.insert(
"code".into(),
StyleConfig {
expand: ExpandType::None,
},
);

map
}
Expand Down

0 comments on commit b8f9faf

Please sign in to comment.