I have a big SQL file with content like
[code language="bash"]
git checkout master
git pull origin master
...
[/code]
Lorem ipsum dolor sit amet, consectetur adipiscing elitUt enim ad minim
[code]some other code[/code]
veniam, quis nostrud exercitation
[code language="php"]var_dump($data);[/code]
And I want to replace the [code language="{lang}"]{wrapped-code}[/code]
by <pre><code class="language-{lang}">{wrapped-code}</code></pre>
So the final output will look like
<pre><code class="language-bash">
git checkout master
git pull origin master
...
</code></pre>
Lorem ipsum dolor sit amet, consectetur adipiscing elitUt enim ad minim
<pre><code>some other code</code></pre>
veniam, quis nostrud exercitation
<pre><code class="language-php">var_dump($data);</code></pre>
Please let me know how we can achieve this with sed or other find and replace command.