From 03a0f8403bf94e2f417cbf5e9801eaa6b5f56da8 Mon Sep 17 00:00:00 2001 From: Grant Lemons Date: Tue, 21 Jan 2025 12:50:18 -0700 Subject: [PATCH] refactor(typst): move comment to be doc comment of new function --- harper-typst/src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/harper-typst/src/lib.rs b/harper-typst/src/lib.rs index bbd51aa9..2cd2124b 100644 --- a/harper-typst/src/lib.rs +++ b/harper-typst/src/lib.rs @@ -36,6 +36,11 @@ impl Parser for Typst { } } +/// Converts newlines after certain elements to paragraph breaks +/// This is accomplished here instead of in the translating module because at this point there is +/// still semantic information associated with the elements. +/// +/// Newlines are separate expressions in the parse tree (as the Space variant) fn convert_parbreaks<'a>(buf: &'a mut Vec, exprs: &'a [Expr]) -> Vec> { // Owned collection of nodes forcibly casted to paragraph breaks *buf = exprs @@ -47,11 +52,6 @@ fn convert_parbreaks<'a>(buf: &'a mut Vec, exprs: &'a [Expr]) -> Vec }) .collect_vec(); - // Converts newlines after certain elements to paragraph breaks - // This is accomplished here instead of in the translating module because at this point there is - // still semantic information associated with the elements. - // - // Newlines are separate expressions in the parse tree (as the Space variant) let should_parbreak = |e1, e2, e3| { matches!(e2, Expr::Space(_)) && (matches!(e1, Expr::Heading(_) | Expr::List(_))