# Whitelist all the code inside of a div tag?

**URL:** <https://meta.discourse.org/t/whitelist-all-the-code-inside-of-a-div-tag/51391>\
**Category:** Support\
**Created:** [11.Октябрь.2016 09:23:32 UTC](https://meta.discourse.org/t/whitelist-all-the-code-inside-of-a-div-tag/51391 "2016-10-11T09:23:32Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![Alex\_Rabolin](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@Alex\_Rabolin](https://meta.discourse.org/u/Alex_Rabolin)\
**Post date:** [12.Октябрь.2016 00:01:19 UTC](https://meta.discourse.org/t/whitelist-all-the-code-inside-of-a-div-tag/51391/8 "2016-10-12T00:01:19Z")

</div>

> [@Mittineague](#):
>
> [https://fr.windfinder.com/widget/forecast/js/](https://fr.windfinder.com/widget/forecast/js/)\*  
> [Météo Seattle - meteoblue](https://www.meteoblue.com/fr/meteo/widget/daily/)\*  
> [http://widget.windguru.cz/js/wg\_widget.php](http://widget.windguru.cz/js/wg_widget.php)

If i understand, like that :

. **js**

```js
(function() {
  Discourse.Markdown.whiteListTag('script', 'src', 'https://fr.windfinder.com/widget/forecast/js/*');
  Discourse.Markdown.whiteListTag('iframe', 'src', 'https://www.meteoblue.com/fr/meteo/widget/daily/*');
  Discourse.Markdown.whiteListTag('script', 'src', 'http://widget.windguru.cz/js/wg_widget.php');
  Discourse.Markdown.whiteListTag('div', 'id', '*');  
})();

```

**(I doubt a security level, but I can not write : Discourse.Markdown.whiteListTag(‘div’, ‘id’, ‘wg\_target\_div\_\*’);**?  
Or just that is suffisant : Discourse.Markdown.whiteListTag(‘textarea’);

For this script, i have no idea :

```
<script>
//<![CDATA[
WgWidget({
s: 218410, odh:8, doh:20, wj:'knots', tj:'c', waj:'m', fhours:72, lng:'fr',
params: ['WINDSPD','GUST','SMER','TMPE','CDC','APCPs'],
first_row:true,
spotname:true,
first_row_minfo:false,
last_row:false,
lat_lon:true,
tz:true,
sun:true,
link_archive:false,
link_new_window:true
},
'wg_target_div_218410_97924000'
);
//]]>
</script>

```

Or:

Discourse.Markdown.whiteListTag(‘script’, ‘//\<![CDATA[\*’);

For this file, no change i thinks :  
**.js.es6**

```js
import { registerOption } from 'pretty-text/pretty-text';

registerOption((siteSettings, opts) => {
  opts.features["..."] = true;
});

export function setup(helper) {
  helper.whiteList(['script[src]']);
  helper.whiteList(['iframe[src]']);
  helper.whiteList(['div[id]']);
}

```

sorry I can not test it because I do not have my computer I am at work, I only have a tablet.

---

_[View the full topic](https://meta.discourse.org/t/whitelist-all-the-code-inside-of-a-div-tag/51391)._
