pseudo code for markup extraction