Hi, this works. Thanks. There is actually one typo where you missed a quotation mark. It should be:
nbf.write(new_ntbk, "fixed_"+nb_file, version=nbf.NO_CONVERT)
Anyway, it does work. But I figured out something else that this function has not covered. If starting a new line in the same markdown cell, this function will not capitalize the first letter of the new line. Could you please also add this rule to the function? I tried to add “\n” to the punctuation_marks list, obviously it does not work as expected.