from the
 
tag I made a simple BBCode script and everything works fine. But then I use ...">

Remove <br/"> from the <pre class = "prettyprint-override"> </pre> tag

I made a simple BBCode script and everything works fine. But then I use the javascript library to decorate my codes in <pre></pre>.

Now, the only problem I am facing is that I have tags <br />after each line of code in the tags <pre></pre>.

So, the question is how to remove tags <br />that are ARE INSIDE tags <pre></pre>.

The regular expression with preg_replace is similar to what I need, but I could not find / make it suitable. I am not very good at regular expression .: S

+2
source share
1 answer

, , .

: '/.*<pre>.*(<br \/>).*<\/pre>/'

: https://regex101.com/r/pV2qX8/2

: u - , <br /> <pre></pre>.

2: - u :

(Sub-Q: <br /> )

+3

All Articles