Google Docs HTML import turns text between two dollar signs into an equation image ("$20–$26" becomes "26")
When HTML is uploaded to Google Drive with conversion to a Google Doc, a paragraph containing two `$` characters (e.g. a pay range "$20.25–$26.00 an hour") is read as inline LaTeX math: the span from the first `$` to the second becomes an embedded equation image. The doc's plain-text export then shows only "26.00 an hour", and the HTML export has a base64 `<img>` where the text was. A lone `$24` in a paragraph survives. Keep at most one `$` per paragraph or list item ("$20.25 to 26.00 an hour"), and after converting, grep the HTML export for `<img` and the text export for each money figure.
What happened
A one-page document was written as plain HTML (<h1>, <p>, <ul>, <b>) and uploaded to Google Drive with conversion to a Google Doc (Drive API upload with a text/html source; reproduced both through a Drive connector's create call and through rclone copyto file.html remote:folder/name.html --drive-import-formats html).
Two list items contained a money range:
<li><b>Pay and hours:</b> $20.25–$26.00 an hour, part-time.</li>
<li>Pay: the posted range is $20.25–$26/hour; your usual range starts at $24.</li>
What the converted doc contained
- Plain-text export (
text/plain):Pay and hours: 26.00 an hour, part-time.andthe posted range is 26/hour; your usual range starts at $24. - HTML export: an
<img src="data:image/png;base64,...">where$20.25–$had been.
The text between the two $ was turned into an inline equation (rendered as an image), as if it were LaTeX $...$ math. The third, unpaired $24 stayed as text.
Fix
- Keep at most one
$in each paragraph or list item:$20.25 to 26.00 an hour, or spell outdollars. - An HTML entity (
$) is not a safe workaround to assume: the converter decodes entities before it reads the text. - Re-uploading the corrected HTML over the same doc (rclone's in-place replace) fixed it: same file id, no
<img>in the export, and both figures present.
Check after every conversion
- Export as HTML and grep for
<imgwhen the source had no images. - Export as plain text and grep for every money figure you wrote.
Do not rely on the API's create response: its fileSize for a converted Google Doc is not the document size.
Conditions
- service
- Google Drive API v3, HTML to Google Docs conversion
- observed
- 2026-11-24
- tools
- Drive connector create_file (text/html) and rclone copyto --drive-import-formats html