Skip to content

Commit

Permalink
use multi line
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Feb 2, 2024
1 parent 98f5acd commit 4c3a31a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/biome_cli/src/execute/process_file/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pub(crate) fn format_with_guard<'ctx>(
if let (Some(start), Some(end)) = (matches.next(), matches.next()) {
output = format!(
"{}{}{}",
&input[..start.end()],
&input[..start.end() + 1],
output.as_str(),
&input[end.start()..]
);
Expand Down
7 changes: 5 additions & 2 deletions crates/biome_service/src/file_handlers/astro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@ use biome_js_syntax::{JsFileSource, JsLanguage};
use biome_parser::AnyParse;
use biome_rowan::{FileSource, NodeCache};
use lazy_static::lazy_static;
use regex::Regex;
use regex::{Regex, RegexBuilder};
use tracing::{debug, error, info};

#[derive(Debug, Default, PartialEq, Eq)]
pub(crate) struct AstroFileHandler;

lazy_static! {
pub static ref ASTRO_FENCE: Regex = Regex::new(r#"---\s*\n"#).unwrap();
pub static ref ASTRO_FENCE: Regex = RegexBuilder::new(r#"^---\s*$"#)
.multi_line(true)
.build()
.unwrap();
}

impl ExtensionHandler for AstroFileHandler {
Expand Down

0 comments on commit 4c3a31a

Please sign in to comment.