working all proper untested

code for correct parsing/replacing and rendering of ....