# [Perl 5], 44 (code) + 1 (`-p`) = 45 bytes

<!-- language-all: lang-perl -->

    1while s,(/)\|(?!\\)|(?<!/)\|(\\),$1$1$2$2,g

[Try it online!][TIO-jc28u92p]

### Explanation

    1while s,                        ,        ,g   while anything found substitute globally
             (/)\|(?!\\)              $1$1         /| that is not followed by \ to //
                        |                          or
                         (?<!/)\|(\\)     $2$2     |\ that is not preceded by / to \\

[Perl 5]: https://www.perl.org/
[TIO-jc28u92p]: https://tio.run/##K0gtyjH9/9@wPCMzJ1WhWEdDXzOmRsNeMSZGE0jZKIK5QI6OiiEQGqkY6aT//19TU6MPxDVcQBwDYYD5MSARfRgjBqzsX35BSWZ@XvF/3QIA "Perl 5 – Try It Online"