Quantcast
Channel: Convert markdown code block markers to criticMarkup syntax - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Answer by potong for Convert markdown code block markers to criticMarkup syntax

$
0
0

This might work for you (GNU sed):

sed '/```/{s//{>>/;:a;n;s//<<}/;Ta}' file

Match a line containing ```.

Replace that line by {>>.

Read/print following lines.

When another line matches the same regexp, replace it by <<}.

N.B. T branches when the last substitution fails. It is the dual of t.

See here for demo.


Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>