Use endswith instead of splicing
Move the last literal yield up higher

Moved it above the standalone checking
Use endswith instead of splicing
Make the unknown tag message more apparent

Maybe this should throw an exception even
Added inline comments

And updated the render doc comment