Skip to content

Commit

Permalink
processDocHTML: Add balancing test
Browse files Browse the repository at this point in the history
  • Loading branch information
earthboundkid committed Jul 29, 2024
1 parent 6474c93 commit 583db6d
Show file tree
Hide file tree
Showing 21 changed files with 595 additions and 0 deletions.
23 changes: 23 additions & 0 deletions internal/db/testdata/gdoc bad embed/article.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
HARRISBURG — Lawmakers have finalized Pennsylvania’s new $47.6 billion budget — and no one is completely happy.

Democratic Gov. Josh Shapiro didn’t get recreational marijuana or a tax on skill games; legislative Democrats didn’t get a minimum wage increase; and legislative Republicans didn’t get tax cuts.

Still, <a href="https://www.spotlightpa.org/news/2024/07/pennsylvania-budget-public-schools-economic-development-scholarships-josh-shapiro-legislature/">plenty made it into the final plan</a>. It increases K-12 education spending, <a href="https://www.spotlightpa.org/news/2024/07/pennsylvania-legislature-budget-deal-education-spending-public-schools-josh-shapiro/">sends $500 million to the state’s poorest schools</a>, funnels new dollars into economic development, and creates a new college scholarship program.

For more insight on the spending plan, Spotlight PA’s Capitol reporter Stephen Caruso is hosting a live panel.

Spotlight PA held a free panel discussion on the major components of the budget, the politics that shaped the deal, and what was left on the cutting room floor.

<strong>Our panelists were:</strong>

- <strong>Stephen Caruso,</strong> Capitol reporter, Spotlight PA

- <strong>Kristina Moon,</strong> senior attorney, Education Law Center

- <strong>Mustafa Rashed,</strong> president &amp; CEO, Bellevue Strategies

- <strong>Stan Saylor,</strong> former House GOP appropriations chair

{{<embed/raw srcdoc="&lt;div style=&#34;padding:56.25% 0 0 0;position:relative;&#34;&gt;&lt;iframe src=&#34;https://player.vimeo.com/video/990627534?h=89f8de8242&amp;color=ffcb05&amp;title=0&amp;byline=0&#34; style=&#34;position:absolute;top:0;left:0;width:100%;height:100%;&#34; frameborder=&#34;0&#34; allow=&#34;autoplay; fullscreen; picture-in-picture&#34; allowfullscreen&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;script src=&#34;https://player.vimeo.com/api/player.js&#34;&gt;&lt;/script&gt;&#10;&lt;p&gt;&lt;a href=&#34;https://vimeo.com/990627534&#34;&gt;">}}

