Changes
Created page with 'The following script is a work in progress. The end goal is to produce [w:WikiMarkup] from the HTML of a downloaded [w:MediaWiki] page. <pre> sed -rn -e '/<!-- start content -->…'
The following script is a work in progress. The end goal is to produce [w:WikiMarkup] from the HTML of a downloaded [w:MediaWiki] page.
<pre>
sed -rn -e '/<!-- start content -->/,/<!--/p' page.html | \
sed -r -e '/<!--/d' -e 's%</?p>%%g' \
-e 's%<br>%<br />%' \
-e 's|<a href="([^"]*)" class="external text" title="[^"]*" rel="nofollow">([^<]*)</a>|[\1 \2]|'
</pre>
<pre>
sed -rn -e '/<!-- start content -->/,/<!--/p' page.html | \
sed -r -e '/<!--/d' -e 's%</?p>%%g' \
-e 's%<br>%<br />%' \
-e 's|<a href="([^"]*)" class="external text" title="[^"]*" rel="nofollow">([^<]*)</a>|[\1 \2]|'
</pre>