diff --git a/macro/src/dialect.rs b/macro/src/dialect.rs index 31bffe6d67..61c1bae059 100644 --- a/macro/src/dialect.rs +++ b/macro/src/dialect.rs @@ -64,9 +64,7 @@ fn generate_dialect_module( let doc = format!( "`{name}` dialect.\n\n{}", - sanitize_documentation(&unindent::unindent( - dialect.str_value("description").unwrap_or(""), - ))? + sanitize_documentation(dialect.str_value("description").unwrap_or(""),)? ); let name = sanitize_snake_case_name(name)?; diff --git a/macro/src/dialect/operation.rs b/macro/src/dialect/operation.rs index ec96804430..f0ade14124 100644 --- a/macro/src/dialect/operation.rs +++ b/macro/src/dialect/operation.rs @@ -586,7 +586,7 @@ impl<'a> Operation<'a> { ] .join(" ") }, - description: unindent::unindent(definition.str_value("description")?), + description: sanitize_documentation(definition.str_value("description")?)?, regions, }) } diff --git a/macro/src/dialect/utility.rs b/macro/src/dialect/utility.rs index bc43fae820..a13cf22235 100644 --- a/macro/src/dialect/utility.rs +++ b/macro/src/dialect/utility.rs @@ -32,7 +32,7 @@ fn sanitize_name(name: &str) -> Result { pub fn sanitize_documentation(string: &str) -> Result { let arena = Arena::new(); - let node = parse_document(&arena, string, &Default::default()); + let node = parse_document(&arena, &unindent::unindent(string), &Default::default()); for node in node.traverse() { let NodeEdge::Start(node) = node else {