From the course: Google Apps Script for JavaScript Developers
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Adding URLs - Google Docs Tutorial
From the course: Google Apps Script for JavaScript Developers
Adding URLs
- [Instructor] At this point we can now identify code blocks within our Google Doc file, and format them correctly for Markdown. Next, we're going to want to look at the text blocks and see if there are URLs inside of it, so that we can format them in a way that Markdown can display. Let's go back into our Convert2Markdown project, and go into our Doc2Markdown script. Inside of our format text method we're going to change the param so that it makes a little bit more sense as to what we're actually trying to format. Let's go ahead and change this to textElement, and we can copy and paste this below so that we're now calling getText on the textElement. As our script becomes more complicated we want to make sure that each function clearly indicates the type of element we're about to parse. Now, one of the things that we can do in order to see formatting inside of a text element is to look for attribute indices. These represent the beginning positions of where particular formatting…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.