{"id":453,"date":"2012-02-07T19:02:15","date_gmt":"2012-02-07T19:02:15","guid":{"rendered":"http:\/\/www.websitedesignwebsitedevelopment.com\/?p=453"},"modified":"2014-03-19T09:14:10","modified_gmt":"2014-03-19T09:14:10","slug":"content-clean-function-in-process","status":"publish","type":"post","link":"https:\/\/androidbubble.com\/blog\/website-development\/content-clean-function-in-process\/","title":{"rendered":"Content clean function &#8211; In Process"},"content":{"rendered":"<p>Content clean function is reviewed and corrected. I have tested it with \u201cctr+a\u201d copy of whole webpage and then pasted in story editor. Nothing will disturb our website layout but a little thing is pending, please have a look:<\/p>\n<p>  <strong><br \/>\nWhat is implemented now?<\/strong><br \/>\nIn fact the two contrast functions were available,<br \/>\n<br \/>\n1- A function which can remove only specified tag (with or without data inside it)<br \/>\n<br \/>\n2- A function which can select all the tags from content which is submitted<\/p>\n<p><strong>Situations:<\/strong><br \/>\n1- Suppose if any invalid html tag will come in any valid tag so currently that invalid tag will be removed (only tag, not text inside that tag)<br \/>\n<br \/>\n2- If any valid tag will come inside invalid tag<br \/>\n<br \/>\ne.g.<br \/>\n&lt;table&gt;&lt;tr&gt;&lt;td&gt;<br \/>\nInvalid Tags<br \/>\n&lt;ul&gt;<br \/>\n&lt;li&gt;Valid Tags&lt;\/li&gt;<br \/>\n&lt;li&gt;Valid Tags&lt;\/li&gt;<br \/>\n&lt;\/ul&gt;<br \/>\n&lt;\/td&gt;&lt;\/tr&gt;&lt;\/table&gt;<br \/>\nSo only invalid tags will be removed and their data will remain in content. Our valid tags will be untouched.<\/p>\n<p><strong>Prospects:<\/strong><\/p>\n<p>By this you will see that if a lot of garbage inserted in editor that will not be removed because if we will remove invalid tags and their data inside as well so our valid tags will be removed as well. See the example above.<br \/>\nWhat is pending and couldn\u2019t implemented yet?<br \/>\n<\/p>\n<p>A function which should remove everything except specified (allowed) tags and their respective data, which is not available and couldn\u2019t implemented yet. We have to code it with combination of above mentioned function and an intelligent algorithm.<\/p>\n<p><strong> Suggestion: <\/strong><br \/>\n  For now let it go as I have implemented it that only valid html tags will be passed on and invalid tags will be removed but data will be maintained. Further we can refine this function as following: <br \/>\n  Our function will sense that remove everything except valid tags and its respective data but it will require a recursive parent\/child nodes inspection. More experiments would be required to refine this.<\/p>\n<p>  Coming soon&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Content clean function is reviewed and corrected. I have tested it with \u201cctr+a\u201d copy of whole webpage and then pasted in story editor. Nothing will disturb our website layout but a little thing is pending, please have a look: What is implemented now? In fact the two contrast functions were available, 1- A function which [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-453","post","type-post","status-publish","format-standard","hentry","category-website-development"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Content clean function<\/title>\n<meta name=\"description\" content=\"Content clean function\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/androidbubble.com\/blog\/website-development\/content-clean-function-in-process\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Content clean function\" \/>\n<meta property=\"og:description\" content=\"Content clean function\" \/>\n<meta property=\"og:url\" content=\"https:\/\/androidbubble.com\/blog\/website-development\/content-clean-function-in-process\/\" \/>\n<meta property=\"og:site_name\" content=\"AndroidBubble Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/pages\/Website-Design-Website-Development\/172363336135453\" \/>\n<meta property=\"article:published_time\" content=\"2012-02-07T19:02:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-03-19T09:14:10+00:00\" \/>\n<meta name=\"author\" content=\"Fahad\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Fahad\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/androidbubble.com\/blog\/website-development\/content-clean-function-in-process\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/androidbubble.com\/blog\/website-development\/content-clean-function-in-process\/\"},\"author\":{\"name\":\"Fahad\",\"@id\":\"https:\/\/androidbubble.com\/blog\/#\/schema\/person\/0a833b633f744c3a5e0de7c9a94e71f7\"},\"headline\":\"Content clean function &#8211; In Process\",\"datePublished\":\"2012-02-07T19:02:15+00:00\",\"dateModified\":\"2014-03-19T09:14:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/androidbubble.com\/blog\/website-development\/content-clean-function-in-process\/\"},\"wordCount\":355,\"articleSection\":[\"Website Development\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/androidbubble.com\/blog\/website-development\/content-clean-function-in-process\/\",\"url\":\"https:\/\/androidbubble.com\/blog\/website-development\/content-clean-function-in-process\/\",\"name\":\"Content clean function\",\"isPartOf\":{\"@id\":\"https:\/\/androidbubble.com\/blog\/#website\"},\"datePublished\":\"2012-02-07T19:02:15+00:00\",\"dateModified\":\"2014-03-19T09:14:10+00:00\",\"author\":{\"@id\":\"https:\/\/androidbubble.com\/blog\/#\/schema\/person\/0a833b633f744c3a5e0de7c9a94e71f7\"},\"description\":\"Content clean function\",\"breadcrumb\":{\"@id\":\"https:\/\/androidbubble.com\/blog\/website-development\/content-clean-function-in-process\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/androidbubble.com\/blog\/website-development\/content-clean-function-in-process\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/androidbubble.com\/blog\/website-development\/content-clean-function-in-process\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/androidbubble.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Website Development\",\"item\":\"https:\/\/androidbubble.com\/blog\/category\/website-development\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Content clean function &#8211; In Process\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/androidbubble.com\/blog\/#website\",\"url\":\"https:\/\/androidbubble.com\/blog\/\",\"name\":\"AndroidBubble Blog\",\"description\":\"Articles &amp; Posts\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/androidbubble.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/androidbubble.com\/blog\/#\/schema\/person\/0a833b633f744c3a5e0de7c9a94e71f7\",\"name\":\"Fahad\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/androidbubble.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/afab5bcad71955d142a69df1758e6710aed4ab9cc2b5da28c54a7c3f39801b73?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/afab5bcad71955d142a69df1758e6710aed4ab9cc2b5da28c54a7c3f39801b73?s=96&d=mm&r=g\",\"caption\":\"Fahad\"},\"sameAs\":[\"http:\/\/www.androidbubbles.com\/\",\"https:\/\/x.com\/phpFlex\"],\"url\":\"https:\/\/androidbubble.com\/blog\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Content clean function","description":"Content clean function","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/androidbubble.com\/blog\/website-development\/content-clean-function-in-process\/","og_locale":"en_US","og_type":"article","og_title":"Content clean function","og_description":"Content clean function","og_url":"https:\/\/androidbubble.com\/blog\/website-development\/content-clean-function-in-process\/","og_site_name":"AndroidBubble Blog","article_publisher":"https:\/\/www.facebook.com\/pages\/Website-Design-Website-Development\/172363336135453","article_published_time":"2012-02-07T19:02:15+00:00","article_modified_time":"2014-03-19T09:14:10+00:00","author":"Fahad","twitter_misc":{"Written by":"Fahad","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/androidbubble.com\/blog\/website-development\/content-clean-function-in-process\/#article","isPartOf":{"@id":"https:\/\/androidbubble.com\/blog\/website-development\/content-clean-function-in-process\/"},"author":{"name":"Fahad","@id":"https:\/\/androidbubble.com\/blog\/#\/schema\/person\/0a833b633f744c3a5e0de7c9a94e71f7"},"headline":"Content clean function &#8211; In Process","datePublished":"2012-02-07T19:02:15+00:00","dateModified":"2014-03-19T09:14:10+00:00","mainEntityOfPage":{"@id":"https:\/\/androidbubble.com\/blog\/website-development\/content-clean-function-in-process\/"},"wordCount":355,"articleSection":["Website Development"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/androidbubble.com\/blog\/website-development\/content-clean-function-in-process\/","url":"https:\/\/androidbubble.com\/blog\/website-development\/content-clean-function-in-process\/","name":"Content clean function","isPartOf":{"@id":"https:\/\/androidbubble.com\/blog\/#website"},"datePublished":"2012-02-07T19:02:15+00:00","dateModified":"2014-03-19T09:14:10+00:00","author":{"@id":"https:\/\/androidbubble.com\/blog\/#\/schema\/person\/0a833b633f744c3a5e0de7c9a94e71f7"},"description":"Content clean function","breadcrumb":{"@id":"https:\/\/androidbubble.com\/blog\/website-development\/content-clean-function-in-process\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/androidbubble.com\/blog\/website-development\/content-clean-function-in-process\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/androidbubble.com\/blog\/website-development\/content-clean-function-in-process\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/androidbubble.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Website Development","item":"https:\/\/androidbubble.com\/blog\/category\/website-development\/"},{"@type":"ListItem","position":3,"name":"Content clean function &#8211; In Process"}]},{"@type":"WebSite","@id":"https:\/\/androidbubble.com\/blog\/#website","url":"https:\/\/androidbubble.com\/blog\/","name":"AndroidBubble Blog","description":"Articles &amp; Posts","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/androidbubble.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/androidbubble.com\/blog\/#\/schema\/person\/0a833b633f744c3a5e0de7c9a94e71f7","name":"Fahad","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/androidbubble.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/afab5bcad71955d142a69df1758e6710aed4ab9cc2b5da28c54a7c3f39801b73?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/afab5bcad71955d142a69df1758e6710aed4ab9cc2b5da28c54a7c3f39801b73?s=96&d=mm&r=g","caption":"Fahad"},"sameAs":["http:\/\/www.androidbubbles.com\/","https:\/\/x.com\/phpFlex"],"url":"https:\/\/androidbubble.com\/blog\/author\/admin\/"}]}},"views":313,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/posts\/453","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/comments?post=453"}],"version-history":[{"count":4,"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/posts\/453\/revisions"}],"predecessor-version":[{"id":1692,"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/posts\/453\/revisions\/1692"}],"wp:attachment":[{"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/media?parent=453"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/categories?post=453"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/androidbubble.com\/blog\/wp-json\/wp\/v2\/tags?post=453"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}