I need to do find and replace in a Google doc. Essentially, I have a template Google Doc that I want to copy and customize, programatically.
The original and the copy should both be in the native Gdoc format, and it should look the same before and after, in terms of visual layout and formatting.
Tried downloading HTML (and other formats) via the exportLink, doing my find-and-replace on the output, then updating the content to be the output of the find-and-replace. But that screws up the formatting, and seems very... roundabout.
I'm using the Ruby client, for what that's worth, but the main question is, what's the best practice for doing a find-and-replace in a native Doc?