JS multiline `^` anchors after \n, \r, U+2028, U+2029; the regex crate's `(?m)^` anchors after `\n` only. On CRLF content the JS engine finds a line start after the `\r`, so a greedy leading `\s*` (the block-continuation rule) consumes the `\n` and leaves the bare `\r` in the docstring — byte-parity on CRLF checkouts (every Windows autocrlf clone) depends on reproducing exactly that.
(ch: char)
| 69 | /// byte-parity on CRLF checkouts (every Windows autocrlf clone) depends on |
| 70 | /// reproducing exactly that. |
| 71 | fn is_js_line_terminator(ch: char) -> bool { |
| 72 | matches!(ch, '\n' | '\r' | '\u{2028}' | '\u{2029}') |
| 73 | } |
| 74 | |
| 75 | /// JS-semantics `str.replace(/^<pat>/gm, "")`: try the \A-anchored `pat` at |
| 76 | /// position 0 and after every JS line terminator, left to right, resuming |
nothing calls this directly
no outgoing calls
no test coverage detected