JSFiddle - React, Tailwind, and code Playground

by RomainMazB

JavaScript

let filteredTagList = [];
let htmlAllowedEmptyTags = 'i, .ul.fa.fas.fol, div, span, i.fas'
htmlAllowedEmptyTags.split(/[\s,]+/).forEach(tagString => {
                let i = 0;
                tagString.split('.').forEach(tag => {
                    if (tag !== '' && ! filteredTagList.includes(tag)) {
                        filteredTagList.push(i ? '.'+ tag : tag)
                    }
                    i++
                })
            })
console.log(filteredTagList)