must move util method to sharedmarkdownutils since it is used on both the server and client