Skip to content

Commit 7f34f3f

Browse files
committed
Handle # as a string format delimiter
1 parent f381118 commit 7f34f3f

File tree

1 file changed

+6
-0
lines changed
  • crates/oxide/src/extractor/pre_processors

1 file changed

+6
-0
lines changed

crates/oxide/src/extractor/pre_processors/ruby.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ impl PreProcessor for Ruby {
156156
b'[' => b']',
157157
b'(' => b')',
158158
b'{' => b'}',
159+
b'#' => b'#',
159160
b' ' => b'\n',
160161
_ => {
161162
cursor.advance();
@@ -283,6 +284,11 @@ mod tests {
283284
"%p has a \" quote\n# this should be removed\n%p has a \" quote",
284285
"%p has a \" quote\n \n%p has a \" quote"
285286
),
287+
288+
(
289+
"%w#this text is kept# # this text is not",
290+
"%w this text is kept ",
291+
),
286292
] {
287293
Ruby::test(input, expected);
288294
}

0 commit comments

Comments
 (0)