security: rtrim, not unsafe /X+$/ idiom
security: rtrim, not unsafe /X+$/ idiom

Problem:
replace(/X+$/, '') is vulnerable to REDOS

Solution:
Replace all instances I could find with a custom rtrim

chjj/marked,chjj/marked