<strong>» Spotlight PA’s events operate on a “pay-what-you-can” honor system.</strong> If you value this public-service event, pay it forward and contribute any amount to Spotlight PA now so we can keep our programming free for everyone: <a href="http://spotlightpa.org/donate">spotlightpa.org/donate</a>.
1 change: 1 addition & 0 deletions internal/db/testdata/gdoc bad embed/doc.json

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions internal/db/testdata/gdoc bad embed/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"publication_date": null,
"internal_id": "SPLBUD24EVENT",
"byline": "Spotlight PA Staff",
"budget": "Spotlight PA Event: What Pennsylvania’s new $47.6 billion budget means for you",
"hed": "WATCH: What Pennsylvania’s new $47.6 billion budget means for you",
"description": "Spotlight PA hosted a free panel on Pennsylvania’s budget winners and losers.",
"lede_image": "2023/08/01jd-ah85-c3ry-svfm.jpeg",
"lede_image_credit": "Amanda Berg / For Spotlight PA",
"lede_image_description": "The exterior of the Pennsylvania Capitol in Harrisburg.",
"lede_image_caption": "",
"eyebrow": "Events",
"url_slug": "pennsylvania-budget-josh-shapiro-legislature-education-funding",
"blurb": "Spotlight PA hosted a free panel on what did — and didn’t — make it into Pennsylvania’s new budget.",
"link_title": "",
"seo_title": "Live event: Learn how PA’s new budget benefits you",
"og_title": "Live event: Learn how PA’s new budget benefits you",
"twitter_title": "Live event: Learn how PA’s new budget benefits you"
}
32 changes: 32 additions & 0 deletions internal/db/testdata/gdoc bad embed/page.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"id": 123,
"file_path": "content/news/2020-03-15-gdoc bad embed.md",
"frontmatter": {
"authors": null,
"blurb": "Spotlight PA hosted a free panel on what did — and didn’t — make it into Pennsylvania’s new budget.",
"byline": "Spotlight PA Staff",
"description": "Spotlight PA hosted a free panel on Pennsylvania’s budget winners and losers.",
"image": "2023/08/01jd-ah85-c3ry-svfm.jpeg",
"image-caption": "",
"image-credit": "Amanda Berg / For Spotlight PA",
"image-description": "The exterior of the Pennsylvania Capitol in Harrisburg.",
"internal-id": "gdoc bad embed",
"kicker": "Events",
"linktitle": "",
"og-title": "Live event: Learn how PA’s new budget benefits you",
"published": "2020-03-15T20:00:00Z",
"slug": "pennsylvania-budget-josh-shapiro-legislature-education-funding",
"title": "WATCH: What Pennsylvania’s new $47.6 billion budget means for you",
"title-tag": "Live event: Learn how PA’s new budget benefits you",
"twitter-title": "Live event: Learn how PA’s new budget benefits you"
},
"body": "HARRISBURG — Lawmakers have finalized Pennsylvania’s new $47.6 billion budget — and no one is completely happy.\n\nDemocratic Gov. Josh Shapiro didn’t get recreational marijuana or a tax on skill games; legislative Democrats didn’t get a minimum wage increase; and legislative Republicans didn’t get tax cuts.\n\nStill, <a href=\"https://www.spotlightpa.org/news/2024/07/pennsylvania-budget-public-schools-economic-development-scholarships-josh-shapiro-legislature/\">plenty made it into the final plan</a>. It increases K-12 education spending, <a href=\"https://www.spotlightpa.org/news/2024/07/pennsylvania-legislature-budget-deal-education-spending-public-schools-josh-shapiro/\">sends $500 million to the state’s poorest schools</a>, funnels new dollars into economic development, and creates a new college scholarship program.\n\nFor more insight on the spending plan, Spotlight PA’s Capitol reporter Stephen Caruso is hosting a live panel.\n\nSpotlight PA held a free panel discussion on the major components of the budget, the politics that shaped the deal, and what was left on the cutting room floor.\n\n<strong>Our panelists were:</strong>\n\n- <strong>Stephen Caruso,</strong> Capitol reporter, Spotlight PA\n\n- <strong>Kristina Moon,</strong> senior attorney, Education Law Center\n\n- <strong>Mustafa Rashed,</strong> president &amp; CEO, Bellevue Strategies\n\n- <strong>Stan Saylor,</strong> former House GOP appropriations chair\n\n{{<embed/raw srcdoc=\"&lt;div style=&#34;padding:56.25% 0 0 0;position:relative;&#34;&gt;&lt;iframe src=&#34;https://player.vimeo.com/video/990627534?h=89f8de8242&amp;color=ffcb05&amp;title=0&amp;byline=0&#34; style=&#34;position:absolute;top:0;left:0;width:100%;height:100%;&#34; frameborder=&#34;0&#34; allow=&#34;autoplay; fullscreen; picture-in-picture&#34; allowfullscreen&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;script src=&#34;https://player.vimeo.com/api/player.js&#34;&gt;&lt;/script&gt;&#10;&lt;p&gt;&lt;a href=&#34;https://vimeo.com/990627534&#34;&gt;\">}}\n\n<strong>» Spotlight PA’s events operate on a “pay-what-you-can” honor system.</strong> If you value this public-service event, pay it forward and contribute any amount to Spotlight PA now so we can keep our programming free for everyone: <a href=\"http://spotlightpa.org/donate\">spotlightpa.org/donate</a>.\n",
"schedule_for": null,
"last_published": null,
"created_at": "2020-03-15T20:00:00Z",
"updated_at": "2020-03-15T20:00:00Z",
"url_path": null,
"source_type": "gdocs",
"source_id": "abc123_testdata-gdoc-bad-embed",
"publication_date": "2020-03-15T16:00:00-04:00"
}
13 changes: 13 additions & 0 deletions internal/db/testdata/gdoc bad embed/raw.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<p><a href="https://www.spotlightpa.org/"><em>Spotlight PA</em></a><em> is an independent, nonpartisan, and nonprofit newsroom producing investigative and public-service journalism that holds power to account and drives positive change in Pennsylvania. </em><a href="https://www.spotlightpa.org/newsletters"><em>Sign up for our free newsletters</em></a><em>.</em>
</p>

