Skip to content

Instantly share code, notes, and snippets.

@phcostabh
Created October 3, 2013 18:49
Show Gist options
  • Select an option

  • Save phcostabh/6814981 to your computer and use it in GitHub Desktop.

Select an option

Save phcostabh/6814981 to your computer and use it in GitHub Desktop.
#! /bin/bash
sed -r 's,^-.*$,<li>&</li>,' $1 |\
sed '/^[0-9].*:$/,/;</ {
s,:$,&\n<ul>,;
s,;</li>,&\n</ul>,;
b
}' |\
sed 's,[0-9]\.[0-9]\..*,<li>&</li>,' |\
sed '1s,^[A-Z].*,<li>\n<b>&</b>\n<ul>,; s,^$,</ul>\n<li>,; s,^[A-Z].*,<b>&</b>\n<ul>,';
echo -e "</ul>\n</li>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment