Format images and links as md in md mode and remove redundant sections
from html