Skip to content

Commit 9f072a0

Browse files
committed
Reduce complexity of fold regex
Also improves performance
1 parent 4619e90 commit 9f072a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/BlockScalars.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function block(str::AbstractString, block_scalar::AbstractString="")
2525

2626
if style == 'f'
2727
str = replace(str, r"(?<=\S)\n(?=\S)" => " ")
28-
str = replace(str, r"(?<=\S)\n(\n+)(?!$)" => s"\1")
28+
str = replace(str, r"(?<=\n)\n(?=\S)" => "")
2929
elseif style != 'l'
3030
throw(ArgumentError("Unknown block style indicator: $(repr(style))"))
3131
end

0 commit comments

Comments
 (0)