Skip to content
Prev Previous commit
Next Next commit
Handle # as a string format delimiter
  • Loading branch information
thecrypticace committed Nov 12, 2025
commit 7f34f3f730fc656cbe53d0f82f7758055c9d618d
6 changes: 6 additions & 0 deletions crates/oxide/src/extractor/pre_processors/ruby.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ impl PreProcessor for Ruby {
b'[' => b']',
b'(' => b')',
b'{' => b'}',
b'#' => b'#',
b' ' => b'\n',
_ => {
cursor.advance();
Expand Down Expand Up @@ -283,6 +284,11 @@ mod tests {
"%p has a \" quote\n# this should be removed\n%p has a \" quote",
"%p has a \" quote\n \n%p has a \" quote"
),

(
"%w#this text is kept# # this text is not",
"%w this text is kept ",
),
] {
Ruby::test(input, expected);
}
Expand Down