In my current situation, I am utilizing the replace method in the following manner:
<code v-html="'/<try>/'.replace(/(?:\r\n|\r|\n)/g, 'testing')"></code>
As I work with a longer string that contains numerous \n
, I have observed an unexpected behavior. The characters inside //
like <test>
are also being replaced by the above function that intends to remove line breaks.