<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="380783" data-post-id="380783">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dimitarvp" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/120/38664_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dimitarvp
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="Wigny" data-post="21" data-topic="73784">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/wigny/48/25529_2.png" class="avatar"> Wigny:</div>
<blockquote>
<p>I was just playing with <code>xmerl</code> this week and sadly it parses XML generating atom keyed trees.</p>
</blockquote>
</aside>
<p>Thank you for the grounding, I was unsure myself.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="380783" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/recommendations-to-parse-atom-and-rss-feeds/73784/22">Post #21</a>
	                </div>
	            </div>
              <div id="likers-container-380783" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="380783"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #21"></div>
  </section>
</div>
    <div class="postbit" id="380786" data-post-id="380786">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="garrison" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  garrison
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thanks for confirming. Note that there is some <a href="https://security.erlef.org/secure_coding_and_deployment_hardening/xmerl.html" rel="noopener nofollow ugc">further guidance from the erlef</a> for the sax parser.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="380786" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/recommendations-to-parse-atom-and-rss-feeds/73784/23">Post #22</a>
	                </div>
	            </div>
              <div id="likers-container-380786" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="380786"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #22"></div>
  </section>
</div>
    <div class="postbit" id="380966" data-post-id="380966">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="derek-zhou" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/derek-zhou/120/19943_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  derek-zhou
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="garrison" data-post="6" data-topic="73784">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/g/3bc359/48.png" class="avatar"> garrison:</div>
<blockquote>
<p>Does the HTML parser support CDATA? I would think not, right?</p>
<p>It’s very common to embed content in RSS feeds using CDATA (e.g. HTML content). Saxy handles it fine.</p>
</blockquote>
</aside>
<p>CDATA is just string, which is handled in Floki’s built in parser here:</p>
<p><a href="https://github.com/philss/floki/blob/ab1d36110f4b11c0c13016f81733a47a0a6d47d0/lib/floki/html/tokenizer.ex#L1555" class="onebox" target="_blank" rel="noopener nofollow ugc">https://github.com/philss/floki/blob/ab1d36110f4b11c0c13016f81733a47a0a6d47d0/lib/floki/html/tokenizer.ex#L1555</a></p>
<p>Yes, it is common practice to embed HTML content in the feeds. I handle 2 most common cases:</p>
<ul>
<li>directly insert the html DOM tree within the RSS <code>item</code> This is probably not 100% kosher XML but it is very easy to handle. I just take the HTML sub-node verbatim.</li>
<li>embed the html fragment as an encoded string. I just take the string, call Floki again on it to parse the html structure</li>
</ul>
<p>I believe the above 2 cases handle the 99% feeds in the wild. They are embarrassingly easy to handle so I will skip posting my not very elegant code. If you see something more exotic than this, please give me a url, I’d like to play with it.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="380966" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/recommendations-to-parse-atom-and-rss-feeds/73784/24">Post #23</a>
	                </div>
	            </div>
              <div id="likers-container-380966" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="380966"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>