Skip to content

Instantly share code, notes, and snippets.

@jerclarke
Created October 17, 2016 18:49
Show Gist options
  • Save jerclarke/6656398354a7941f9e879ec23d173856 to your computer and use it in GitHub Desktop.
Save jerclarke/6656398354a7941f9e879ec23d173856 to your computer and use it in GitHub Desktop.
Facebook iA confounding source markup for transformations
<div class="alignright factbox">
FACTBOX!
<h4>H4 IN A FACTBOX</h4>
NORMAL TEXT WITH A <a href="https://test.com">LINK</a> IN FACTBOX.
<ul>
<li>UL &gt; LI IN FACTBOX</li>
<li>SECOND LI JUST IN CASE</li>
</ul>
</div>
@jerclarke
Copy link
Author

jerclarke commented Oct 18, 2016

.factbox is a custom style we use in our posts. It's usually floated to the side and acts as a "backgrounder" location. By design is supports headings, images and lists inside, as all are vital for the backgrounder/explainer task.

In FB IA I accept that the formatting won't match our site, but I want to try to do SOMETHING so that the post appears in a way that honors the intention of the author and avoids confusing the reader. Since my palette of formats is extremely limited inside the post, I chose blockquote format as the best facsimile of .factbox (on our site, both appear in similar ways):

		array(
			'class' => 'BlockquoteRule',
			'selector' => '.factbox',
		),

But then all the inner contents are stripped out. Am I required to whitelist every combination of tags that might be nested inside each other to make them work? So far nothing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment