[BUG #7288] ensure correct quote char handling in reduceOperation()

- if an operation is replace by its result
- and the result is a synthetic string node
- make sure the node gets the right 'detail=singlequotes'
- and embedded quotes in the string are escaped properly