fix: trim descriptions
All checks were successful
ci/woodpecker/push/publish Pipeline was successful
All checks were successful
ci/woodpecker/push/publish Pipeline was successful
This commit is contained in:
parent
bfd8467d14
commit
df5d47322c
1 changed files with 13 additions and 4 deletions
|
@ -219,10 +219,19 @@ pub fn get_metadata<'a>(root: &'a AstNode<'a>, mtype: TypeFileMetadata) -> FileM
|
||||||
blog: Some(deserialize_metadata(text)),
|
blog: Some(deserialize_metadata(text)),
|
||||||
..FileMetadata::default()
|
..FileMetadata::default()
|
||||||
},
|
},
|
||||||
TypeFileMetadata::Contact => FileMetadata {
|
TypeFileMetadata::Contact => {
|
||||||
contact: Some(deserialize_metadata(text)),
|
let mut metadata: FileMetadataContact = deserialize_metadata(text);
|
||||||
..FileMetadata::default()
|
|
||||||
},
|
// Trim descriptions
|
||||||
|
if let Some(desc) = &mut metadata.description {
|
||||||
|
*desc = desc.trim().to_owned();
|
||||||
|
}
|
||||||
|
|
||||||
|
FileMetadata {
|
||||||
|
contact: Some(metadata),
|
||||||
|
..FileMetadata::default()
|
||||||
|
}
|
||||||
|
}
|
||||||
TypeFileMetadata::Portfolio => FileMetadata {
|
TypeFileMetadata::Portfolio => FileMetadata {
|
||||||
portfolio: Some(deserialize_metadata(text)),
|
portfolio: Some(deserialize_metadata(text)),
|
||||||
..FileMetadata::default()
|
..FileMetadata::default()
|
||||||
|
|
Loading…
Reference in a new issue