Reputation: 118
I have some html like this:
var html = '<h1>heading</h1><p>Lorem ipsum dolor sit amet<br>more text</p><ul><<li>Bulleted text</li></ul>'
And I want to convert this string into rich text in a google Doc. Any way I can do that?
Upvotes: 4
Views: 9031
Reputation: 201643
For example, from your tag, if you want to achieve it using Google Apps Script, how about this sample script? I think that there are several solutions for your situation. So please think of this as just one of them.
When you use this script, please enable Drive API at Advanced Google Services and API console. You can see about this at here.
var html = '<h1>heading</h1><p>Lorem ipsum dolor sit amet<br>more text</p><ul><<li>Bulleted text</li></ul>';
var blob = HtmlService.createHtmlOutput(html).getBlob();
Drive.Files.insert({title: "fileName", mimeType: MimeType.GOOGLE_DOCS}, blob);
If this was not the result you want, I apologize.
Upvotes: 6