commit before codeblock detection rewrite