story-kit: merge 267_story_mcp_update_story_tool_should_support_front_matter_fields
This commit is contained in:
@@ -161,7 +161,7 @@ fn remove_front_matter_field(contents: &str, key: &str) -> String {
|
||||
/// Insert or update a key: value pair in the YAML front matter of a markdown string.
|
||||
///
|
||||
/// If no front matter (opening `---`) is found, returns the content unchanged.
|
||||
fn set_front_matter_field(contents: &str, key: &str, value: &str) -> String {
|
||||
pub fn set_front_matter_field(contents: &str, key: &str, value: &str) -> String {
|
||||
let mut lines: Vec<String> = contents.lines().map(String::from).collect();
|
||||
if lines.is_empty() || lines[0].trim() != "---" {
|
||||
return contents.to_string();
|
||||
|
||||
Reference in New Issue
Block a user