news-catalyst / google-app-scripts

a collection of scripts for tinynews google docs add-ons
https://script.google.com/a/newscatalyst.org/d/1ILURq69o3cYUy6k1n1X6HwxdMfl9xWNhILYuZxgLfeblb3IR15WCMZSj/edit
1 stars 1 forks source link

How can we handle blockquotes? #332

Closed TylerFisher closed 2 years ago

TylerFisher commented 2 years ago

Is it possible to detect an indented block like this?

Screen Shot 2021-09-27 at 3 29 51 PM
jacqui commented 2 years ago

Yes, it's possible to do this.

I was able to update the document processing to result in the following for first a blockquote - an indented paragraph of text - and then a regular non-indented paragraph:

{
  "children": [
    {
      "index": 74,
      "style": {},
      "content": "“This should be a block quote,” said the tester."
    }
  ],
  "link": null,
  "type": "blockquote",
  "index": 74,
  "style": "NORMAL_TEXT"
},
{
  "children": [
    {
      "index": 109,
      "style": {},
      "content": "Another regular paragraph of text."
    }
  ],
  "link": null,
  "type": "text",
  "index": 109,
  "style": "NORMAL_TEXT"
}

I think it could be enough to label the element as "blockquote" instead of "text" for the purposes of rendering it different, right?

TylerFisher commented 2 years ago

Yup, that would work.