<p>HARRISBURG — Lawmakers have finalized Pennsylvania’s new $47.6 billion budget — and no one is completely happy.</p>
<p>Democratic Gov. Josh Shapiro didn’t get recreational marijuana or a tax on skill games; legislative Democrats didn’t get a minimum wage increase; and legislative Republicans didn’t get tax cuts.</p>
<p>Still, <a href="https://www.spotlightpa.org/news/2024/07/pennsylvania-budget-public-schools-economic-development-scholarships-josh-shapiro-legislature/">plenty made it into the final plan</a>. It increases K-12 education spending, <a href="https://www.spotlightpa.org/news/2024/07/pennsylvania-legislature-budget-deal-education-spending-public-schools-josh-shapiro/">sends $500 million to the state’s poorest schools</a>, funnels new dollars into economic development, and creates a new college scholarship program.</p>
<p>For more insight on the spending plan, Spotlight PA’s Capitol reporter Stephen Caruso is hosting a live panel.</p>
<p>Spotlight PA held a free panel discussion on the major components of the budget, the politics that shaped the deal, and what was left on the cutting room floor.</p>
<p><strong>Our panelists were:</strong></p>
<ul><li><p><strong>Stephen Caruso,</strong> Capitol reporter, Spotlight PA</p></li><li><p><strong>Kristina Moon,</strong> senior attorney, Education Law Center</p></li><li><p><strong>Mustafa Rashed,</strong> president &amp; CEO, Bellevue Strategies</p></li><li><p><strong>Stan Saylor,</strong> former House GOP appropriations chair</p></li></ul>
<div style="padding:56.25% 0 0 0;position:relative;"><iframe src="https://player.vimeo.com/video/990627534?h=89f8de8242&color=ffcb05&title=0&byline=0" style="position:absolute;top:0;left:0;width:100%;height:100%;" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen></iframe></div><script src="https://player.vimeo.com/api/player.js"></script>
<p><a href="https://vimeo.com/990627534">
<p><strong>» Spotlight PA’s events operate on a “pay-what-you-can” honor system.</strong> If you value this public-service event, pay it forward and contribute any amount to Spotlight PA now so we can keep our programming free for everyone: <a href="http://spotlightpa.org/donate">spotlightpa.org/donate</a>.</p>
12 changes: 12 additions & 0 deletions internal/db/testdata/gdoc bad embed/rich.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<p><a href="https://www.spotlightpa.org/"><em>Spotlight PA</em></a><em> is an independent, nonpartisan, and nonprofit newsroom producing investigative and public-service journalism that holds power to account and drives positive change in Pennsylvania. </em><a href="https://www.spotlightpa.org/newsletters"><em>Sign up for our free newsletters</em></a><em>.</em>
</p>

<p>HARRISBURG — Lawmakers have finalized Pennsylvania’s new $47.6 billion budget — and no one is completely happy.</p>
<p>Democratic Gov. Josh Shapiro didn’t get recreational marijuana or a tax on skill games; legislative Democrats didn’t get a minimum wage increase; and legislative Republicans didn’t get tax cuts.</p>
<p>Still, <a href="https://www.spotlightpa.org/news/2024/07/pennsylvania-budget-public-schools-economic-development-scholarships-josh-shapiro-legislature/">plenty made it into the final plan</a>. It increases K-12 education spending, <a href="https://www.spotlightpa.org/news/2024/07/pennsylvania-legislature-budget-deal-education-spending-public-schools-josh-shapiro/">sends $500 million to the state’s poorest schools</a>, funnels new dollars into economic development, and creates a new college scholarship program.</p>
<p>For more insight on the spending plan, Spotlight PA’s Capitol reporter Stephen Caruso is hosting a live panel.</p>
<p>Spotlight PA held a free panel discussion on the major components of the budget, the politics that shaped the deal, and what was left on the cutting room floor.</p>
<p><strong>Our panelists were:</strong></p>
<ul><li><p><strong>Stephen Caruso,</strong> Capitol reporter, Spotlight PA</p></li><li><p><strong>Kristina Moon,</strong> senior attorney, Education Law Center</p></li><li><p><strong>Mustafa Rashed,</strong> president &amp; CEO, Bellevue Strategies</p></li><li><p><strong>Stan Saylor,</strong> former House GOP appropriations chair</p></li></ul>
<h2 style="color: red;">Embed #1</h2>
<p><strong>» Spotlight PA’s events operate on a “pay-what-you-can” honor system.</strong> If you value this public-service event, pay it forward and contribute any amount to Spotlight PA now so we can keep our programming free for everyone: <a href="http://spotlightpa.org/donate">spotlightpa.org/donate</a>.</p>
23 changes: 23 additions & 0 deletions internal/db/testdata/gdoc bad embed/shared-article.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"id": 123,
"status": "U",
"embargo_until": null,
"note": "",
"source_type": "gdocs",
"source_id": "abc123_testdata-gdoc-bad-embed",
"raw_data": null,
"page_id": null,
"created_at": "2020-03-15T20:00:00Z",
"updated_at": "2020-03-15T20:00:00Z",
"publication_date": null,
"internal_id": "SPLBUD24EVENT",
"byline": "Spotlight PA Staff",
"budget": "Spotlight PA Event: What Pennsylvania’s new $47.6 billion budget means for you",
"hed": "WATCH: What Pennsylvania’s new $47.6 billion budget means for you",
"description": "Spotlight PA hosted a free panel on Pennsylvania’s budget winners and losers.",
"lede_image": "2023/08/01jd-ah85-c3ry-svfm.jpeg",
"lede_image_credit": "Amanda Berg / For Spotlight PA",
"lede_image_description": "The exterior of the Pennsylvania Capitol in Harrisburg.",
"lede_image_caption": "",
"blurb": "Spotlight PA hosted a free panel on what did — and didn’t — make it into Pennsylvania’s new budget."
}
4 changes: 4 additions & 0 deletions internal/db/testdata/gdoc bad embed/warnings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[
"Embed #1 seems to contain unbalanced HTML.",
"Paragraph beginning \"Our panelists...\" looks like a header, but does not use H-tag."
]
Loading

0 comments on commit 583db6d

Please sign in to comment.