簡體   English   中英

邏輯應用程序 - 以純文本格式轉換 HTML 符號

[英]Logic Apps - Converting HTML symbols in plain text

邏輯應用程序的新手並且不熟悉所有功能。

我創建了一個簡單的邏輯應用程序,它會經常檢查 RSS 提要,循環它找到的每個項目,只獲取某些數據(標題、摘要和 URL 鏈接),將它們粘貼到 HTML 表中,然后發送帶有結果的電子郵件。 聽起來相當簡單,對吧?

我面臨的問題是 RSS 提要包含某些 HTML 字符,例如& ' ,然后會出現在我收到的電子郵件中。 是否可以在邏輯應用程序中轉換這些?

此外,我還注意到一些 HTML 字符是“雙重編碼的??” 基本上,如果我們不得不看<description>&amp;quot;Quando Romelu si mette in testa una cosa, di solito la ottiene. Ora, si sarebbe messo in testa l&amp;rsquo;Inter.</description> <description>&amp;quot;Quando Romelu si mette in testa una cosa, di solito la ottiene. Ora, si sarebbe messo in testa l&amp;rsquo;Inter.</description>你會立刻意識到第一個&amp; 是在那里quot; 緊隨其后。 所以有點期待&amp; 以實際的 & 轉換為形式&quot; 然后轉換為“,如果我說的有意義。我不擁有提要,也不以任何方式控制它。想熟悉邏輯應用程序,所以我想我會從一些足球新聞開始加工。

這是 RSS 提要中一項(共 20 個)的示例

<item>
  <guid>https://www.fcinternews.it/?action=read&amp;idnotizia=310797</guid>
  <pubDate>Wed, 19 Jun 2019 09:51:40 +0200</pubDate>
  <title>CdS - Il BVB vuole Pinamonti: valutazione schizzata oltre i 20 milioni </title>
  <link>https://www.fcinternews.it/rassegna/cds-il-bvb-vuole-pinamonti-valutazione-schizzata-oltre-i-20-milioni-310797</link>
  <description>Anche il Corriere dello Sport sottolinea la grande fila che si &amp;egrave; messa in attesa di buone nuove dall&amp;#39;Inter per Andrea Pinamonti, protogonista del Mondiale U-20.</description>
  <category>Rassegna</category>
  <enclosure url="https://net-storage.tccstatic.com/storage/fcinternews.it/img_notizie/thumb1/ec/ec620af4eeb01ebebbb662d7947a6700-85495-21a8fcf5fc9c392cfa4303d2753d5db6.jpeg" type="image/jpeg" length="9983"/>
</item>

有使用 Azure 函數清理鏈接的解決方案

然而,當你在做這樣的事情時,我想你可以做替換動作,哦順便說一句,單引號轉義很糟糕。 使用變量來欺騙它。

replace(replace(replace(replace(item()['summary'],'&nbsp;',' '),'&amp;','& '),'&quot;','"'),'&#39;','')

replace(replace(replace(replace(item()['title'],'&nbsp;',' '),'&amp;','& '),'&quot;','"'),'&#39;',variables('EscapeSingleQuotation'))

流動

結果

html表格

這是你想要的?

Microsoft 已包含稱為- 內容轉換的新連接器。
這會將 HTML 內容轉換為純字符串。

這在 Logic Apps、Power Automate、Power Apps 上可用。 但仍處於預覽階段。

在此處輸入圖片說明

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM